mirror of
https://github.com/shazow/ssh-chat.git
synced 2026-11-04 01:42:27 +03:00
Adding impl for quiet mode with tests.
This commit is contained in:
1 parent
362d0fdffd
commit
a2ee2000bb
4 files changed
+139
No files matched your search
@@ -196,6 +196,24 @@ func InitCommands(c *Commands) {
|
||||
},
|
||||
})
|
||||
|
||||
c.Add(Command{
|
||||
Prefix: "/quiet",
|
||||
Help: "Silence announcement-type messages (join, part, rename, etc).",
|
||||
Handler: func(channel *Channel, msg CommandMsg) error {
|
||||
u := msg.From()
|
||||
u.ToggleQuietMode()
|
||||
|
||||
var body string
|
||||
if u.Config.Quiet {
|
||||
body = "Quiet mode is toggled ON"
|
||||
} else {
|
||||
body = "Quiet mode is toggled OFF"
|
||||
}
|
||||
channel.Send(NewSystemMsg(body, u))
|
||||
return nil
|
||||
},
|
||||
})
|
||||
|
||||
c.Add(Command{
|
||||
Op: true,
|
||||
Prefix: "/op",
|
||||
|
||||
Reference in new issue
Block a user