summaryrefslogtreecommitdiff
path: root/app.go
diff options
context:
space:
mode:
authorHubert Hirtz <hubert@hirtzfr.eu>2020-08-19 21:56:04 +0200
committerHubert Hirtz <hubert@hirtzfr.eu>2020-08-19 21:57:37 +0200
commited39a2adbf1553308a15db79eb111e79d86a0d05 (patch)
tree50826d4de5d530903177180d98c7d6a2ea3aee40 /app.go
parentui: Autocompletion of nicknames (diff)
Fix highlight not following new nick on registration
Diffstat (limited to 'app.go')
-rw-r--r--app.go8
1 files changed, 3 insertions, 5 deletions
diff --git a/app.go b/app.go
index cb1eb3b..e718fc6 100644
--- a/app.go
+++ b/app.go
@@ -66,8 +66,6 @@ func NewApp(cfg Config) (app *App, err error) {
app.win.AddLine(ui.Home, ui.NewLineNow("ERROR --", "Registration failed"))
}
- app.highlights = append(app.highlights, app.s.NickCf())
-
return
}
@@ -110,9 +108,6 @@ func (app *App) handleIRCEvent(ev irc.Event) {
line += " as " + app.s.Nick()
}
app.win.AddLine(ui.Home, ui.NewLineNow("--", line))
- if app.cfg.Highlights == nil {
- app.highlights[0] = app.s.NickCf()
- }
case irc.SelfNickEvent:
line := fmt.Sprintf("\x0314%s\x03\u2192\x0314%s\x03", ev.FormerNick, ev.NewNick)
app.win.AddLine(ui.Home, ui.NewLine(ev.Time, "--", line, true, true))
@@ -253,6 +248,9 @@ func (app *App) isHighlight(nick, content string) bool {
return false
}
contentCf := strings.ToLower(content)
+ if app.highlights == nil {
+ return strings.Contains(contentCf, app.s.NickCf())
+ }
for _, h := range app.highlights {
if strings.Contains(contentCf, h) {
return true