From 58464d554c57aff36ab21aa3efb69e1388b8024e Mon Sep 17 00:00:00 2001 From: delthas Date: Fri, 23 Dec 2022 18:23:03 +0100 Subject: Hide on-register RPL_UMODEIS --- irc/session.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/irc/session.go b/irc/session.go index cd56ee1..a5e5c94 100644 --- a/irc/session.go +++ b/irc/session.go @@ -148,6 +148,8 @@ type Session struct { monitors map[string]struct{} // set of users we want to monitor (and keep even if they are disconnected). pendingChannels map[string]time.Time // set of join requests stamps for channels. + + receivedUserMode bool } func NewSession(out chan<- Message, params SessionParams) *Session { @@ -1413,6 +1415,12 @@ func (s *Session) handleMessageRegistered(msg Message, playback bool) (Event, er if len(msg.Params) < 2 { return nil, msg.errNotEnoughParams(2) } + if msg.Command == rplUmodeis && !s.receivedUserMode { + // ignore the first RPL_UMODEIS on join + s.receivedUserMode = true + return nil, nil + + } if msg.Command == errUnknowncommand && msg.Params[1] == "BOUNCER" { // ignore any error in response to unconditional BOUNCER LISTNETWORKS return nil, nil -- cgit v1.2.3