Parcourir la source

fix 2-parameter case for *playback

tags/v2.2.0
Shivaram Lingamneni il y a 4 ans
Parent
révision
af009a5bc1
2 fichiers modifiés avec 6 ajouts et 1 suppressions
  1. 4
    1
      irc/channel.go
  2. 2
    0
      irc/znc.go

+ 4
- 1
irc/channel.go Voir le fichier

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

+ 2
- 0
irc/znc.go Voir le fichier

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

Chargement…
Annuler
Enregistrer