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 {
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.CdEmote, common.Emotes)
@ -135,7 +136,9 @@ func (cr *ChatRoom) Leave(name, color string) {
client.conn.Close()
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)
}

View File

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

View File

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