From 74732c4aebef6022983b97d758a66ca759179dad Mon Sep 17 00:00:00 2001 From: Shivaram Lingamneni Date: Mon, 27 May 2019 04:40:24 -0400 Subject: [PATCH] new proposed format for RESUMED messages --- irc/client.go | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/irc/client.go b/irc/client.go index 85d3b5c4..7d0f0a0e 100644 --- a/irc/client.go +++ b/irc/client.go @@ -578,6 +578,9 @@ func (session *Session) playResume() { } timestamp := session.resumeDetails.Timestamp + if timestamp.IsZero() { + timestamp = session.client.ctime + } gap := lastDiscarded.Sub(timestamp) session.resumeDetails.HistoryIncomplete = gap > 0 gapSeconds := int(gap.Seconds()) + 1 // round up to avoid confusion @@ -595,10 +598,10 @@ func (session *Session) playResume() { } for _, fSession := range friend.Sessions() { if fSession.capabilities.Has(caps.Resume) { - if timestamp.IsZero() { - fSession.Send(nil, oldNickmask, "RESUMED", hostname) - } else { + if session.resumeDetails.HistoryIncomplete { fSession.Send(nil, oldNickmask, "RESUMED", hostname, timestampString) + } else { + fSession.Send(nil, oldNickmask, "RESUMED", hostname) } } else { if session.resumeDetails.HistoryIncomplete {