diff --git a/host.go b/host.go index 16595c3..1c615c0 100644 --- a/host.go +++ b/host.go @@ -411,7 +411,7 @@ func (h *Host) InitCommands(c *chat.Commands) { var whois string switch room.IsOp(msg.From()) { case true: - whois = id.WhoisAdmin(room, h) + whois = id.WhoisAdmin(room) case false: whois = id.Whois() } diff --git a/identity.go b/identity.go index ed74d62..93df4e5 100644 --- a/identity.go +++ b/identity.go @@ -60,7 +60,7 @@ func (i Identity) Whois() string { } // WhoisAdmin returns a whois description for admin users. -func (i Identity) WhoisAdmin(room *chat.Room, host *Host) string { +func (i Identity) WhoisAdmin(room *chat.Room) string { ip, _, _ := net.SplitHostPort(i.RemoteAddr().String()) fingerprint := "(no public key)" if i.PublicKey() != nil { @@ -68,15 +68,14 @@ func (i Identity) WhoisAdmin(room *chat.Room, host *Host) string { } isOp := "" - user, ok := host.GetUser(i.id) - if ok && room.IsOp(user) { - isOp = " > Op" + message.Newline + if member, ok := room.MemberByID(i.ID()); ok && room.IsOp(member.User) { + isOp = message.Newline + " > op: true" } return "name: " + i.Name() + message.Newline + - isOp + " > ip: " + ip + message.Newline + " > fingerprint: " + fingerprint + message.Newline + " > client: " + sanitize.Data(string(i.ClientVersion()), 64) + message.Newline + - " > joined: " + humantime.Since(i.created) + " ago" + " > joined: " + humantime.Since(i.created) + " ago" + + isOp }