summaryrefslogtreecommitdiff
path: root/irc
diff options
context:
space:
mode:
authordelthas <delthas@dille.cc>2021-07-11 20:45:57 +0200
committerHubert Hirtz <hubert@hirtz.pm>2021-07-14 11:25:42 +0200
commit2c5872f12039c1ffea9923fd8356ceafc86bcfdb (patch)
tree3df5989311f190b247bb4869335e1bae19d7c89a /irc
parentAdd notify types for fine-grained control of unread/highlight state (diff)
Print the channel topic on join
Fixes: #45
Diffstat (limited to 'irc')
-rw-r--r--irc/events.go1
-rw-r--r--irc/session.go1
2 files changed, 2 insertions, 0 deletions
diff --git a/irc/events.go b/irc/events.go
index 0451a80..eeac8fb 100644
--- a/irc/events.go
+++ b/irc/events.go
@@ -24,6 +24,7 @@ type UserNickEvent struct {
type SelfJoinEvent struct {
Channel string
Requested bool // whether we recently requested to join that channel
+ Topic string
}
type UserJoinEvent struct {
diff --git a/irc/session.go b/irc/session.go
index 33d52fc..d08fb22 100644
--- a/irc/session.go
+++ b/irc/session.go
@@ -692,6 +692,7 @@ func (s *Session) handleRegistered(msg Message) Event {
s.channels[channelCf] = c
ev := SelfJoinEvent{
Channel: c.Name,
+ Topic: c.Topic,
}
if stamp, ok := s.pendingChannels[channelCf]; ok && time.Now().Sub(stamp) < 5*time.Second {
ev.Requested = true