summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--app.go8
-rw-r--r--commands.go1
2 files changed, 7 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) {
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
}