mirror of
https://github.com/matrix-org/sliding-sync.git
synced 2025-03-10 13:37:11 +00:00
Use GMSL timestamps
This commit is contained in:
parent
e680a3c66d
commit
b71a2b7769
@ -5,6 +5,7 @@ import (
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"github.com/matrix-org/gomatrixserverlib"
|
||||
"github.com/rs/zerolog"
|
||||
"github.com/tidwall/gjson"
|
||||
"github.com/tidwall/sjson"
|
||||
@ -388,7 +389,7 @@ func (p *Poller) parseRoomsResponse(res *SyncResponse) {
|
||||
for _, ev := range roomData.InviteState.Events {
|
||||
if gjson.GetBytes(ev, "type").Str == "m.room.member" && gjson.GetBytes(ev, "content.membership").Str == "invite" {
|
||||
ev, _ = sjson.SetBytes(ev, "event_id", "$"+res.NextBatch+"-"+p.deviceID)
|
||||
ev, _ = sjson.SetBytes(ev, "origin_server_ts", time.Now().UnixMilli())
|
||||
ev, _ = sjson.SetBytes(ev, "origin_server_ts", int64(gomatrixserverlib.AsTimestamp(time.Now())))
|
||||
p.receiver.Accumulate(roomID, []json.RawMessage{ev})
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user