From a5f4bc2535a4ae4cbe84f645782b5e9d34a028b1 Mon Sep 17 00:00:00 2001 From: "." <.@.> Date: Sun, 8 May 2016 12:52:01 +1200 Subject: [PATCH] initial attempt at exposing op status --HG-- branch : nmdc-ircfrontend --- server.go | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/server.go b/server.go index 3a17eba..69825e8 100644 --- a/server.go +++ b/server.go @@ -484,19 +484,23 @@ func (s *Server) DisconnectClient() { } func (s *Server) sendNames() { - names := s.upstreamLauncher.Self.Nick // always include ourselves + + nameList := make([]string, 0) + if s.upstream != nil { s.upstream.Users(func(u *map[string]libnmdc.UserInfo) error { - for nick, _ := range *u { - if nick != s.upstreamLauncher.Self.Nick { // but don't repeat ourselves - names += " " + nick + for nick, nickinfo := range *u { + if nickinfo.IsOperator { + nameList = append(nameList, "@"+nick) + } else { + nameList = append(nameList, nick) } } return nil }) } - s.reply(rplNames, BLESSED_CHANNEL, names) + s.reply(rplNames, BLESSED_CHANNEL, strings.Join(nameList, " ")) s.reply(rplEndOfNames, BLESSED_CHANNEL) }