fix double nicks appearing in NAMES output

--HG--
branch : nmdc-ircfrontend
This commit is contained in:
. 2016-05-07 19:49:23 +12:00
parent 89a9664790
commit 6069ad8bd8

View File

@ -474,12 +474,14 @@ func (s *Server) DisconnectClient() {
} }
func (s *Server) sendNames() { func (s *Server) sendNames() {
names := s.upstreamLauncher.Self.Nick names := s.upstreamLauncher.Self.Nick // always include ourselves
if s.upstream != nil { if s.upstream != nil {
for nick, _ := range s.upstream.Users { for nick, _ := range s.upstream.Users {
if nick != s.upstreamLauncher.Self.Nick { // but don't repeat ourselves
names += " " + nick names += " " + nick
} }
} }
}
s.reply(rplNames, BLESSED_CHANNEL, names) s.reply(rplNames, BLESSED_CHANNEL, names)
s.reply(rplEndOfNames, BLESSED_CHANNEL) s.reply(rplEndOfNames, BLESSED_CHANNEL)