diff --git a/chatcommands.go b/chatcommands.go index 42761d8..c14930b 100644 --- a/chatcommands.go +++ b/chatcommands.go @@ -414,6 +414,7 @@ var commands = &CommandControl{ return fmt.Sprintf("ERROR: %s", err) } + cl.belongsTo.AddChatMsg(common.NewChatHiddenMessage(common.CdEmote, common.Emotes)) cl.belongsTo.AddModNotice(cl.name + " has reloaded emotes") common.LogInfof("Loaded %d emotes\n", num) return fmt.Sprintf("Emotes loaded: %d", num) diff --git a/chatroom.go b/chatroom.go index dc5fe56..47214f7 100644 --- a/chatroom.go +++ b/chatroom.go @@ -226,8 +226,13 @@ func (cr *ChatRoom) AddMsg(from *Client, isAction, isServer bool, msg string) { t = common.MsgServer } + cr.AddChatMsg(common.NewChatMessage(from.name, from.color, msg, from.CmdLevel, t)) +} + +// Add a chat message object to the queue +func (cr *ChatRoom) AddChatMsg(data common.ChatData) { select { - case cr.queue <- common.NewChatMessage(from.name, from.color, msg, from.CmdLevel, t): + case cr.queue <- data: default: common.LogErrorln("Unable to queue chat message. Channel full.") }