add new setting to suppress join/leave announcements

This commit is contained in:
Alex Dunn 2020-06-03 19:47:57 -07:00
parent d28d6e7635
commit 9b85475fe4
3 changed files with 8 additions and 3 deletions

View File

@ -109,8 +109,9 @@ func (cr *ChatRoom) Join(conn *chatConnection, data common.JoinData) (*Client, e
} else { } else {
client.Send(playingCommand) client.Send(playingCommand)
} }
cr.AddEventMsg(common.EvJoin, data.Name, data.Color) if !settings.LetThemLurk {
cr.AddEventMsg(common.EvJoin, data.Name, data.Color)
}
sendHiddenMessage(common.CdJoin, nil) sendHiddenMessage(common.CdJoin, nil)
sendHiddenMessage(common.CdEmote, common.Emotes) sendHiddenMessage(common.CdEmote, common.Emotes)
@ -135,7 +136,9 @@ func (cr *ChatRoom) Leave(name, color string) {
client.conn.Close() client.conn.Close()
cr.delClient(id) cr.delClient(id)
cr.AddEventMsg(common.EvLeave, name, color) if !settings.LetThemLurk {
cr.AddEventMsg(common.EvLeave, name, color)
}
common.LogChatf("[leave] %s %s\n", host, name) common.LogChatf("[leave] %s %s\n", host, name)
} }

View File

@ -26,6 +26,7 @@ type Settings struct {
AdminPassword string AdminPassword string
ApprovedEmotes []string // list of channels that have been approved for emote use. Global emotes are always "approved". ApprovedEmotes []string // list of channels that have been approved for emote use. Global emotes are always "approved".
Bans []BanInfo Bans []BanInfo
LetThemLurk bool // whether or not to announce users joining/leaving chat
ListenAddress string ListenAddress string
LogFile string LogFile string
LogLevel common.LogLevel LogLevel common.LogLevel

View File

@ -2,6 +2,7 @@
"AdminPassword": "", "AdminPassword": "",
"ApprovedEmotes": null, "ApprovedEmotes": null,
"Bans": [], "Bans": [],
"LetThemLurk": false,
"ListenAddress": ":8089", "ListenAddress": ":8089",
"LogFile": "thelog.log", "LogFile": "thelog.log",
"LogLevel": "debug", "LogLevel": "debug",