91 Commits

Author SHA1 Message Date
mik2k2
46e2e8a812 remove some unimportant TODOs; add a message when reverify kicks people; add a reverify test 2021-12-22 15:20:18 +01:00
mik2k2
1d63444579 check for ops in Auth.CheckPublicKey and move /allowlist handling to helper functions 2021-12-18 17:09:48 +01:00
mik2k2
69c236d8be s/whitelist/allowlist/ (user-facing); move helper functions outside the handler function 2021-07-16 14:27:29 +02:00
mik2k2
4961647f51 mutex whitelistMode and remove some deferred TODOs 2021-07-10 13:31:52 +02:00
mik2k2
253302a057 gofmt 2021-07-06 12:57:51 +02:00
mik2k2
efab623a6a add test for /whitelist 2021-07-06 12:55:47 +02:00
mik2k2
7951c57ef2 add /whitelist command with lots of open questions 2021-07-03 22:57:57 +02:00
Akshay Shekher
e1e534344e
Fix SSHCHAT_TIMESTAMP env variables (#392)
* Fixes Env Vars to pass config to ssh-chat.

The env vars were beign parsed and set to the host
before the user was even added to the host and
hence ignored. This change moves the env var parsing
to after initializing the user.

TODO: tests, completeness+reliability

* cleaned up the test

* reduced test flakyness by adding wait instead of being optimistic

Co-authored-by: Akshay <akshay.shekher@gmail.com>
2021-05-02 12:18:31 -04:00
Andrey Petrov
b73b45640c host: Fix /msg vs /reply message formatting
Closes #382
2021-04-06 09:28:48 -04:00
Andrey Petrov
8257ada10d host: Factor out PM code, add away status 2021-03-15 11:07:52 -04:00
Akshay
0338cb824d chat: Added support for user away status, fixes #377
made away toggle status, like irc

updated /away feature

* added away message
* added broadcast away message as emote
* updated names list to show away users on the same line, with colors

added /away -> back message

Update away time to be time since marked away

reverted changes made for /list
2021-03-15 10:30:54 -04:00
Abdelkader Bouadjadja
ebbbc3b6d9 Fix ~ Reply to user with symbol returning Err user not found 2021-03-13 14:56:36 +04:00
Andrey Petrov
4fe43746fe main: /rename should not complain when symbol is set and name is unchanged 2020-08-03 14:13:51 -04:00
Andrey Petrov
53ae43fb1b /motd: Add reload functionality when msg is @ 2020-08-03 13:26:12 -04:00
Andrey Petrov
e0ab53500e
Merge branch 'master' into sponsor-prefix 2020-08-03 11:41:19 -04:00
Pavel Zaitsev
5885f7fbdd updated tests, moved code closer to the caller.
* addded condition for zero time on lastMsg.

* removed extra paramter in NamePrefix
* moved code from NamePrefix to completeName
* removed extra parameter in tests calling to NamePrefix
2020-07-29 18:23:34 -04:00
Pavel Zaitsev
5ff2ea085b in autocomplete list moves your name to last item in the list of sorted current users 2020-07-24 10:16:29 -04:00
Pavel Zaitsev
b6a8763f3b updated in line with comments in PR
* reduce change footprint to parameter list
* moved Op flag display to last line as to not break bots
2020-07-16 20:57:48 -04:00
Pavel Zaitsev
5f201e0f20 now if both are ops it will be reflected in output of whois command 2020-07-07 23:24:25 -04:00
Andrey Petrov
ced5767bbb main: Add symbol support 2020-06-24 13:53:24 -04:00
Andrey Petrov
36843252b4 chat, main: Add /rename op command 2020-06-24 12:36:02 -04:00
Andrey Petrov
a3f41865fd main: Skip prompt, highlight, autocomplete in bot mode 2020-04-13 11:33:12 -04:00
Andrey Petrov
cce7defd5e main: Add TERM=bot handling for Host 2020-04-13 11:23:11 -04:00
Andrey Petrov
fdfdcf96b7 main, sshd: Add comments and TODOs 2020-04-12 13:04:53 -04:00
Chris Miller
dd2fadd6c1 Apply env vars SSHCHAT_TIMESTAMP and SSHCHAT_THEME 2020-04-12 12:37:55 -04:00
Andrey Petrov
67163a93a8 sshchat: term.Write on empty lines to fix prompt reset bug 2019-03-29 17:26:23 -04:00
Andrey Petrov
6acb0bf809 sshchat, host: Switch to new terminal clearline api 2019-03-21 15:33:18 -04:00
Andrey Petrov
8653f0a730 sshchat: Replace terminal echo hack with our forked terminal 2019-03-18 10:08:39 -04:00
Andrey Petrov
b8fb704c8f sshchat: Fix empty messages borking rendering 2019-03-17 16:10:16 -04:00
Andrey Petrov
9c3db55c83 sshchat: Echo command messages with the new timestamp code. 2019-03-17 13:50:01 -04:00
Andrey Petrov
eb10bad08e sshchat, chat: Override terminal echo and do our own echo 2019-03-16 11:52:07 -04:00
Andrey Petrov
6d3fce47cc Revert "host: Add timestamps into prompt when enabled"
This reverts commit 6ce14bfc33e5a5aeb6003cdec9a873588eabe8f0.

We're going to do another approach.
2019-03-16 11:52:07 -04:00
Andrey Petrov
4188a3bdac host: Add timestamps into prompt when enabled 2019-03-16 11:52:07 -04:00
Andrey Petrov
3f0faf761e main: Skip command autocomplete if space-prefixed
Fixes #300
2019-03-15 18:39:53 -04:00
Andrey Petrov
ae46a91e0f /reply: Set reply target properly
Fixes #299
2019-03-15 18:32:46 -04:00
Andrey Petrov
60701198fc /op: Fix room op being tied to the nick, add remove option
Closes #301
2019-03-15 18:18:20 -04:00
UlisseMini
a1b891aae2 host.go: drop = 0 from declaration; it is the zero value (golint) 2019-02-24 09:40:47 -06:00
Robert Hailey
40bf204058 chat: When a user leaves, add time since they joined to the exit message.
* Show the connection duration upon departure

* humantime: ugly sub-second precision replaces grammatically incorrect "1 seconds" message

* simplify function name

* humantime: repair unit test

* move: util/humantime -> internal/humantime

* go fmt everything
2019-01-02 15:46:21 -05:00
Andrey Petrov
903d6c9420
/ban query support (#286)
For #285 

Turns out there were some bugs in Set, and I was using it incorrectly too.

The query syntax is a little awkward but couldn't find a nicer easy to parse format that worked with quoted string values.
2018-12-25 14:29:19 -05:00
Andrey Petrov
3572c4674c main: Add /banned command to list banned entries for ops. 2018-12-15 19:04:42 -05:00
Andrey Petrov
66fee99a81 /uptime and /whois relative timestamps made more precise
Replaced go-humanize dependency with our own logic.

Fixes #259.
2018-01-19 12:35:45 -05:00
Steven L
e800c88a56 Fixed /reply bug (#230) 2017-04-27 21:04:37 -04:00
Andrey Petrov
cdcc4a9931 refactor: User.Config -> User.Config() and User.SetConfig(UserConfig) 2016-08-29 10:11:39 -04:00
Andrey Petrov
d950112dd9 refactor: Id -> ID 2016-08-24 13:54:20 -04:00
Andrey Petrov
0fcc076c74 set: Switch to a common set implementation 2016-08-24 13:54:20 -04:00
Greg Wedow
a67a9d115b /uptime: Format output to be more human-friendly 2016-08-21 12:20:53 -04:00
Andrey Petrov
47607af729 /reply: Enabled again.
Fixes #202
2016-08-16 14:20:51 -04:00
Andrey Petrov
398cd75c5e logging: Add [RemoteAddr] prefix to connection-related messages 2016-08-13 16:22:43 -04:00
Andrey Petrov
cfa86b3e2e /motd: Fixed set message and actual motd coming out of order.
Fixes #165
2016-08-12 16:35:00 -04:00
Micheal Winger
91c62966fa /msg: Send SystemMsg confirmation with each PM 2016-08-06 23:56:24 -04:00