diff options
author | Hubert Hirtz <hubert@hirtzfr.eu> | 2020-08-24 08:48:58 +0200 |
---|---|---|
committer | Hubert Hirtz <hubert@hirtzfr.eu> | 2020-08-24 08:48:58 +0200 |
commit | a033d0050ae618e60a87d5a4b296c09561063972 (patch) | |
tree | c49c52d29675e9c180135d878bb81c6472309a20 /irc | |
parent | Only fetch history on JOIN and PgUp (diff) |
Fix multiple SelfJoinEvent being sent
... every time NAMES were requested. SelfJoinEvent should be ok being in
the "JOIN" handler, since names are only useful for the user.
Diffstat (limited to 'irc')
-rw-r--r-- | irc/states.go | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/irc/states.go b/irc/states.go index e68788a..365224e 100644 --- a/irc/states.go +++ b/irc/states.go @@ -631,6 +631,7 @@ func (s *Session) handle(msg Message) (err error) { Name: msg.Params[0], Members: map[*User]string{}, } + s.evts <- SelfJoinEvent{Channel: msg.Params[0]} } else if c, ok := s.channels[channelCf]; ok { if _, ok := s.users[nickCf]; !ok { s.users[nickCf] = &User{Nick: nick} @@ -709,11 +710,6 @@ func (s *Session) handle(msg Message) (err error) { s.channels[channelCf] = c } - case rplEndofnames: - channelCf := strings.ToLower(msg.Params[1]) - if c, ok := s.channels[channelCf]; ok { - s.evts <- SelfJoinEvent{Channel: c.Name} - } case rplTopic: channelCf := strings.ToLower(msg.Params[1]) if c, ok := s.channels[channelCf]; ok { |