commit fe15e93
Hubert Hirtz
·
2021-09-13 13:04:04 +0000 UTC
parent 34d8f9c
Fix typing indicators not being removed
2 files changed,
+16,
-0
M
app.go
M
app.go
+12,
-0
1@@ -194,6 +194,14 @@ func (app *App) ircLoop() {
2 src: ircEvent,
3 content: session,
4 }
5+ go func() {
6+ for stop := range session.TypingStops() {
7+ app.events <- event{
8+ src: ircEvent,
9+ content: stop,
10+ }
11+ }
12+ }()
13 for msg := range in {
14 if app.cfg.Debug {
15 app.queueStatusLine(ui.Line{
16@@ -501,6 +509,10 @@ func (app *App) handleIRCEvent(ev interface{}) {
17 app.s = s
18 return
19 }
20+ if _, ok := ev.(irc.Typing); ok {
21+ // Just refresh the screen.
22+ return
23+ }
24
25 msg := ev.(irc.Message)
26
+4,
-0
1@@ -244,6 +244,10 @@ func (s *Session) Typings(target string) []string {
2 return res
3 }
4
5+func (s *Session) TypingStops() <-chan Typing {
6+ return s.typings.Stops()
7+}
8+
9 func (s *Session) ChannelsSharedWith(name string) []string {
10 var user *User
11 if u, ok := s.users[s.Casemap(name)]; ok {