summaryrefslogtreecommitdiff
path: root/irc/states.go
diff options
context:
space:
mode:
Diffstat (limited to 'irc/states.go')
-rw-r--r--irc/states.go15
1 files changed, 11 insertions, 4 deletions
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