diff options
author | Hubert Hirtz <hubert@hirtzfr.eu> | 2020-08-16 16:04:19 +0200 |
---|---|---|
committer | Hubert Hirtz <hubert@hirtzfr.eu> | 2020-08-16 16:04:19 +0200 |
commit | 1b15bf87e804692ca07bb5b7766d1fb80b024769 (patch) | |
tree | 3386cada20a2cd6ac81bd420ee29bac521d6474c /irc/states.go | |
parent | irc: Simplify debug logging of incoming messages (diff) |
irc: Use typing constants
Diffstat (limited to 'irc/states.go')
-rw-r--r-- | irc/states.go | 15 |
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 |