Browse Source

fix 2-parameter case for *playback

tags/v2.2.0
Shivaram Lingamneni 3 years ago
parent
commit
af009a5bc1
2 changed files with 6 additions and 1 deletions
  1. 4
    1
      irc/channel.go
  2. 2
    0
      irc/znc.go

+ 4
- 1
irc/channel.go View File

@@ -813,16 +813,19 @@ func (channel *Channel) autoReplayHistory(client *Client, rb *ResponseBuffer, sk
813 813
 	// autoreplay any messages as necessary
814 814
 	var items []history.Item
815 815
 
816
+	hasAutoreplayTimestamps := false
816 817
 	var start, end time.Time
817 818
 	if rb.session.zncPlaybackTimes.ValidFor(channel.NameCasefolded()) {
819
+		hasAutoreplayTimestamps = true
818 820
 		start, end = rb.session.zncPlaybackTimes.start, rb.session.zncPlaybackTimes.end
819 821
 	} else if !rb.session.autoreplayMissedSince.IsZero() {
820 822
 		// we already checked for history caps in `playReattachMessages`
823
+		hasAutoreplayTimestamps = true
821 824
 		start = time.Now().UTC()
822 825
 		end = rb.session.autoreplayMissedSince
823 826
 	}
824 827
 
825
-	if !start.IsZero() || !end.IsZero() {
828
+	if hasAutoreplayTimestamps {
826 829
 		_, seq, _ := channel.server.GetHistorySequence(channel, client, "")
827 830
 		if seq != nil {
828 831
 			zncMax := channel.server.Config().History.ZNCMax

+ 2
- 0
irc/znc.go View File

@@ -108,6 +108,8 @@ func zncPlaybackPlayHandler(client *Client, command string, params []string, rb
108 108
 	now := time.Now().UTC()
109 109
 	var start, end time.Time
110 110
 	switch len(params) {
111
+	case 2:
112
+		// #1205: this should have the same semantics as `LATEST *`
111 113
 	case 3:
112 114
 		// #831: this should have the same semantics as `LATEST timestamp=qux`,
113 115
 		// or equivalently `BETWEEN timestamp=$now timestamp=qux`, as opposed to

Loading…
Cancel
Save