diff --git a/pkg/commands.go b/pkg/commands.go index 59e55ef..b6ee236 100644 --- a/pkg/commands.go +++ b/pkg/commands.go @@ -124,6 +124,13 @@ func (s *Server) KickCommand(words []string, sub *Subscriber) { }) s.DeleteSubscriber(other) sub.ChatServer("%s has been kicked from the room", username) + + // Broadcast it to everyone. + s.Broadcast(Message{ + Action: ActionPresence, + Username: username, + Message: "has been kicked from the room!", + }) } } @@ -197,6 +204,13 @@ func (s *Server) BanCommand(words []string, sub *Subscriber) { // Ban them. BanUser(username, duration) + // Broadcast it to everyone. + s.Broadcast(Message{ + Action: ActionPresence, + Username: username, + Message: "has been banned!", + }) + other.ChatServer("You have been banned from the chat room by %s. You may come back after %d hours.", sub.Username, duration/time.Hour) other.SendJSON(Message{ Action: ActionKick,