1
0
Fork 0
mirror of https://github.com/anyproto/any-sync.git synced 2025-06-08 05:57:03 +09:00

Send timestamp to addcontent

This commit is contained in:
mcrakhman 2023-05-04 14:12:29 +02:00 committed by Mikhail Iudin
parent 21bde9743d
commit 2958e32636
No known key found for this signature in database
GPG key ID: FAAAA8BAABDFF1C0
4 changed files with 68 additions and 8 deletions

View file

@ -6,7 +6,6 @@ import (
"github.com/anytypeio/any-sync/util/cidutil"
"github.com/anytypeio/any-sync/util/crypto"
"github.com/gogo/protobuf/proto"
"time"
)
var ErrEmptyChange = errors.New("change payload should not be empty")
@ -20,6 +19,7 @@ type BuilderContent struct {
PrivKey crypto.PrivKey
ReadKey crypto.SymKey
Content []byte
Timestamp int64
}
type InitialContent struct {
@ -166,7 +166,7 @@ func (c *changeBuilder) Build(payload BuilderContent) (ch *Change, rawIdChange *
AclHeadId: payload.AclHeadId,
SnapshotBaseId: payload.SnapshotBaseId,
ReadKeyId: payload.ReadKeyId,
Timestamp: time.Now().Unix(),
Timestamp: payload.Timestamp,
Identity: identity,
IsSnapshot: payload.IsSnapshot,
}