From cfeb9748fc1a8924121a93dfd8dd3372c44bb2e2 Mon Sep 17 00:00:00 2001 From: Jono Wenger <jono@elixxir.io> Date: Tue, 19 Oct 2021 12:42:09 -0700 Subject: [PATCH] Fix group binding timestamp --- bindings/group.go | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/bindings/group.go b/bindings/group.go index ddd9a17bd..880e9dbec 100644 --- a/bindings/group.go +++ b/bindings/group.go @@ -13,7 +13,6 @@ import ( gs "gitlab.com/elixxir/client/groupChat/groupStore" "gitlab.com/elixxir/crypto/group" "gitlab.com/xx_network/primitives/id" - "time" ) // GroupChat object contains the group chat manager. @@ -292,8 +291,9 @@ func (gmr *GroupMessageReceive) GetTimestampNano() int64 { // GetTimestampMS returns the message timestamp in milliseconds. func (gmr *GroupMessageReceive) GetTimestampMS() int64 { - ts := uint64(gmr.Timestamp.UnixNano()) / uint64(time.Millisecond) - return int64(ts) + ts := gmr.Timestamp.UnixNano() + ts = (ts + 500000) / 1000000 + return ts } // GetRoundID returns the ID of the round the message was sent on. @@ -310,6 +310,7 @@ func (gmr *GroupMessageReceive) GetRoundTimestampNano() int64 { // GetRoundTimestampMS returns the timestamp, in milliseconds, of the round the // message was sent on. func (gmr *GroupMessageReceive) GetRoundTimestampMS() int64 { - ts := uint64(gmr.RoundTimestamp.UnixNano()) / uint64(time.Millisecond) - return int64(ts) + ts := gmr.RoundTimestamp.UnixNano() + ts = (ts + 500000) / 1000000 + return ts } -- GitLab