diff options
Diffstat (limited to 'irc/states.go')
-rw-r--r-- | irc/states.go | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/irc/states.go b/irc/states.go index da5d582..626f3b7 100644 --- a/irc/states.go +++ b/irc/states.go @@ -117,6 +117,8 @@ type Channel struct { TopicWho *Prefix TopicTime time.Time Secret bool + + complete bool } type SessionParams struct { @@ -701,7 +703,6 @@ 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{Name: msg.Prefix.Copy()} @@ -803,6 +804,13 @@ func (s *Session) handle(msg Message) (err error) { s.channels[channelCf] = c } + case rplEndofnames: + channelCf := s.Casemap(msg.Params[1]) + if c, ok := s.channels[channelCf]; ok && !c.complete { + c.complete = true + s.channels[channelCf] = c + s.evts <- SelfJoinEvent{Channel: c.Name} + } case rplTopic: channelCf := s.Casemap(msg.Params[1]) if c, ok := s.channels[channelCf]; ok { |