mirror of
https://github.com/ergochat/ergo.git
synced 2024-11-29 07:29:31 +01:00
fix 2-parameter case for *playback
This commit is contained in:
parent
e6e55bbf29
commit
af009a5bc1
@ -813,16 +813,19 @@ func (channel *Channel) autoReplayHistory(client *Client, rb *ResponseBuffer, sk
|
||||
// autoreplay any messages as necessary
|
||||
var items []history.Item
|
||||
|
||||
hasAutoreplayTimestamps := false
|
||||
var start, end time.Time
|
||||
if rb.session.zncPlaybackTimes.ValidFor(channel.NameCasefolded()) {
|
||||
hasAutoreplayTimestamps = true
|
||||
start, end = rb.session.zncPlaybackTimes.start, rb.session.zncPlaybackTimes.end
|
||||
} else if !rb.session.autoreplayMissedSince.IsZero() {
|
||||
// we already checked for history caps in `playReattachMessages`
|
||||
hasAutoreplayTimestamps = true
|
||||
start = time.Now().UTC()
|
||||
end = rb.session.autoreplayMissedSince
|
||||
}
|
||||
|
||||
if !start.IsZero() || !end.IsZero() {
|
||||
if hasAutoreplayTimestamps {
|
||||
_, seq, _ := channel.server.GetHistorySequence(channel, client, "")
|
||||
if seq != nil {
|
||||
zncMax := channel.server.Config().History.ZNCMax
|
||||
|
@ -108,6 +108,8 @@ func zncPlaybackPlayHandler(client *Client, command string, params []string, rb
|
||||
now := time.Now().UTC()
|
||||
var start, end time.Time
|
||||
switch len(params) {
|
||||
case 2:
|
||||
// #1205: this should have the same semantics as `LATEST *`
|
||||
case 3:
|
||||
// #831: this should have the same semantics as `LATEST timestamp=qux`,
|
||||
// or equivalently `BETWEEN timestamp=$now timestamp=qux`, as opposed to
|
||||
|
Loading…
Reference in New Issue
Block a user