Skip to content

Commit

Permalink
Fix last data received ts if message ts is higher than current time
Browse files Browse the repository at this point in the history
  • Loading branch information
tulir committed Apr 11, 2024
1 parent 86f0680 commit 584bc31
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions user.go
Original file line number Diff line number Diff line change
Expand Up @@ -820,6 +820,9 @@ func (user *User) syncHandleEvent(event any) {
case *libgm.WrappedMessage:
user.noDataReceivedRecently = false
user.lastDataReceived = time.Now()
if v.GetTimestamp() > user.lastDataReceived.UnixMicro() {
user.lastDataReceived = time.UnixMicro(v.GetTimestamp())
}
user.zlog.Debug().
Str("conversation_id", v.GetConversationID()).
Str("participant_id", v.GetParticipantID()).
Expand Down

0 comments on commit 584bc31

Please sign in to comment.