diff options
author | delthas <delthas@dille.cc> | 2022-12-23 18:23:03 +0100 |
---|---|---|
committer | delthas <delthas@dille.cc> | 2022-12-23 18:23:03 +0100 |
commit | 58464d554c57aff36ab21aa3efb69e1388b8024e (patch) | |
tree | a01b7c5a4a3b087e4be295907bb3631cce854002 | |
parent | Show MOTD in server buffer only (diff) |
Hide on-register RPL_UMODEIS
-rw-r--r-- | irc/session.go | 8 |
1 files changed, 8 insertions, 0 deletions
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 |