forked from External/ergo
fix #1676
Fix various pagination issues with CHATHISTORY; also undo #491 (msgid munging).
This commit is contained in:
parent
b478e93c11
commit
5bbee02fe6
13 changed files with 126 additions and 81 deletions
|
|
@ -640,7 +640,7 @@ func chathistoryHandler(server *Server, client *Client, msg ircmsg.Message, rb *
|
|||
}
|
||||
identifier, value := strings.ToLower(pieces[0]), pieces[1]
|
||||
if identifier == "msgid" {
|
||||
msgid, err = value, nil
|
||||
msgid, err = history.NormalizeMsgid(value), nil
|
||||
return
|
||||
} else if identifier == "timestamp" {
|
||||
timestamp, err = time.Parse(IRCv3TimestampFormat, value)
|
||||
|
|
@ -725,7 +725,17 @@ func chathistoryHandler(server *Server, client *Client, msg ircmsg.Message, rb *
|
|||
if listTargets {
|
||||
targets, err = client.listTargets(start, end, limit)
|
||||
} else {
|
||||
channel, sequence, err = server.GetHistorySequence(nil, client, target)
|
||||
// see #1676; for CHATHISTORY we need to make the paging window as exact as possible,
|
||||
// hence filtering out undisplayable messages on the backend, in order to send a full
|
||||
// paging window if possible
|
||||
var flags history.ExcludeFlags
|
||||
if !rb.session.capabilities.Has(caps.EventPlayback) {
|
||||
flags |= history.ExcludeTagmsg
|
||||
}
|
||||
if client.AccountSettings().ReplayJoins == ReplayJoinsNever {
|
||||
flags |= history.ExcludeJoins
|
||||
}
|
||||
channel, sequence, err = server.GetHistorySequence(nil, client, target, flags)
|
||||
if err != nil || sequence == nil {
|
||||
return
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue