summaryrefslogtreecommitdiff
path: root/irc
diff options
context:
space:
mode:
Diffstat (limited to 'irc')
-rw-r--r--irc/events.go12
-rw-r--r--irc/states.go15
2 files changed, 17 insertions, 10 deletions
diff --git a/irc/events.go b/irc/events.go
index 194bc1c..32eb457 100644
--- a/irc/events.go
+++ b/irc/events.go
@@ -60,16 +60,16 @@ type ChannelMessageEvent struct {
Time time.Time
}
-type QueryTypingEvent struct {
- Nick string
- State int
- Time time.Time
+type QueryTagEvent struct {
+ Nick string
+ Typing int
+ Time time.Time
}
-type ChannelTypingEvent struct {
+type ChannelTagEvent struct {
Nick string
Channel string
- State int
+ Typing int
Time time.Time
}
diff --git a/irc/states.go b/irc/states.go
index 87f8fa2..8638483 100644
--- a/irc/states.go
+++ b/irc/states.go
@@ -60,6 +60,13 @@ var SupportedCapabilities = map[string]struct{}{
"userhost-in-names": {},
}
+const (
+ TypingUnspec = iota
+ TypingActive
+ TypingPaused
+ TypingDone
+)
+
type ConnectionState int
const (
@@ -681,14 +688,14 @@ func (s *Session) handle(msg Message) (err error) {
break
}
- typing := 0
+ typing := TypingUnspec
if t, ok := msg.Tags["+typing"]; ok {
if t == "active" {
- typing = 1
+ typing = TypingActive
} else if t == "paused" {
- typing = 2
+ typing = TypingPaused
} else if t == "done" {
- typing = 3
+ typing = TypingDone
}
} else {
break