summaryrefslogtreecommitdiff
path: root/app.go
diff options
context:
space:
mode:
authorHubert Hirtz <hubert@hirtz.pm>2021-11-29 09:32:51 +0100
committerHubert Hirtz <hubert@hirtz.pm>2021-11-29 09:32:51 +0100
commit24a84fad9bf5d53ef364d4711f6fb78e89b97a47 (patch)
tree97cd4557908458ba096588034d1b5fc6cff86a3b /app.go
parentUse RPL_SASLSUCCESS to end registration (diff)
Fetch history for queries
Diffstat (limited to 'app.go')
-rw-r--r--app.go8
1 files changed, 6 insertions, 2 deletions
diff --git a/app.go b/app.go
index f50f8bd..5d5cf7e 100644
--- a/app.go
+++ b/app.go
@@ -721,7 +721,11 @@ func (app *App) handleIRCEvent(netID string, ev interface{}) {
case irc.MessageEvent:
buffer, line, notification := app.formatMessage(s, ev)
if buffer != "" && !s.IsChannel(buffer) {
- app.win.AddBuffer(netID, "", buffer)
+ if _, added := app.win.AddBuffer(netID, "", buffer); added {
+ s.NewHistoryRequest(buffer).
+ WithLimit(200).
+ Before(msg.TimeOrNow())
+ }
}
app.win.AddLine(netID, buffer, notification, line)
if notification == ui.NotifyHighlight {
@@ -733,7 +737,7 @@ func (app *App) handleIRCEvent(netID string, ev interface{}) {
}
bounds := app.messageBounds[boundKey{netID, ev.Target}]
bounds.Update(&line)
- app.messageBounds[boundKey{netID, ev.Target}] = bounds
+ app.messageBounds[boundKey{netID, buffer}] = bounds
case irc.HistoryTargetsEvent:
for target, last := range ev.Targets {
if s.IsChannel(target) {