commit 58464d5
delthas
·
2022-12-23 17:23:03 +0000 UTC
parent 7adcd79
Hide on-register RPL_UMODEIS
1 files changed,
+8,
-0
+8,
-0
1@@ -148,6 +148,8 @@ type Session struct {
2 monitors map[string]struct{} // set of users we want to monitor (and keep even if they are disconnected).
3
4 pendingChannels map[string]time.Time // set of join requests stamps for channels.
5+
6+ receivedUserMode bool
7 }
8
9 func NewSession(out chan<- Message, params SessionParams) *Session {
10@@ -1413,6 +1415,12 @@ func (s *Session) handleMessageRegistered(msg Message, playback bool) (Event, er
11 if len(msg.Params) < 2 {
12 return nil, msg.errNotEnoughParams(2)
13 }
14+ if msg.Command == rplUmodeis && !s.receivedUserMode {
15+ // ignore the first RPL_UMODEIS on join
16+ s.receivedUserMode = true
17+ return nil, nil
18+
19+ }
20 if msg.Command == errUnknowncommand && msg.Params[1] == "BOUNCER" {
21 // ignore any error in response to unconditional BOUNCER LISTNETWORKS
22 return nil, nil