1
0
Fork 0
forked from External/ergo
Fix various pagination issues with CHATHISTORY; also undo #491
(msgid munging).
This commit is contained in:
Shivaram Lingamneni 2021-10-29 04:50:24 -04:00
parent b478e93c11
commit 5bbee02fe6
13 changed files with 126 additions and 81 deletions

View file

@ -862,7 +862,7 @@ func (server *Server) setupListeners(config *Config) (err error) {
// suitable for ListCorrespondents (i.e., this function is still used to
// decide whether the ringbuf or mysql is authoritative about the client's
// message history).
func (server *Server) GetHistorySequence(providedChannel *Channel, client *Client, query string) (channel *Channel, sequence history.Sequence, err error) {
func (server *Server) GetHistorySequence(providedChannel *Channel, client *Client, query string, excludeFlags history.ExcludeFlags) (channel *Channel, sequence history.Sequence, err error) {
config := server.Config()
// 4 cases: {persistent, ephemeral} x {normal, conversation}
// with ephemeral history, target is implicit in the choice of `hist`,
@ -940,9 +940,9 @@ func (server *Server) GetHistorySequence(providedChannel *Channel, client *Clien
}
if hist != nil {
sequence = hist.MakeSequence(correspondent, cutoff)
sequence = hist.MakeSequence(correspondent, cutoff, excludeFlags)
} else if target != "" {
sequence = server.historyDB.MakeSequence(target, correspondent, cutoff)
sequence = server.historyDB.MakeSequence(target, correspondent, cutoff, excludeFlags)
}
return
}