initial attempt at exposing op status
--HG-- branch : nmdc-ircfrontend
This commit is contained in:
parent
3cda342302
commit
a5f4bc2535
14
server.go
14
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)
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user