diff options
author | Hubert Hirtz <hubert@hirtz.pm> | 2021-11-29 09:32:51 +0100 |
---|---|---|
committer | Hubert Hirtz <hubert@hirtz.pm> | 2021-11-29 09:32:51 +0100 |
commit | 24a84fad9bf5d53ef364d4711f6fb78e89b97a47 (patch) | |
tree | 97cd4557908458ba096588034d1b5fc6cff86a3b /app.go | |
parent | Use RPL_SASLSUCCESS to end registration (diff) |
Fetch history for queries
Diffstat (limited to 'app.go')
-rw-r--r-- | app.go | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -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) { |