summaryrefslogtreecommitdiff
path: root/app.go
diff options
context:
space:
mode:
authordelthas <delthas@dille.cc>2022-04-15 14:55:18 +0200
committerdelthas <delthas@dille.cc>2022-04-15 14:55:18 +0200
commitc86a2fae090aeb59620efb7996c4c6739601d63f (patch)
treea4ab3687a749ea6a077702d337b7b7601275da4f /app.go
parentImplement SEARCH (diff)
Only send READ for messages received from a channel
i.e. don't enter an infinite loop when printing disconnection errors :-)
Diffstat (limited to 'app.go')
-rw-r--r--app.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/app.go b/app.go
index e2fa566..9fb6a2d 100644
--- a/app.go
+++ b/app.go
@@ -705,6 +705,7 @@ func (app *App) handleIRCEvent(netID string, ev interface{}) {
HeadColor: tcell.ColorGray,
Body: body.StyledString(),
Highlight: true,
+ Readable: true,
})
case irc.UserNickEvent:
line := app.formatEvent(ev)
@@ -782,6 +783,7 @@ func (app *App) handleIRCEvent(netID string, ev interface{}) {
HeadColor: tcell.ColorGray,
Body: ui.Styled(body, tcell.StyleDefault.Foreground(tcell.ColorGray)),
Highlight: notify == ui.NotifyHighlight,
+ Readable: true,
})
case irc.MessageEvent:
buffer, line, notification := app.formatMessage(s, ev)
@@ -1044,6 +1046,7 @@ func (app *App) formatEvent(ev irc.Event) ui.Line {
Body: body.StyledString(),
Mergeable: true,
Data: []irc.Event{ev},
+ Readable: true,
}
case irc.UserJoinEvent:
var body ui.StyledStringBuilder
@@ -1059,6 +1062,7 @@ func (app *App) formatEvent(ev irc.Event) ui.Line {
Body: body.StyledString(),
Mergeable: true,
Data: []irc.Event{ev},
+ Readable: true,
}
case irc.UserPartEvent:
var body ui.StyledStringBuilder
@@ -1074,6 +1078,7 @@ func (app *App) formatEvent(ev irc.Event) ui.Line {
Body: body.StyledString(),
Mergeable: true,
Data: []irc.Event{ev},
+ Readable: true,
}
case irc.UserQuitEvent:
var body ui.StyledStringBuilder
@@ -1089,6 +1094,7 @@ func (app *App) formatEvent(ev irc.Event) ui.Line {
Body: body.StyledString(),
Mergeable: true,
Data: []irc.Event{ev},
+ Readable: true,
}
case irc.TopicChangeEvent:
topic := ui.IRCString(ev.Topic).String()
@@ -1098,6 +1104,7 @@ func (app *App) formatEvent(ev irc.Event) ui.Line {
Head: "--",
HeadColor: tcell.ColorGray,
Body: ui.Styled(body, tcell.StyleDefault.Foreground(tcell.ColorGray)),
+ Readable: true,
}
case irc.ModeChangeEvent:
body := fmt.Sprintf("[%s]", ev.Mode)
@@ -1110,6 +1117,7 @@ func (app *App) formatEvent(ev irc.Event) ui.Line {
Body: ui.Styled(body, tcell.StyleDefault.Foreground(tcell.ColorGray)),
Mergeable: mergeable,
Data: []irc.Event{ev},
+ Readable: true,
}
default:
return ui.Line{}
@@ -1189,6 +1197,7 @@ func (app *App) formatMessage(s *irc.Session, ev irc.MessageEvent) (buffer strin
HeadColor: headColor,
Body: body.StyledString(),
Highlight: hlLine,
+ Readable: true,
}
return
}