diff --git a/client.go b/client.go index 438b151..f3d886b 100644 --- a/client.go +++ b/client.go @@ -293,7 +293,7 @@ func (c *Client) handleShell(channel ssh.Channel) { client.SysMsg("Banned by %s.", c.ColoredName()) c.Server.Ban(fingerprint, nil) client.Conn.Close() - c.Server.Broadcast(fmt.Sprintf("* %s was banned by %s", parts[1], c.ColoredName()), nil, true) + c.Server.Broadcast(fmt.Sprintf("* %s was banned by %s", parts[1], c.ColoredName()), nil) } } case "/op": @@ -323,7 +323,7 @@ func (c *Client) handleShell(channel ssh.Channel) { } else { client.SysMsg("Kicked by %s.", c.ColoredName()) client.Conn.Close() - c.Server.Broadcast(fmt.Sprintf("* %s was kicked by %s", parts[1], c.ColoredName()), nil, true) + c.Server.Broadcast(fmt.Sprintf("* %s was kicked by %s", parts[1], c.ColoredName()), nil) } } case "/silence": @@ -360,7 +360,7 @@ func (c *Client) handleShell(channel ssh.Channel) { } // Shutdown after 5 seconds go func() { - c.Server.Broadcast(ColorString("31", msg), nil, true) + c.Server.Broadcast(ColorString("31", msg), nil) time.Sleep(time.Second * 5) c.Server.Stop() }() @@ -435,7 +435,7 @@ func (c *Client) handleShell(channel ssh.Channel) { c.SysMsg("Message rejected.") continue } - c.Server.Broadcast(msg, c, true) + c.Server.Broadcast(msg, c) c.lastTX = time.Now() } diff --git a/server.go b/server.go index 2f39941..bd4230e 100644 --- a/server.go +++ b/server.go @@ -92,11 +92,11 @@ func (s *Server) Len() int { // SysMsg broadcasts the given message to everyone func (s *Server) SysMsg(msg string, args ...interface{}) { - s.Broadcast(ContinuousFormat(systemMessageFormat, " * "+fmt.Sprintf(msg, args...)), nil, false) + s.Broadcast(ContinuousFormat(systemMessageFormat, " * "+fmt.Sprintf(msg, args...)), nil) } // Broadcast broadcasts the given message to everyone except for the given client -func (s *Server) Broadcast(msg string, except *Client, canHighlight bool) { +func (s *Server) Broadcast(msg string, except *Client) { logger.Debugf("Broadcast to %d: %s", s.Len(), msg) s.history.Add(msg) @@ -105,7 +105,7 @@ func (s *Server) Broadcast(msg string, except *Client, canHighlight bool) { continue } - if strings.Contains(msg, client.Name) && canHighlight { + if strings.Contains(msg, client.Name) { // Turn message red if client's name is mentioned, and send BEL if they have enabled beeping personalMsg := strings.Replace(msg, client.Name, highlightFormat+client.Name+Reset, -1) if client.beepMe { @@ -151,8 +151,8 @@ func (s *Server) MotdBroadcast(client *Client) { if s.motd == "" { return } - s.Broadcast(ContinuousFormat(systemMessageFormat, fmt.Sprintf(" * New MOTD set by %s.", client.ColoredName())), client, false) - s.Broadcast(s.motd, client, false) + s.Broadcast(ContinuousFormat(systemMessageFormat, fmt.Sprintf(" * New MOTD set by %s.", client.ColoredName())), client) + s.Broadcast(s.motd, client) } // Add adds the client to the list of clients