From 62d92c660fe15e0749ba521ed8c0689a1653cf43 Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Mon, 1 Nov 2021 18:32:01 +0100 Subject: [PATCH] Mark admins as server operators in self WHO/WHOIS replies --- downstream.go | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/downstream.go b/downstream.go index e5663c3..43af55e 100644 --- a/downstream.go +++ b/downstream.go @@ -1899,10 +1899,14 @@ func (dc *downstreamConn) handleMessageRegistered(msg *irc.Message) error { if dc.network == nil && entityCM == dc.nickCM { // TODO: support AWAY (H/G) in self WHO reply + flags := "H" + if dc.user.Admin { + flags += "@" + } dc.SendMessage(&irc.Message{ Prefix: dc.srv.prefix(), Command: irc.RPL_WHOREPLY, - Params: []string{dc.nick, "*", dc.user.Username, dc.hostname, dc.srv.Hostname, dc.nick, "H", "0 " + dc.realname}, + Params: []string{dc.nick, "*", dc.user.Username, dc.hostname, dc.srv.Hostname, dc.nick, flags, "0 " + dc.realname}, }) dc.SendMessage(&irc.Message{ Prefix: dc.srv.prefix(), @@ -1973,6 +1977,13 @@ func (dc *downstreamConn) handleMessageRegistered(msg *irc.Message) error { Command: irc.RPL_WHOISSERVER, Params: []string{dc.nick, dc.nick, dc.srv.Hostname, "soju"}, }) + if dc.user.Admin { + dc.SendMessage(&irc.Message{ + Prefix: dc.srv.prefix(), + Command: irc.RPL_WHOISOPERATOR, + Params: []string{dc.nick, dc.nick, "is a bouncer administrator"}, + }) + } dc.SendMessage(&irc.Message{ Prefix: dc.srv.prefix(), Command: irc.RPL_ENDOFWHOIS,