diff options
Diffstat (limited to '')
-rw-r--r-- | app.go | 8 | ||||
-rw-r--r-- | commands.go | 1 |
2 files changed, 7 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) { diff --git a/commands.go b/commands.go index f81974f..5dff158 100644 --- a/commands.go +++ b/commands.go @@ -426,6 +426,7 @@ func commandDoQuery(app *App, args []string) (err error) { return fmt.Errorf("cannot query a channel, use JOIN instead") } i, _ := app.win.AddBuffer(netID, "", target) + s.NewHistoryRequest(target).WithLimit(200).Before(time.Now()) app.win.JumpBufferIndex(i) return nil } |