Browse Source

add new setting to suppress join/leave announcements

pull/1/head
Alex Dunn 1 year ago
parent
commit
9b85475fe4
  1. 9
      chatroom.go
  2. 1
      settings.go
  3. 1
      settings_example.json

9
chatroom.go

@ -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)
}

1
settings.go

@ -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

1
settings_example.json

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

Loading…
Cancel
Save