From 16197dc8075a6a67323d285af7593348f4289fd5 Mon Sep 17 00:00:00 2001 From: Vitaliy Vlasov Date: Thu, 24 Mar 2022 11:35:56 +0200 Subject: [PATCH] Sync profile picture --- images/identity.go | 3 + images/identity_test.go | 2 +- images/test_data.go | 2 + multiaccounts/database.go | 20 +- multiaccounts/database_test.go | 10 +- multiaccounts/migrations/bindata.go | 203 +- .../sql/1648646095_image_clock.down.sql | 32 + .../sql/1648646095_image_clock.up.sql | 1 + protocol/messenger.go | 81 +- protocol/messenger_handler.go | 40 + protocol/messenger_identity_image_test.go | 2 +- protocol/messenger_response.go | 26 +- .../messenger_sync_profile_picture_test.go | 184 + .../application_metadata_message.pb.go | 429 +- .../application_metadata_message.proto | 1 + protocol/protobuf/pairing.pb.go | 5214 ++++++++++++++++- protocol/protobuf/pairing.proto | 15 + protocol/v1/status_message.go | 3 + services/accounts/multiaccounts.go | 4 +- 19 files changed, 6013 insertions(+), 259 deletions(-) create mode 100644 multiaccounts/migrations/sql/1648646095_image_clock.down.sql create mode 100644 multiaccounts/migrations/sql/1648646095_image_clock.up.sql create mode 100644 protocol/messenger_sync_profile_picture_test.go diff --git a/images/identity.go b/images/identity.go index 2a3d5701b..79f70b6bb 100644 --- a/images/identity.go +++ b/images/identity.go @@ -15,6 +15,7 @@ type IdentityImage struct { Height int FileSize int ResizeTarget int + Clock uint64 } func (i IdentityImage) GetType() (ImageType, error) { @@ -48,6 +49,7 @@ func (i IdentityImage) MarshalJSON() ([]byte, error) { Height int `json:"height"` FileSize int `json:"fileSize"` ResizeTarget int `json:"resizeTarget"` + Clock uint64 `json:"clock"` }{ KeyUID: i.KeyUID, Name: i.Name, @@ -56,6 +58,7 @@ func (i IdentityImage) MarshalJSON() ([]byte, error) { Height: i.Height, FileSize: i.FileSize, ResizeTarget: i.ResizeTarget, + Clock: i.Clock, } return json.Marshal(temp) diff --git a/images/identity_test.go b/images/identity_test.go index 6e4751b8d..fb6b96508 100644 --- a/images/identity_test.go +++ b/images/identity_test.go @@ -63,7 +63,7 @@ func TestIdentityImage_MarshalJSON(t *testing.T) { FileSize: 256, ResizeTarget: 80, } - expected := `{"keyUid":"","type":"thumbnail","uri":"data:image/jpeg;base64,/9j/2wCEAFA3PEY8MlA=","width":80,"height":80,"fileSize":256,"resizeTarget":80}` + expected := `{"keyUid":"","type":"thumbnail","uri":"data:image/jpeg;base64,/9j/2wCEAFA3PEY8MlA=","width":80,"height":80,"fileSize":256,"resizeTarget":80,"clock":0}` js, err := json.Marshal(ii) require.NoError(t, err) diff --git a/images/test_data.go b/images/test_data.go index a8c0d38ac..df972142d 100644 --- a/images/test_data.go +++ b/images/test_data.go @@ -18,6 +18,7 @@ func SampleIdentityImages() []*IdentityImage { Height: 80, FileSize: 256, ResizeTarget: 80, + Clock: 0, }, { Name: LargeDimName, @@ -26,6 +27,7 @@ func SampleIdentityImages() []*IdentityImage { Height: 300, FileSize: 1024, ResizeTarget: 240, + Clock: 0, }, } } diff --git a/multiaccounts/database.go b/multiaccounts/database.go index 3d776c322..95d4ce5ed 100644 --- a/multiaccounts/database.go +++ b/multiaccounts/database.go @@ -50,7 +50,7 @@ func (db *Database) Close() error { } func (db *Database) GetAccounts() (rst []Account, err error) { - rows, err := db.db.Query("SELECT a.name, a.loginTimestamp, a.identicon, a.colorHash, a.colorId, a.keycardPairing, a.keyUid, ii.name, ii.image_payload, ii.width, ii.height, ii.file_size, ii.resize_target FROM accounts AS a LEFT JOIN identity_images AS ii ON ii.key_uid = a.keyUid ORDER BY loginTimestamp DESC") + rows, err := db.db.Query("SELECT a.name, a.loginTimestamp, a.identicon, a.colorHash, a.colorId, a.keycardPairing, a.keyUid, ii.name, ii.image_payload, ii.width, ii.height, ii.file_size, ii.resize_target, ii.clock FROM accounts AS a LEFT JOIN identity_images AS ii ON ii.key_uid = a.keyUid ORDER BY loginTimestamp DESC") if err != nil { return nil, err } @@ -71,6 +71,7 @@ func (db *Database) GetAccounts() (rst []Account, err error) { iiHeight := sql.NullInt64{} iiFileSize := sql.NullInt64{} iiResizeTarget := sql.NullInt64{} + iiClock := sql.NullInt64{} err = rows.Scan( &acc.Name, @@ -86,6 +87,7 @@ func (db *Database) GetAccounts() (rst []Account, err error) { &iiHeight, &iiFileSize, &iiResizeTarget, + &iiClock, ) if err != nil { return nil, err @@ -107,6 +109,7 @@ func (db *Database) GetAccounts() (rst []Account, err error) { ii.Height = int(iiHeight.Int64) ii.FileSize = int(iiFileSize.Int64) ii.ResizeTarget = int(iiResizeTarget.Int64) + ii.Clock = uint64(iiClock.Int64) if ii.Name == "" && len(ii.Payload) == 0 && ii.Width == 0 && ii.Height == 0 && ii.FileSize == 0 && ii.ResizeTarget == 0 { ii = nil @@ -171,7 +174,7 @@ func (db *Database) DeleteAccount(keyUID string) error { // Account images func (db *Database) GetIdentityImages(keyUID string) (iis []*images.IdentityImage, err error) { - rows, err := db.db.Query(`SELECT key_uid, name, image_payload, width, height, file_size, resize_target FROM identity_images WHERE key_uid = ?`, keyUID) + rows, err := db.db.Query(`SELECT key_uid, name, image_payload, width, height, file_size, resize_target, clock FROM identity_images WHERE key_uid = ?`, keyUID) if err != nil { return nil, err } @@ -182,7 +185,7 @@ func (db *Database) GetIdentityImages(keyUID string) (iis []*images.IdentityImag for rows.Next() { ii := &images.IdentityImage{} - err = rows.Scan(&ii.KeyUID, &ii.Name, &ii.Payload, &ii.Width, &ii.Height, &ii.FileSize, &ii.ResizeTarget) + err = rows.Scan(&ii.KeyUID, &ii.Name, &ii.Payload, &ii.Width, &ii.Height, &ii.FileSize, &ii.ResizeTarget, &ii.Clock) if err != nil { return nil, err } @@ -195,7 +198,7 @@ func (db *Database) GetIdentityImages(keyUID string) (iis []*images.IdentityImag func (db *Database) GetIdentityImage(keyUID, it string) (*images.IdentityImage, error) { var ii images.IdentityImage - err := db.db.QueryRow("SELECT key_uid, name, image_payload, width, height, file_size, resize_target FROM identity_images WHERE key_uid = ? AND name = ?", keyUID, it).Scan(&ii.KeyUID, &ii.Name, &ii.Payload, &ii.Width, &ii.Height, &ii.FileSize, &ii.ResizeTarget) + err := db.db.QueryRow("SELECT key_uid, name, image_payload, width, height, file_size, resize_target, clock FROM identity_images WHERE key_uid = ? AND name = ?", keyUID, it).Scan(&ii.KeyUID, &ii.Name, &ii.Payload, &ii.Width, &ii.Height, &ii.FileSize, &ii.ResizeTarget, &ii.Clock) if err == sql.ErrNoRows { return nil, nil } else if err != nil { @@ -204,7 +207,7 @@ func (db *Database) GetIdentityImage(keyUID, it string) (*images.IdentityImage, return &ii, nil } -func (db *Database) StoreIdentityImages(keyUID string, iis []*images.IdentityImage) (err error) { +func (db *Database) StoreIdentityImages(keyUID string, iis []*images.IdentityImage, publish bool) (err error) { // Because SQL INSERTs are triggered in a loop use a tx to ensure a single call to the DB. tx, err := db.db.BeginTx(context.Background(), &sql.TxOptions{}) if err != nil { @@ -227,7 +230,7 @@ func (db *Database) StoreIdentityImages(keyUID string, iis []*images.IdentityIma ii.KeyUID = keyUID _, err := tx.Exec( - "INSERT INTO identity_images (key_uid, name, image_payload, width, height, file_size, resize_target) VALUES (?, ?, ?, ?, ?, ?, ?)", + "INSERT INTO identity_images (key_uid, name, image_payload, width, height, file_size, resize_target, clock) VALUES (?, ?, ?, ?, ?, ?, ?, ?)", ii.KeyUID, ii.Name, ii.Payload, @@ -235,13 +238,16 @@ func (db *Database) StoreIdentityImages(keyUID string, iis []*images.IdentityIma ii.Height, ii.FileSize, ii.ResizeTarget, + ii.Clock, ) if err != nil { return err } } - db.publishOnIdentityImageSubscriptions() + if publish { + db.publishOnIdentityImageSubscriptions() + } return nil } diff --git a/multiaccounts/database_test.go b/multiaccounts/database_test.go index 6a2d337f3..16f0bd6f1 100644 --- a/multiaccounts/database_test.go +++ b/multiaccounts/database_test.go @@ -72,7 +72,7 @@ var ( func seedTestDBWithIdentityImages(t *testing.T, db *Database, keyUID string) { iis := images.SampleIdentityImages() - require.NoError(t, db.StoreIdentityImages(keyUID, iis)) + require.NoError(t, db.StoreIdentityImages(keyUID, iis, false)) } func TestDatabase_GetIdentityImages(t *testing.T) { @@ -80,7 +80,7 @@ func TestDatabase_GetIdentityImages(t *testing.T) { defer stop() seedTestDBWithIdentityImages(t, db, keyUID) - expected := `[{"keyUid":"0xdeadbeef","type":"large","uri":"data:image/png;base64,iVBORw0KGgoAAAANSUg=","width":240,"height":300,"fileSize":1024,"resizeTarget":240},{"keyUid":"0xdeadbeef","type":"thumbnail","uri":"data:image/jpeg;base64,/9j/2wCEAFA3PEY8MlA=","width":80,"height":80,"fileSize":256,"resizeTarget":80}]` + expected := `[{"keyUid":"0xdeadbeef","type":"large","uri":"data:image/png;base64,iVBORw0KGgoAAAANSUg=","width":240,"height":300,"fileSize":1024,"resizeTarget":240,"clock":0},{"keyUid":"0xdeadbeef","type":"thumbnail","uri":"data:image/jpeg;base64,/9j/2wCEAFA3PEY8MlA=","width":80,"height":80,"fileSize":256,"resizeTarget":80,"clock":0}]` oiis, err := db.GetIdentityImages(keyUID) require.NoError(t, err) @@ -108,12 +108,12 @@ func TestDatabase_GetIdentityImage(t *testing.T) { { keyUID, images.SmallDimName, - `{"keyUid":"0xdeadbeef","type":"thumbnail","uri":"data:image/jpeg;base64,/9j/2wCEAFA3PEY8MlA=","width":80,"height":80,"fileSize":256,"resizeTarget":80}`, + `{"keyUid":"0xdeadbeef","type":"thumbnail","uri":"data:image/jpeg;base64,/9j/2wCEAFA3PEY8MlA=","width":80,"height":80,"fileSize":256,"resizeTarget":80,"clock":0}`, }, { keyUID, images.LargeDimName, - `{"keyUid":"0xdeadbeef","type":"large","uri":"data:image/png;base64,iVBORw0KGgoAAAANSUg=","width":240,"height":300,"fileSize":1024,"resizeTarget":240}`, + `{"keyUid":"0xdeadbeef","type":"large","uri":"data:image/png;base64,iVBORw0KGgoAAAANSUg=","width":240,"height":300,"fileSize":1024,"resizeTarget":240,"clock":0}`, }, { keyUID2, @@ -154,7 +154,7 @@ func TestDatabase_GetAccountsWithIdentityImages(t *testing.T) { {Name: "string", KeyUID: keyUID2 + "2"}, {Name: "string", KeyUID: keyUID2 + "3"}, } - expected := `[{"name":"string","timestamp":100,"identicon":"data","colorHash":null,"colorId":0,"keycard-pairing":"","key-uid":"0xdeadbeef","images":[{"keyUid":"0xdeadbeef","type":"large","uri":"data:image/png;base64,iVBORw0KGgoAAAANSUg=","width":240,"height":300,"fileSize":1024,"resizeTarget":240},{"keyUid":"0xdeadbeef","type":"thumbnail","uri":"data:image/jpeg;base64,/9j/2wCEAFA3PEY8MlA=","width":80,"height":80,"fileSize":256,"resizeTarget":80}]},{"name":"string","timestamp":10,"identicon":"","colorHash":null,"colorId":0,"keycard-pairing":"","key-uid":"0x1337beef","images":null},{"name":"string","timestamp":0,"identicon":"","colorHash":null,"colorId":0,"keycard-pairing":"","key-uid":"0x1337beef2","images":null},{"name":"string","timestamp":0,"identicon":"","colorHash":null,"colorId":0,"keycard-pairing":"","key-uid":"0x1337beef3","images":[{"keyUid":"0x1337beef3","type":"large","uri":"data:image/png;base64,iVBORw0KGgoAAAANSUg=","width":240,"height":300,"fileSize":1024,"resizeTarget":240},{"keyUid":"0x1337beef3","type":"thumbnail","uri":"data:image/jpeg;base64,/9j/2wCEAFA3PEY8MlA=","width":80,"height":80,"fileSize":256,"resizeTarget":80}]}]` + expected := `[{"name":"string","timestamp":100,"identicon":"data","colorHash":null,"colorId":0,"keycard-pairing":"","key-uid":"0xdeadbeef","images":[{"keyUid":"0xdeadbeef","type":"large","uri":"data:image/png;base64,iVBORw0KGgoAAAANSUg=","width":240,"height":300,"fileSize":1024,"resizeTarget":240,"clock":0},{"keyUid":"0xdeadbeef","type":"thumbnail","uri":"data:image/jpeg;base64,/9j/2wCEAFA3PEY8MlA=","width":80,"height":80,"fileSize":256,"resizeTarget":80,"clock":0}]},{"name":"string","timestamp":10,"identicon":"","colorHash":null,"colorId":0,"keycard-pairing":"","key-uid":"0x1337beef","images":null},{"name":"string","timestamp":0,"identicon":"","colorHash":null,"colorId":0,"keycard-pairing":"","key-uid":"0x1337beef2","images":null},{"name":"string","timestamp":0,"identicon":"","colorHash":null,"colorId":0,"keycard-pairing":"","key-uid":"0x1337beef3","images":[{"keyUid":"0x1337beef3","type":"large","uri":"data:image/png;base64,iVBORw0KGgoAAAANSUg=","width":240,"height":300,"fileSize":1024,"resizeTarget":240,"clock":0},{"keyUid":"0x1337beef3","type":"thumbnail","uri":"data:image/jpeg;base64,/9j/2wCEAFA3PEY8MlA=","width":80,"height":80,"fileSize":256,"resizeTarget":80,"clock":0}]}]` for _, a := range testAccs { require.NoError(t, db.SaveAccount(a)) diff --git a/multiaccounts/migrations/bindata.go b/multiaccounts/migrations/bindata.go index d8ac72364..2a3d310de 100644 --- a/multiaccounts/migrations/bindata.go +++ b/multiaccounts/migrations/bindata.go @@ -1,20 +1,22 @@ -// Code generated by go-bindata. +// Code generated by go-bindata. DO NOT EDIT. // sources: -// 0001_accounts.down.sql -// 0001_accounts.up.sql -// 1605007189_identity_images.down.sql -// 1605007189_identity_images.up.sql -// 1606224181_drop_photo_path_from_accounts.down.sql -// 1606224181_drop_photo_path_from_accounts.up.sql -// 1649317600_add_color_hash.up.sql -// doc.go -// DO NOT EDIT! +// 0001_accounts.down.sql (21B) +// 0001_accounts.up.sql (163B) +// 1605007189_identity_images.down.sql (29B) +// 1605007189_identity_images.up.sql (268B) +// 1606224181_drop_photo_path_from_accounts.down.sql (892B) +// 1606224181_drop_photo_path_from_accounts.up.sql (866B) +// 1648646095_image_clock.down.sql (939B) +// 1648646095_image_clock.up.sql (69B) +// 1649317600_add_color_hash.up.sql (201B) +// doc.go (74B) package migrations import ( "bytes" "compress/gzip" + "crypto/sha256" "fmt" "io" "io/ioutil" @@ -27,7 +29,7 @@ import ( func bindataRead(data []byte, name string) ([]byte, error) { gz, err := gzip.NewReader(bytes.NewBuffer(data)) if err != nil { - return nil, fmt.Errorf("Read %q: %v", name, err) + return nil, fmt.Errorf("read %q: %v", name, err) } var buf bytes.Buffer @@ -35,7 +37,7 @@ func bindataRead(data []byte, name string) ([]byte, error) { clErr := gz.Close() if err != nil { - return nil, fmt.Errorf("Read %q: %v", name, err) + return nil, fmt.Errorf("read %q: %v", name, err) } if clErr != nil { return nil, err @@ -45,8 +47,9 @@ func bindataRead(data []byte, name string) ([]byte, error) { } type asset struct { - bytes []byte - info os.FileInfo + bytes []byte + info os.FileInfo + digest [sha256.Size]byte } type bindataFileInfo struct { @@ -90,8 +93,8 @@ func _0001_accountsDownSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "0001_accounts.down.sql", size: 21, mode: os.FileMode(436), modTime: time.Unix(1649447089, 0)} - a := &asset{bytes: bytes, info: info} + info := bindataFileInfo{name: "0001_accounts.down.sql", size: 21, mode: os.FileMode(0644), modTime: time.Unix(1586880790, 0)} + a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xd2, 0x61, 0x4c, 0x18, 0xfc, 0xc, 0xdf, 0x5c, 0x1f, 0x5e, 0xd3, 0xbd, 0xfa, 0x12, 0x5e, 0x8d, 0x8d, 0x8b, 0xb9, 0x5f, 0x99, 0x46, 0x63, 0xa5, 0xe3, 0xa6, 0x8a, 0x4, 0xf1, 0x73, 0x8a, 0xe9}} return a, nil } @@ -110,8 +113,8 @@ func _0001_accountsUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "0001_accounts.up.sql", size: 163, mode: os.FileMode(436), modTime: time.Unix(1649447089, 0)} - a := &asset{bytes: bytes, info: info} + info := bindataFileInfo{name: "0001_accounts.up.sql", size: 163, mode: os.FileMode(0644), modTime: time.Unix(1586880790, 0)} + a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xf2, 0xfa, 0x99, 0x8e, 0x96, 0xb3, 0x13, 0x6c, 0x1f, 0x6, 0x27, 0xc5, 0xd2, 0xd4, 0xe0, 0xa5, 0x26, 0x82, 0xa7, 0x26, 0xf2, 0x68, 0x9d, 0xed, 0x9c, 0x3d, 0xbb, 0xdc, 0x37, 0x28, 0xbc, 0x1}} return a, nil } @@ -130,8 +133,8 @@ func _1605007189_identity_imagesDownSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1605007189_identity_images.down.sql", size: 29, mode: os.FileMode(436), modTime: time.Unix(1649447089, 0)} - a := &asset{bytes: bytes, info: info} + info := bindataFileInfo{name: "1605007189_identity_images.down.sql", size: 29, mode: os.FileMode(0644), modTime: time.Unix(1610470168, 0)} + a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x2f, 0xcf, 0xa7, 0xae, 0xd5, 0x4f, 0xcd, 0x14, 0x63, 0x9, 0xbe, 0x39, 0x49, 0x18, 0x96, 0xb2, 0xa3, 0x8, 0x7d, 0x41, 0xdb, 0x50, 0x5d, 0xf5, 0x4d, 0xa2, 0xd, 0x8f, 0x57, 0x79, 0x77, 0x67}} return a, nil } @@ -150,8 +153,8 @@ func _1605007189_identity_imagesUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1605007189_identity_images.up.sql", size: 268, mode: os.FileMode(436), modTime: time.Unix(1649447089, 0)} - a := &asset{bytes: bytes, info: info} + info := bindataFileInfo{name: "1605007189_identity_images.up.sql", size: 268, mode: os.FileMode(0644), modTime: time.Unix(1610470168, 0)} + a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x50, 0xb6, 0xc1, 0x5c, 0x76, 0x72, 0x6b, 0x22, 0x34, 0xdc, 0x96, 0xdc, 0x2b, 0xfd, 0x2d, 0xbe, 0xcc, 0x1e, 0xd4, 0x5, 0x93, 0xd, 0xc2, 0x51, 0xf3, 0x1a, 0xef, 0x2b, 0x26, 0xa4, 0xeb, 0x65}} return a, nil } @@ -170,8 +173,8 @@ func _1606224181_drop_photo_path_from_accountsDownSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1606224181_drop_photo_path_from_accounts.down.sql", size: 892, mode: os.FileMode(436), modTime: time.Unix(1649447089, 0)} - a := &asset{bytes: bytes, info: info} + info := bindataFileInfo{name: "1606224181_drop_photo_path_from_accounts.down.sql", size: 892, mode: os.FileMode(0644), modTime: time.Unix(1610470168, 0)} + a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x90, 0x24, 0x17, 0x7, 0x80, 0x93, 0x6f, 0x8d, 0x5d, 0xaa, 0x8c, 0x79, 0x15, 0x5d, 0xb3, 0x19, 0xd7, 0xd8, 0x39, 0xf9, 0x3a, 0x63, 0x8f, 0x81, 0x15, 0xb6, 0xd6, 0x9a, 0x37, 0xa8, 0x8e, 0x9b}} return a, nil } @@ -190,8 +193,48 @@ func _1606224181_drop_photo_path_from_accountsUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1606224181_drop_photo_path_from_accounts.up.sql", size: 866, mode: os.FileMode(436), modTime: time.Unix(1649447089, 0)} - a := &asset{bytes: bytes, info: info} + info := bindataFileInfo{name: "1606224181_drop_photo_path_from_accounts.up.sql", size: 866, mode: os.FileMode(0644), modTime: time.Unix(1610470168, 0)} + a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xff, 0x4c, 0x97, 0xee, 0xef, 0x82, 0xb8, 0x6c, 0x71, 0xbb, 0x50, 0x7b, 0xe6, 0xd9, 0x22, 0x31, 0x7c, 0x1a, 0xfe, 0x91, 0x28, 0xf6, 0x6, 0x36, 0xe, 0xb1, 0xf1, 0xc8, 0x25, 0xac, 0x7e, 0xd6}} + return a, nil +} + +var __1648646095_image_clockDownSql = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xdc\x92\xbf\x6e\xdb\x30\x18\xc4\x77\x3e\xc5\x8d\x49\x40\x20\x0f\xe0\x49\x56\x68\x84\x28\x2d\xaa\x14\xd3\x34\x93\xc0\x48\x5f\x25\x22\xfa\x07\x89\x42\xe0\x3e\x7d\x61\xd9\xb0\x6b\xa3\xf5\xd6\xa5\xe3\x77\x3c\x92\x77\xfc\xf1\xf1\x01\xd9\x57\xe5\x03\xa1\xec\x69\x42\xd7\x07\x4c\xf3\x30\xf4\x63\x40\x39\xf6\xc3\xe0\xbb\x0a\x45\xdf\xcc\x6d\x37\x71\xd4\xd4\x15\x84\x4f\x42\x3b\x4f\x01\xc5\x48\x2e\x10\x1c\x02\xb5\x03\x82\x7b\x6f\x08\x0f\x8f\x2c\x36\x22\xb2\x02\x56\x6c\x53\x6d\x22\xf3\x06\x1b\xad\x95\x80\x2f\xa9\x0b\x3e\xec\x72\xdf\xba\x8a\xa6\xfc\xdd\x15\x1f\xf3\x70\xc7\x00\xe0\x83\x76\xf9\xec\x4b\x7c\x8b\x4c\xfc\x1c\x19\xbe\x88\x9d\x6b\xe9\x52\x59\x76\xe6\x83\xdb\x35\xbd\x2b\xb1\x56\x7a\x8d\x44\x5b\x24\x2f\x4a\x1d\x0c\x9f\xbe\x0c\x35\x7c\x17\x0e\x63\x4d\xbe\xaa\xc3\x79\xfe\xe1\x1b\xca\x27\xff\x93\xce\xd2\x48\xfb\x39\x0f\x6e\xac\xe8\x37\x67\x6a\xe4\x76\x1f\xfd\x8b\x78\xc3\xdd\x31\x1d\x5f\x12\xdd\x43\x27\x88\x75\xb2\x51\x32\xb6\x30\x22\x55\x51\x2c\xd8\x3d\x5e\xa5\x7d\xd6\x2f\x16\x46\xbf\xca\xa7\x15\x63\x32\xc9\x84\xb1\x90\x89\xd5\x7f\xa9\x8e\x4c\x28\x11\x5b\x5c\x1c\xcf\x2f\x4b\xf2\x43\x25\x7e\xac\xc2\xcf\x15\xf8\x55\xf4\x8d\xd1\xdb\xeb\x8b\x56\x8c\x3d\x19\x9d\xfe\x19\xc0\x8a\xb1\x13\xaa\x65\x5d\x6e\x96\xd7\x14\xdf\x65\x66\xb3\x6b\xf7\x7f\xcb\xe9\x16\xa8\x7f\x4f\xe8\xf8\x15\x6e\x82\x3a\x79\x7e\x05\x00\x00\xff\xff\xce\x2f\xe3\x37\xab\x03\x00\x00") + +func _1648646095_image_clockDownSqlBytes() ([]byte, error) { + return bindataRead( + __1648646095_image_clockDownSql, + "1648646095_image_clock.down.sql", + ) +} + +func _1648646095_image_clockDownSql() (*asset, error) { + bytes, err := _1648646095_image_clockDownSqlBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "1648646095_image_clock.down.sql", size: 939, mode: os.FileMode(0644), modTime: time.Unix(1650538025, 0)} + a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x4d, 0xa8, 0x1f, 0xf, 0xe0, 0xd7, 0xc9, 0x68, 0x98, 0xd8, 0x37, 0xb8, 0xba, 0x9e, 0xb2, 0x19, 0xf3, 0xc4, 0x73, 0x80, 0x3, 0x17, 0x2a, 0x53, 0x68, 0x10, 0x13, 0x54, 0x99, 0xb1, 0xf5, 0x1c}} + return a, nil +} + +var __1648646095_image_clockUpSql = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x72\xf4\x09\x71\x0d\x52\x08\x71\x74\xf2\x71\x55\xc8\x4c\x49\xcd\x2b\xc9\x2c\xa9\x8c\xcf\xcc\x4d\x4c\x4f\x2d\x56\x70\x74\x71\x51\x70\xf6\xf7\x09\xf5\xf5\x53\x48\xce\xc9\x4f\xce\x56\xf0\xf4\x0b\x51\xf0\xf3\x0f\x51\xf0\x0b\xf5\xf1\x51\x70\x71\x75\x73\x0c\xf5\x09\x51\x30\xb0\xe6\x02\x04\x00\x00\xff\xff\x22\x35\x20\xbf\x45\x00\x00\x00") + +func _1648646095_image_clockUpSqlBytes() ([]byte, error) { + return bindataRead( + __1648646095_image_clockUpSql, + "1648646095_image_clock.up.sql", + ) +} + +func _1648646095_image_clockUpSql() (*asset, error) { + bytes, err := _1648646095_image_clockUpSqlBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "1648646095_image_clock.up.sql", size: 69, mode: os.FileMode(0644), modTime: time.Unix(1650537691, 0)} + a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x98, 0xa6, 0xa4, 0x4e, 0x4e, 0xca, 0x17, 0x56, 0xea, 0xfb, 0xf0, 0xa9, 0x81, 0x95, 0xe, 0x80, 0x52, 0x1, 0x47, 0x9b, 0xde, 0x14, 0xfa, 0x72, 0xc9, 0x62, 0x6f, 0x24, 0xa2, 0xc, 0x32, 0x50}} return a, nil } @@ -210,8 +253,8 @@ func _1649317600_add_color_hashUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1649317600_add_color_hash.up.sql", size: 201, mode: os.FileMode(436), modTime: time.Unix(1649447080, 0)} - a := &asset{bytes: bytes, info: info} + info := bindataFileInfo{name: "1649317600_add_color_hash.up.sql", size: 201, mode: os.FileMode(0644), modTime: time.Unix(1650537691, 0)} + a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x1a, 0xf, 0x37, 0x6d, 0xcf, 0x99, 0xc9, 0x2e, 0xdc, 0x70, 0x11, 0xb4, 0x36, 0x26, 0x4f, 0x39, 0xa8, 0x44, 0xf, 0xcb, 0xcc, 0x81, 0x74, 0x7a, 0x88, 0xaa, 0x54, 0x8c, 0xc4, 0xe, 0x56, 0x4f}} return a, nil } @@ -230,8 +273,8 @@ func docGo() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "doc.go", size: 74, mode: os.FileMode(436), modTime: time.Unix(1649447089, 0)} - a := &asset{bytes: bytes, info: info} + info := bindataFileInfo{name: "doc.go", size: 74, mode: os.FileMode(0644), modTime: time.Unix(1586880790, 0)} + a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xde, 0x7c, 0x28, 0xcd, 0x47, 0xf2, 0xfa, 0x7c, 0x51, 0x2d, 0xd8, 0x38, 0xb, 0xb0, 0x34, 0x9d, 0x4c, 0x62, 0xa, 0x9e, 0x28, 0xc3, 0x31, 0x23, 0xd9, 0xbb, 0x89, 0x9f, 0xa0, 0x89, 0x1f, 0xe8}} return a, nil } @@ -239,8 +282,8 @@ func docGo() (*asset, error) { // It returns an error if the asset could not be found or // could not be loaded. func Asset(name string) ([]byte, error) { - cannonicalName := strings.Replace(name, "\\", "/", -1) - if f, ok := _bindata[cannonicalName]; ok { + canonicalName := strings.Replace(name, "\\", "/", -1) + if f, ok := _bindata[canonicalName]; ok { a, err := f() if err != nil { return nil, fmt.Errorf("Asset %s can't read by error: %v", name, err) @@ -250,6 +293,12 @@ func Asset(name string) ([]byte, error) { return nil, fmt.Errorf("Asset %s not found", name) } +// AssetString returns the asset contents as a string (instead of a []byte). +func AssetString(name string) (string, error) { + data, err := Asset(name) + return string(data), err +} + // MustAsset is like Asset but panics when Asset would return an error. // It simplifies safe initialization of global variables. func MustAsset(name string) []byte { @@ -261,12 +310,18 @@ func MustAsset(name string) []byte { return a } +// MustAssetString is like AssetString but panics when Asset would return an +// error. It simplifies safe initialization of global variables. +func MustAssetString(name string) string { + return string(MustAsset(name)) +} + // AssetInfo loads and returns the asset info for the given name. // It returns an error if the asset could not be found or // could not be loaded. func AssetInfo(name string) (os.FileInfo, error) { - cannonicalName := strings.Replace(name, "\\", "/", -1) - if f, ok := _bindata[cannonicalName]; ok { + canonicalName := strings.Replace(name, "\\", "/", -1) + if f, ok := _bindata[canonicalName]; ok { a, err := f() if err != nil { return nil, fmt.Errorf("AssetInfo %s can't read by error: %v", name, err) @@ -276,6 +331,33 @@ func AssetInfo(name string) (os.FileInfo, error) { return nil, fmt.Errorf("AssetInfo %s not found", name) } +// AssetDigest returns the digest of the file with the given name. It returns an +// error if the asset could not be found or the digest could not be loaded. +func AssetDigest(name string) ([sha256.Size]byte, error) { + canonicalName := strings.Replace(name, "\\", "/", -1) + if f, ok := _bindata[canonicalName]; ok { + a, err := f() + if err != nil { + return [sha256.Size]byte{}, fmt.Errorf("AssetDigest %s can't read by error: %v", name, err) + } + return a.digest, nil + } + return [sha256.Size]byte{}, fmt.Errorf("AssetDigest %s not found", name) +} + +// Digests returns a map of all known files and their checksums. +func Digests() (map[string][sha256.Size]byte, error) { + mp := make(map[string][sha256.Size]byte, len(_bindata)) + for name := range _bindata { + a, err := _bindata[name]() + if err != nil { + return nil, err + } + mp[name] = a.digest + } + return mp, nil +} + // AssetNames returns the names of the assets. func AssetNames() []string { names := make([]string, 0, len(_bindata)) @@ -288,12 +370,23 @@ func AssetNames() []string { // _bindata is a table, holding each asset generator, mapped to its name. var _bindata = map[string]func() (*asset, error){ "0001_accounts.down.sql": _0001_accountsDownSql, + "0001_accounts.up.sql": _0001_accountsUpSql, + "1605007189_identity_images.down.sql": _1605007189_identity_imagesDownSql, + "1605007189_identity_images.up.sql": _1605007189_identity_imagesUpSql, + "1606224181_drop_photo_path_from_accounts.down.sql": _1606224181_drop_photo_path_from_accountsDownSql, + "1606224181_drop_photo_path_from_accounts.up.sql": _1606224181_drop_photo_path_from_accountsUpSql, + + "1648646095_image_clock.down.sql": _1648646095_image_clockDownSql, + + "1648646095_image_clock.up.sql": _1648646095_image_clockUpSql, + "1649317600_add_color_hash.up.sql": _1649317600_add_color_hashUpSql, + "doc.go": docGo, } @@ -306,15 +399,15 @@ var _bindata = map[string]func() (*asset, error){ // img/ // a.png // b.png -// then AssetDir("data") would return []string{"foo.txt", "img"} -// AssetDir("data/img") would return []string{"a.png", "b.png"} -// AssetDir("foo.txt") and AssetDir("notexist") would return an error +// then AssetDir("data") would return []string{"foo.txt", "img"}, +// AssetDir("data/img") would return []string{"a.png", "b.png"}, +// AssetDir("foo.txt") and AssetDir("notexist") would return an error, and // AssetDir("") will return []string{"data"}. func AssetDir(name string) ([]string, error) { node := _bintree if len(name) != 0 { - cannonicalName := strings.Replace(name, "\\", "/", -1) - pathList := strings.Split(cannonicalName, "/") + canonicalName := strings.Replace(name, "\\", "/", -1) + pathList := strings.Split(canonicalName, "/") for _, p := range pathList { node = node.Children[p] if node == nil { @@ -336,18 +429,21 @@ type bintree struct { Func func() (*asset, error) Children map[string]*bintree } + var _bintree = &bintree{nil, map[string]*bintree{ - "0001_accounts.down.sql": &bintree{_0001_accountsDownSql, map[string]*bintree{}}, - "0001_accounts.up.sql": &bintree{_0001_accountsUpSql, map[string]*bintree{}}, - "1605007189_identity_images.down.sql": &bintree{_1605007189_identity_imagesDownSql, map[string]*bintree{}}, - "1605007189_identity_images.up.sql": &bintree{_1605007189_identity_imagesUpSql, map[string]*bintree{}}, + "0001_accounts.down.sql": &bintree{_0001_accountsDownSql, map[string]*bintree{}}, + "0001_accounts.up.sql": &bintree{_0001_accountsUpSql, map[string]*bintree{}}, + "1605007189_identity_images.down.sql": &bintree{_1605007189_identity_imagesDownSql, map[string]*bintree{}}, + "1605007189_identity_images.up.sql": &bintree{_1605007189_identity_imagesUpSql, map[string]*bintree{}}, "1606224181_drop_photo_path_from_accounts.down.sql": &bintree{_1606224181_drop_photo_path_from_accountsDownSql, map[string]*bintree{}}, - "1606224181_drop_photo_path_from_accounts.up.sql": &bintree{_1606224181_drop_photo_path_from_accountsUpSql, map[string]*bintree{}}, - "1649317600_add_color_hash.up.sql": &bintree{_1649317600_add_color_hashUpSql, map[string]*bintree{}}, - "doc.go": &bintree{docGo, map[string]*bintree{}}, + "1606224181_drop_photo_path_from_accounts.up.sql": &bintree{_1606224181_drop_photo_path_from_accountsUpSql, map[string]*bintree{}}, + "1648646095_image_clock.down.sql": &bintree{_1648646095_image_clockDownSql, map[string]*bintree{}}, + "1648646095_image_clock.up.sql": &bintree{_1648646095_image_clockUpSql, map[string]*bintree{}}, + "1649317600_add_color_hash.up.sql": &bintree{_1649317600_add_color_hashUpSql, map[string]*bintree{}}, + "doc.go": &bintree{docGo, map[string]*bintree{}}, }} -// RestoreAsset restores an asset under the given directory +// RestoreAsset restores an asset under the given directory. func RestoreAsset(dir, name string) error { data, err := Asset(name) if err != nil { @@ -365,14 +461,10 @@ func RestoreAsset(dir, name string) error { if err != nil { return err } - err = os.Chtimes(_filePath(dir, name), info.ModTime(), info.ModTime()) - if err != nil { - return err - } - return nil + return os.Chtimes(_filePath(dir, name), info.ModTime(), info.ModTime()) } -// RestoreAssets restores an asset under the given directory recursively +// RestoreAssets restores an asset under the given directory recursively. func RestoreAssets(dir, name string) error { children, err := AssetDir(name) // File @@ -390,7 +482,6 @@ func RestoreAssets(dir, name string) error { } func _filePath(dir, name string) string { - cannonicalName := strings.Replace(name, "\\", "/", -1) - return filepath.Join(append([]string{dir}, strings.Split(cannonicalName, "/")...)...) + canonicalName := strings.Replace(name, "\\", "/", -1) + return filepath.Join(append([]string{dir}, strings.Split(canonicalName, "/")...)...) } - diff --git a/multiaccounts/migrations/sql/1648646095_image_clock.down.sql b/multiaccounts/migrations/sql/1648646095_image_clock.down.sql new file mode 100644 index 000000000..4dd1a4600 --- /dev/null +++ b/multiaccounts/migrations/sql/1648646095_image_clock.down.sql @@ -0,0 +1,32 @@ +/* SQLite does not support dropping columns, hence we must create a temp table */ +CREATE TEMPORARY TABLE identity_images_backup( + key_uid VARCHAR, + name VARCHAR, + image_payload BLOB NOT NULL, + width int, + height int, + file_size int, + resize_target int, + PRIMARY KEY (key_uid, name) ON CONFLICT REPLACE +) WITHOUT ROWID; + +INSERT INTO identity_images_backup SELECT key_uid, name, image_payload, width, height, file_size, resize_target FROM identity_images; + +DROP TABLE identity_images; + + +CREATE TABLE IF NOT EXISTS identity_images( + key_uid VARCHAR, + name VARCHAR, + image_payload BLOB NOT NULL, + width int, + height int, + file_size int, + resize_target int, + PRIMARY KEY (key_uid, name) ON CONFLICT REPLACE +) WITHOUT ROWID; + + +INSERT INTO identity_images SELECT key_uid, name, image_payload, width, height, file_size, resize_target FROM identity_images_backup; + +DROP TABLE identity_images_backup; diff --git a/multiaccounts/migrations/sql/1648646095_image_clock.up.sql b/multiaccounts/migrations/sql/1648646095_image_clock.up.sql new file mode 100644 index 000000000..05204a480 --- /dev/null +++ b/multiaccounts/migrations/sql/1648646095_image_clock.up.sql @@ -0,0 +1 @@ +ALTER TABLE identity_images ADD COLUMN clock INT NOT NULL DEFAULT 0; diff --git a/protocol/messenger.go b/protocol/messenger.go index af03cf8c5..30ab7f434 100644 --- a/protocol/messenger.go +++ b/protocol/messenger.go @@ -1199,7 +1199,11 @@ func (m *Messenger) watchIdentityImageChanges() { for { select { case <-channel: - err := m.PublishIdentityImage() + err := m.syncProfilePictures() + if err != nil { + m.logger.Error("failed to sync profile pictures to paired devices", zap.Error(err)) + } + err = m.PublishIdentityImage() if err != nil { m.logger.Error("failed to publish identity image", zap.Error(err)) } @@ -2562,6 +2566,61 @@ func (m *Messenger) ShareImageMessage(request *requests.ShareImageMessage) (*Mes return response, nil } +func (m *Messenger) syncProfilePictures() error { + if !m.hasPairedDevices() { + return nil + } + + ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second) + defer cancel() + + keyUID := m.account.KeyUID + images, err := m.multiAccounts.GetIdentityImages(keyUID) + if err != nil { + return err + } + + pictures := make([]*protobuf.SyncProfilePicture, len(images)) + clock, chat := m.getLastClockWithRelatedChat() + for i, image := range images { + p := &protobuf.SyncProfilePicture{} + p.Name = image.Name + p.Payload = image.Payload + p.Width = uint32(image.Width) + p.Height = uint32(image.Height) + p.FileSize = uint32(image.FileSize) + p.ResizeTarget = uint32(image.ResizeTarget) + if image.Clock == 0 { + p.Clock = clock + } else { + p.Clock = image.Clock + } + pictures[i] = p + } + + message := &protobuf.SyncProfilePictures{} + message.KeyUid = keyUID + message.Pictures = pictures + + encodedMessage, err := proto.Marshal(message) + if err != nil { + return err + } + + _, err = m.dispatchMessage(ctx, common.RawMessage{ + LocalChatID: chat.ID, + Payload: encodedMessage, + MessageType: protobuf.ApplicationMetadataMessage_SYNC_PROFILE_PICTURE, + ResendAutomatically: true, + }) + if err != nil { + return err + } + + chat.LastClockValue = clock + return m.saveChat(chat) +} + // SyncDevices sends all public chats and contacts to paired devices // TODO remove use of photoPath in contacts func (m *Messenger) SyncDevices(ctx context.Context, ensName, photoPath string) (err error) { @@ -2654,6 +2713,11 @@ func (m *Messenger) SyncDevices(ctx context.Context, ensName, photoPath string) return err } + err = m.syncProfilePictures() + if err != nil { + return err + } + return err } @@ -3299,6 +3363,21 @@ func (m *Messenger) handleRetrievedMessages(chatWithMessages map[transport.Filte continue } + case protobuf.SyncProfilePictures: + if !common.IsPubKeyEqual(messageState.CurrentMessageState.PublicKey, &m.identity.PublicKey) { + logger.Warn("not coming from us, ignoring") + continue + } + + p := msg.ParsedMessage.Interface().(protobuf.SyncProfilePictures) + logger.Debug("Handling SyncProfilePicture", zap.Any("message", p)) + err = m.HandleSyncProfilePictures(messageState, p) + if err != nil { + logger.Warn("failed to handle SyncProfilePicture", zap.Error(err)) + allMessagesProcessed = false + continue + } + case protobuf.SyncBookmark: if !common.IsPubKeyEqual(messageState.CurrentMessageState.PublicKey, &m.identity.PublicKey) { logger.Warn("not coming from us, ignoring") diff --git a/protocol/messenger_handler.go b/protocol/messenger_handler.go index e375cc42c..702b81b07 100644 --- a/protocol/messenger_handler.go +++ b/protocol/messenger_handler.go @@ -419,6 +419,46 @@ func (m *Messenger) HandleSyncInstallationContact(state *ReceivedMessageState, m return nil } +func (m *Messenger) HandleSyncProfilePictures(state *ReceivedMessageState, message protobuf.SyncProfilePictures) error { + dbImages, err := m.multiAccounts.GetIdentityImages(message.KeyUid) + if err != nil { + return err + } + dbImageMap := make(map[string]*images.IdentityImage) + for _, img := range dbImages { + dbImageMap[img.Name] = img + } + idImages := make([]*images.IdentityImage, len(message.Pictures)) + i := 0 + for _, message := range message.Pictures { + dbImg := dbImageMap[message.Name] + if dbImg != nil && message.Clock <= dbImg.Clock { + continue + } + image := &images.IdentityImage{ + Name: message.Name, + Payload: message.Payload, + Width: int(message.Width), + Height: int(message.Height), + FileSize: int(message.FileSize), + ResizeTarget: int(message.ResizeTarget), + Clock: message.Clock, + } + idImages[i] = image + i++ + } + + if i == 0 { + return nil + } + + err = m.multiAccounts.StoreIdentityImages(message.KeyUid, idImages[:i], false) + if err == nil { + state.Response.IdentityImages = idImages[:i] + } + return err +} + func (m *Messenger) HandleSyncInstallationPublicChat(state *ReceivedMessageState, message protobuf.SyncInstallationPublicChat) *Chat { chatID := message.Id existingChat, ok := state.AllChats.Load(chatID) diff --git a/protocol/messenger_identity_image_test.go b/protocol/messenger_identity_image_test.go index 8416ea382..78e482fb1 100644 --- a/protocol/messenger_identity_image_test.go +++ b/protocol/messenger_identity_image_test.go @@ -129,7 +129,7 @@ func (s *MessengerProfilePictureHandlerSuite) setupMultiAccount(m *Messenger) { func (s *MessengerProfilePictureHandlerSuite) generateAndStoreIdentityImages(m *Messenger) []*images.IdentityImage { keyUID := s.generateKeyUID(&m.identity.PublicKey) iis := images.SampleIdentityImages() - s.Require().NoError(m.multiAccounts.StoreIdentityImages(keyUID, iis)) + s.Require().NoError(m.multiAccounts.StoreIdentityImages(keyUID, iis, false)) return iis } diff --git a/protocol/messenger_response.go b/protocol/messenger_response.go index 3be562ca7..b59f63f1b 100644 --- a/protocol/messenger_response.go +++ b/protocol/messenger_response.go @@ -6,6 +6,7 @@ import ( "github.com/status-im/status-go/services/browsers" "github.com/status-im/status-go/appmetrics" + "github.com/status-im/status-go/images" "github.com/status-im/status-go/multiaccounts/settings" "github.com/status-im/status-go/protocol/common" "github.com/status-im/status-go/protocol/communities" @@ -35,6 +36,7 @@ type MessengerResponse struct { Mailservers []mailservers.Mailserver Bookmarks []*browsers.Bookmark Settings []*settings.SyncSettingField + IdentityImages []*images.IdentityImage // notifications a list of notifications derived from messenger events // that are useful to notify the user about @@ -77,18 +79,19 @@ func (r *MessengerResponse) MarshalJSON() ([]byte, error) { CurrentStatus *UserStatus `json:"currentStatus,omitempty"` StatusUpdates []UserStatus `json:"statusUpdates,omitempty"` Settings []*settings.SyncSettingField `json:"settings,omitempty"` + IdentityImages []*images.IdentityImage `json:"identityImages,omitempty"` }{ - Contacts: r.Contacts, - Installations: r.Installations, - EmojiReactions: r.EmojiReactions, - Invitations: r.Invitations, - CommunityChanges: r.CommunityChanges, - RequestsToJoinCommunity: r.RequestsToJoinCommunity, - Mailservers: r.Mailservers, - Bookmarks: r.Bookmarks, - CurrentStatus: r.currentStatus, - Settings: r.Settings, - + Contacts: r.Contacts, + Installations: r.Installations, + EmojiReactions: r.EmojiReactions, + Invitations: r.Invitations, + CommunityChanges: r.CommunityChanges, + RequestsToJoinCommunity: r.RequestsToJoinCommunity, + Mailservers: r.Mailservers, + Bookmarks: r.Bookmarks, + CurrentStatus: r.currentStatus, + Settings: r.Settings, + IdentityImages: r.IdentityImages, Messages: r.Messages(), Notifications: r.Notifications(), Chats: r.Chats(), @@ -194,6 +197,7 @@ func (r *MessengerResponse) IsEmpty() bool { len(r.removedChats)+ len(r.removedMessages)+ len(r.Mailservers)+ + len(r.IdentityImages)+ len(r.notifications)+ len(r.statusUpdates)+ len(r.activityCenterNotifications)+ diff --git a/protocol/messenger_sync_profile_picture_test.go b/protocol/messenger_sync_profile_picture_test.go new file mode 100644 index 000000000..bcf86de8f --- /dev/null +++ b/protocol/messenger_sync_profile_picture_test.go @@ -0,0 +1,184 @@ +package protocol + +import ( + "context" + "crypto/ecdsa" + "errors" + "fmt" + "testing" + + gethbridge "github.com/status-im/status-go/eth-node/bridge/geth" + "github.com/status-im/status-go/eth-node/crypto" + "github.com/status-im/status-go/images" + "github.com/status-im/status-go/protocol/encryption/multidevice" + "github.com/status-im/status-go/protocol/tt" + "github.com/status-im/status-go/waku" + + "github.com/stretchr/testify/suite" + "go.uber.org/zap" + + "github.com/status-im/status-go/eth-node/types" +) + +func TestMessengerSyncProfilePictureSuite(t *testing.T) { + suite.Run(t, new(MessengerSyncProfilePictureSuite)) +} + +type MessengerSyncProfilePictureSuite struct { + suite.Suite + m *Messenger // main instance of Messenger + privateKey *ecdsa.PrivateKey // private key for the main instance of Messenger + + // If one wants to send messages between different instances of Messenger, + // a single Waku service should be shared. + shh types.Waku + + logger *zap.Logger +} + +func (s *MessengerSyncProfilePictureSuite) SetupTest() { + s.logger = tt.MustCreateTestLogger() + + config := waku.DefaultConfig + config.MinimumAcceptedPoW = 0 + shh := waku.New(&config, s.logger) + s.shh = gethbridge.NewGethWakuWrapper(shh) + s.Require().NoError(shh.Start()) + + s.m = s.newMessenger(s.shh) + s.privateKey = s.m.identity + // We start the messenger in order to receive installations + _, err := s.m.Start() + s.Require().NoError(err) +} + +func (s *MessengerSyncProfilePictureSuite) TearDownTest() { + s.Require().NoError(s.m.Shutdown()) +} + +func (s *MessengerSyncProfilePictureSuite) newMessenger(shh types.Waku) *Messenger { + privateKey, err := crypto.GenerateKey() + s.Require().NoError(err) + + messenger, err := newMessengerWithKey(s.shh, privateKey, s.logger, nil) + s.Require().NoError(err) + + return messenger +} + +func (s *MessengerSyncProfilePictureSuite) TestSyncProfilePicture() { + + // Add identity images + keyUID := s.m.account.KeyUID + + // pair + theirMessenger, err := newMessengerWithKey(s.shh, s.privateKey, s.logger, nil) + s.Require().NoError(err) + + err = theirMessenger.SetInstallationMetadata(theirMessenger.installationID, &multidevice.InstallationMetadata{ + Name: "their-name", + DeviceType: "their-device-type", + }) + s.Require().NoError(err) + response, err := theirMessenger.SendPairInstallation(context.Background()) + s.Require().NoError(err) + s.Require().NotNil(response) + s.Require().Len(response.Chats(), 1) + s.Require().False(response.Chats()[0].Active) + + // Wait for the message to reach its destination + response, err = WaitOnMessengerResponse( + s.m, + func(r *MessengerResponse) bool { return len(r.Installations) > 0 }, + "installation not received", + ) + + s.Require().NoError(err) + actualInstallation := response.Installations[0] + s.Require().Equal(theirMessenger.installationID, actualInstallation.ID) + s.Require().NotNil(actualInstallation.InstallationMetadata) + s.Require().Equal("their-name", actualInstallation.InstallationMetadata.Name) + s.Require().Equal("their-device-type", actualInstallation.InstallationMetadata.DeviceType) + + err = s.m.EnableInstallation(theirMessenger.installationID) + s.Require().NoError(err) + + // Sync happens via subscription triggered from within StoreIdentityImages + const ( + lowClock = 5 + highClock = 10 + ) + + iis := images.SampleIdentityImages() + for _, img := range iis { + img.Clock = highClock + } + s.Require().NoError(s.m.multiAccounts.StoreIdentityImages(keyUID, iis, true)) + + // Wait for the message to reach its destination + err = tt.RetryWithBackOff(func() error { + response, err = theirMessenger.RetrieveAll() + if err != nil { + return err + } + + syncedImages, err := theirMessenger.multiAccounts.GetIdentityImages(keyUID) + if err != nil { + return err + } + + if len(syncedImages) == 2 { + return nil + } + + return errors.New("Not received all identity images") + }) + + s.Require().NoError(err) + + syncedImages, err := theirMessenger.multiAccounts.GetIdentityImages(keyUID) + s.Require().NoError(err) + s.Require().Equal(2, len(syncedImages)) + s.Require().Equal(2, len(response.IdentityImages)) + + // Check that we don't update images with earlier clock values + + for _, img := range iis { + img.Clock = lowClock + } + iis2 := images.SampleIdentityImages() + for i, img := range iis2 { + img.Name = fmt.Sprintf("newimg%d", i) + img.Clock = highClock + } + iis = append(iis, iis2...) + s.Require().NoError(s.m.multiAccounts.StoreIdentityImages(keyUID, iis, true)) + + err = tt.RetryWithBackOff(func() error { + response, err = theirMessenger.RetrieveAll() + if err != nil { + return err + } + + syncedImages, err := theirMessenger.multiAccounts.GetIdentityImages(keyUID) + if err != nil { + return err + } + + if len(syncedImages) == 4 { + return nil + } + + return errors.New("Not received all identity images") + }) + + syncedImages, err = theirMessenger.multiAccounts.GetIdentityImages(keyUID) + s.Require().NoError(err) + s.Require().Equal(4, len(syncedImages)) + for _, img := range syncedImages { + s.Require().NotEqual(img.Clock, lowClock) + } + + s.Require().NoError(theirMessenger.Shutdown()) + +} diff --git a/protocol/protobuf/application_metadata_message.pb.go b/protocol/protobuf/application_metadata_message.pb.go index 90603237d..809b87e7f 100644 --- a/protocol/protobuf/application_metadata_message.pb.go +++ b/protocol/protobuf/application_metadata_message.pb.go @@ -1,4 +1,4 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. +// Code generated by protoc-gen-gogo. DO NOT EDIT. // source: application_metadata_message.proto package protobuf @@ -6,7 +6,9 @@ package protobuf import ( fmt "fmt" proto "github.com/golang/protobuf/proto" + io "io" math "math" + math_bits "math/bits" ) // Reference imports to suppress errors if they are not otherwise used. @@ -67,6 +69,7 @@ const ( ApplicationMetadataMessage_SYNC_CLEAR_HISTORY ApplicationMetadataMessage_Type = 41 ApplicationMetadataMessage_SYNC_SETTING ApplicationMetadataMessage_Type = 42 ApplicationMetadataMessage_COMMUNITY_ARCHIVE_MAGNETLINK ApplicationMetadataMessage_Type = 43 + ApplicationMetadataMessage_SYNC_PROFILE_PICTURE ApplicationMetadataMessage_Type = 44 ) var ApplicationMetadataMessage_Type_name = map[int32]string{ @@ -114,6 +117,7 @@ var ApplicationMetadataMessage_Type_name = map[int32]string{ 41: "SYNC_CLEAR_HISTORY", 42: "SYNC_SETTING", 43: "COMMUNITY_ARCHIVE_MAGNETLINK", + 44: "SYNC_PROFILE_PICTURE", } var ApplicationMetadataMessage_Type_value = map[string]int32{ @@ -161,6 +165,7 @@ var ApplicationMetadataMessage_Type_value = map[string]int32{ "SYNC_CLEAR_HISTORY": 41, "SYNC_SETTING": 42, "COMMUNITY_ARCHIVE_MAGNETLINK": 43, + "SYNC_PROFILE_PICTURE": 44, } func (x ApplicationMetadataMessage_Type) String() string { @@ -189,18 +194,26 @@ func (*ApplicationMetadataMessage) ProtoMessage() {} func (*ApplicationMetadataMessage) Descriptor() ([]byte, []int) { return fileDescriptor_ad09a6406fcf24c7, []int{0} } - func (m *ApplicationMetadataMessage) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ApplicationMetadataMessage.Unmarshal(m, b) + return m.Unmarshal(b) } func (m *ApplicationMetadataMessage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ApplicationMetadataMessage.Marshal(b, m, deterministic) + if deterministic { + return xxx_messageInfo_ApplicationMetadataMessage.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } } func (m *ApplicationMetadataMessage) XXX_Merge(src proto.Message) { xxx_messageInfo_ApplicationMetadataMessage.Merge(m, src) } func (m *ApplicationMetadataMessage) XXX_Size() int { - return xxx_messageInfo_ApplicationMetadataMessage.Size(m) + return m.Size() } func (m *ApplicationMetadataMessage) XXX_DiscardUnknown() { xxx_messageInfo_ApplicationMetadataMessage.DiscardUnknown(m) @@ -239,51 +252,363 @@ func init() { } var fileDescriptor_ad09a6406fcf24c7 = []byte{ - // 735 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x54, 0x5d, 0x53, 0x1b,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86, 0x6a, 0xd1, 0xcc, 0x4c, 0x52, 0x93, 0x1a, 0xad, 0xc2, 0x0e, 0x53, 0x5a, 0xf5, 0x23, 0x9d, - 0x58, 0x1f, 0xa1, 0x33, 0x92, 0xfb, 0x26, 0x73, 0xbc, 0x4d, 0x5e, 0xcf, 0xb6, 0x2a, 0x2b, 0xd9, - 0x60, 0xa4, 0x7b, 0x28, 0x48, 0x3d, 0x74, 0xad, 0x80, 0x27, 0xa9, 0x6c, 0x30, 0x50, 0x90, 0x37, - 0x14, 0x60, 0xb9, 0xc9, 0x78, 0x27, 0x89, 0xc9, 0xdb, 0xd9, 0x44, 0x06, 0x67, 0x7b, 0xa1, 0x52, - 0x8e, 0xca, 0xa1, 0xc9, 0xa5, 0x3f, 0xcd, 0x26, 0xf2, 0x3e, 0x9d, 0x6f, 0x23, 0x0a, 0xf2, 0x2e, - 0x4c, 0xdc, 0x42, 0x89, 0x90, 0x36, 0x92, 0xd6, 0xa2, 0x20, 0xef, 0x33, 0x27, 0x82, 0xa6, 0xa9, - 0x75, 0x27, 0x62, 0xa6, 0x43, 0x4e, 0xe8, 0x0e, 0xd0, 0xfc, 0x85, 0x5d, 0x64, 0xc6, 0xb7, 0xa5, - 0x75, 0xda, 0xf4, 0xc9, 0x87, 0x60, 0x63, 0x86, 0x5b, 0x74, 0x4e, 0xaa, 0x16, 0xf9, 0x48, 0x6b, - 0x70, 0x50, 0x34, 0x82, 0x19, 0xde, 0x96, 0x3d, 0xf4, 0x11, 0x6b, 0x29, 0x74, 0x5d, 0xa9, 0x3a, - 0xe4, 0x53, 0x73, 0xfd, 0xcf, 0x72, 0xe3, 0xe7, 0xdf, 0xa6, 0x5f, 0xc0, 0x6f, 0xcb, 0xd9, 0xbf, - 0x5f, 0xff, 0x0b, 0x00, 0x00, 0xff, 0xff, 0xb9, 0x43, 0x6c, 0x84, 0xa8, 0x05, 0x00, 0x00, + // 775 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x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xaf, 0xea, 0x95, 0xbf, + 0xae, 0xea, 0x95, 0xbf, 0xaf, 0xea, 0x95, 0x3f, 0xfe, 0xa9, 0xdf, 0xf8, 0x75, 0xa3, 0xf5, 0xfd, + 0x4f, 0xb3, 0x6f, 0xe5, 0xcb, 0xd5, 0xfc, 0xdf, 0x8f, 0xff, 0x07, 0x00, 0x00, 0xff, 0xff, 0xd8, + 0x58, 0xf8, 0x50, 0xd2, 0x05, 0x00, 0x00, } + +func (m *ApplicationMetadataMessage) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ApplicationMetadataMessage) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ApplicationMetadataMessage) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if m.Type != 0 { + i = encodeVarintApplicationMetadataMessage(dAtA, i, uint64(m.Type)) + i-- + dAtA[i] = 0x18 + } + if len(m.Payload) > 0 { + i -= len(m.Payload) + copy(dAtA[i:], m.Payload) + i = encodeVarintApplicationMetadataMessage(dAtA, i, uint64(len(m.Payload))) + i-- + dAtA[i] = 0x12 + } + if len(m.Signature) > 0 { + i -= len(m.Signature) + copy(dAtA[i:], m.Signature) + i = encodeVarintApplicationMetadataMessage(dAtA, i, uint64(len(m.Signature))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintApplicationMetadataMessage(dAtA []byte, offset int, v uint64) int { + offset -= sovApplicationMetadataMessage(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *ApplicationMetadataMessage) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Signature) + if l > 0 { + n += 1 + l + sovApplicationMetadataMessage(uint64(l)) + } + l = len(m.Payload) + if l > 0 { + n += 1 + l + sovApplicationMetadataMessage(uint64(l)) + } + if m.Type != 0 { + n += 1 + sovApplicationMetadataMessage(uint64(m.Type)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func sovApplicationMetadataMessage(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozApplicationMetadataMessage(x uint64) (n int) { + return sovApplicationMetadataMessage(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *ApplicationMetadataMessage) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowApplicationMetadataMessage + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: ApplicationMetadataMessage: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ApplicationMetadataMessage: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Signature", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowApplicationMetadataMessage + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthApplicationMetadataMessage + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthApplicationMetadataMessage + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Signature = append(m.Signature[:0], dAtA[iNdEx:postIndex]...) + if m.Signature == nil { + m.Signature = []byte{} + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Payload", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowApplicationMetadataMessage + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthApplicationMetadataMessage + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthApplicationMetadataMessage + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Payload = append(m.Payload[:0], dAtA[iNdEx:postIndex]...) + if m.Payload == nil { + m.Payload = []byte{} + } + iNdEx = postIndex + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) + } + m.Type = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowApplicationMetadataMessage + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Type |= ApplicationMetadataMessage_Type(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipApplicationMetadataMessage(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthApplicationMetadataMessage + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipApplicationMetadataMessage(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowApplicationMetadataMessage + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowApplicationMetadataMessage + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowApplicationMetadataMessage + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthApplicationMetadataMessage + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupApplicationMetadataMessage + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthApplicationMetadataMessage + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthApplicationMetadataMessage = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowApplicationMetadataMessage = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupApplicationMetadataMessage = fmt.Errorf("proto: unexpected end of group") +) diff --git a/protocol/protobuf/application_metadata_message.proto b/protocol/protobuf/application_metadata_message.proto index 03127e2a0..dbf830f4c 100644 --- a/protocol/protobuf/application_metadata_message.proto +++ b/protocol/protobuf/application_metadata_message.proto @@ -57,5 +57,6 @@ message ApplicationMetadataMessage { SYNC_CLEAR_HISTORY = 41; SYNC_SETTING = 42; COMMUNITY_ARCHIVE_MAGNETLINK = 43; + SYNC_PROFILE_PICTURE = 44; } } diff --git a/protocol/protobuf/pairing.pb.go b/protocol/protobuf/pairing.pb.go index 78c89a4a5..38ccdce79 100644 --- a/protocol/protobuf/pairing.pb.go +++ b/protocol/protobuf/pairing.pb.go @@ -1,4 +1,4 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. +// Code generated by protoc-gen-gogo. DO NOT EDIT. // source: pairing.proto package protobuf @@ -6,7 +6,9 @@ package protobuf import ( fmt "fmt" proto "github.com/golang/protobuf/proto" + io "io" math "math" + math_bits "math/bits" ) // Reference imports to suppress errors if they are not otherwise used. @@ -36,18 +38,26 @@ func (*Backup) ProtoMessage() {} func (*Backup) Descriptor() ([]byte, []int) { return fileDescriptor_d61ab7221f0b5518, []int{0} } - func (m *Backup) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Backup.Unmarshal(m, b) + return m.Unmarshal(b) } func (m *Backup) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Backup.Marshal(b, m, deterministic) + if deterministic { + return xxx_messageInfo_Backup.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } } func (m *Backup) XXX_Merge(src proto.Message) { xxx_messageInfo_Backup.Merge(m, src) } func (m *Backup) XXX_Size() int { - return xxx_messageInfo_Backup.Size(m) + return m.Size() } func (m *Backup) XXX_DiscardUnknown() { xxx_messageInfo_Backup.DiscardUnknown(m) @@ -99,18 +109,26 @@ func (*PairInstallation) ProtoMessage() {} func (*PairInstallation) Descriptor() ([]byte, []int) { return fileDescriptor_d61ab7221f0b5518, []int{1} } - func (m *PairInstallation) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_PairInstallation.Unmarshal(m, b) + return m.Unmarshal(b) } func (m *PairInstallation) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_PairInstallation.Marshal(b, m, deterministic) + if deterministic { + return xxx_messageInfo_PairInstallation.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } } func (m *PairInstallation) XXX_Merge(src proto.Message) { xxx_messageInfo_PairInstallation.Merge(m, src) } func (m *PairInstallation) XXX_Size() int { - return xxx_messageInfo_PairInstallation.Size(m) + return m.Size() } func (m *PairInstallation) XXX_DiscardUnknown() { xxx_messageInfo_PairInstallation.DiscardUnknown(m) @@ -165,18 +183,26 @@ func (*SyncInstallationContact) ProtoMessage() {} func (*SyncInstallationContact) Descriptor() ([]byte, []int) { return fileDescriptor_d61ab7221f0b5518, []int{2} } - func (m *SyncInstallationContact) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_SyncInstallationContact.Unmarshal(m, b) + return m.Unmarshal(b) } func (m *SyncInstallationContact) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_SyncInstallationContact.Marshal(b, m, deterministic) + if deterministic { + return xxx_messageInfo_SyncInstallationContact.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } } func (m *SyncInstallationContact) XXX_Merge(src proto.Message) { xxx_messageInfo_SyncInstallationContact.Merge(m, src) } func (m *SyncInstallationContact) XXX_Size() int { - return xxx_messageInfo_SyncInstallationContact.Size(m) + return m.Size() } func (m *SyncInstallationContact) XXX_DiscardUnknown() { xxx_messageInfo_SyncInstallationContact.DiscardUnknown(m) @@ -257,18 +283,26 @@ func (*SyncInstallationContactV2) ProtoMessage() {} func (*SyncInstallationContactV2) Descriptor() ([]byte, []int) { return fileDescriptor_d61ab7221f0b5518, []int{3} } - func (m *SyncInstallationContactV2) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_SyncInstallationContactV2.Unmarshal(m, b) + return m.Unmarshal(b) } func (m *SyncInstallationContactV2) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_SyncInstallationContactV2.Marshal(b, m, deterministic) + if deterministic { + return xxx_messageInfo_SyncInstallationContactV2.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } } func (m *SyncInstallationContactV2) XXX_Merge(src proto.Message) { xxx_messageInfo_SyncInstallationContactV2.Merge(m, src) } func (m *SyncInstallationContactV2) XXX_Size() int { - return xxx_messageInfo_SyncInstallationContactV2.Size(m) + return m.Size() } func (m *SyncInstallationContactV2) XXX_DiscardUnknown() { xxx_messageInfo_SyncInstallationContactV2.DiscardUnknown(m) @@ -375,18 +409,26 @@ func (*SyncInstallationAccount) ProtoMessage() {} func (*SyncInstallationAccount) Descriptor() ([]byte, []int) { return fileDescriptor_d61ab7221f0b5518, []int{4} } - func (m *SyncInstallationAccount) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_SyncInstallationAccount.Unmarshal(m, b) + return m.Unmarshal(b) } func (m *SyncInstallationAccount) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_SyncInstallationAccount.Marshal(b, m, deterministic) + if deterministic { + return xxx_messageInfo_SyncInstallationAccount.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } } func (m *SyncInstallationAccount) XXX_Merge(src proto.Message) { xxx_messageInfo_SyncInstallationAccount.Merge(m, src) } func (m *SyncInstallationAccount) XXX_Size() int { - return xxx_messageInfo_SyncInstallationAccount.Size(m) + return m.Size() } func (m *SyncInstallationAccount) XXX_DiscardUnknown() { xxx_messageInfo_SyncInstallationAccount.DiscardUnknown(m) @@ -429,18 +471,26 @@ func (*SyncInstallationPublicChat) ProtoMessage() {} func (*SyncInstallationPublicChat) Descriptor() ([]byte, []int) { return fileDescriptor_d61ab7221f0b5518, []int{5} } - func (m *SyncInstallationPublicChat) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_SyncInstallationPublicChat.Unmarshal(m, b) + return m.Unmarshal(b) } func (m *SyncInstallationPublicChat) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_SyncInstallationPublicChat.Marshal(b, m, deterministic) + if deterministic { + return xxx_messageInfo_SyncInstallationPublicChat.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } } func (m *SyncInstallationPublicChat) XXX_Merge(src proto.Message) { xxx_messageInfo_SyncInstallationPublicChat.Merge(m, src) } func (m *SyncInstallationPublicChat) XXX_Size() int { - return xxx_messageInfo_SyncInstallationPublicChat.Size(m) + return m.Size() } func (m *SyncInstallationPublicChat) XXX_DiscardUnknown() { xxx_messageInfo_SyncInstallationPublicChat.DiscardUnknown(m) @@ -482,18 +532,26 @@ func (*SyncCommunity) ProtoMessage() {} func (*SyncCommunity) Descriptor() ([]byte, []int) { return fileDescriptor_d61ab7221f0b5518, []int{6} } - func (m *SyncCommunity) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_SyncCommunity.Unmarshal(m, b) + return m.Unmarshal(b) } func (m *SyncCommunity) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_SyncCommunity.Marshal(b, m, deterministic) + if deterministic { + return xxx_messageInfo_SyncCommunity.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } } func (m *SyncCommunity) XXX_Merge(src proto.Message) { xxx_messageInfo_SyncCommunity.Merge(m, src) } func (m *SyncCommunity) XXX_Size() int { - return xxx_messageInfo_SyncCommunity.Size(m) + return m.Size() } func (m *SyncCommunity) XXX_DiscardUnknown() { xxx_messageInfo_SyncCommunity.DiscardUnknown(m) @@ -576,18 +634,26 @@ func (*SyncCommunityRequestsToJoin) ProtoMessage() {} func (*SyncCommunityRequestsToJoin) Descriptor() ([]byte, []int) { return fileDescriptor_d61ab7221f0b5518, []int{7} } - func (m *SyncCommunityRequestsToJoin) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_SyncCommunityRequestsToJoin.Unmarshal(m, b) + return m.Unmarshal(b) } func (m *SyncCommunityRequestsToJoin) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_SyncCommunityRequestsToJoin.Marshal(b, m, deterministic) + if deterministic { + return xxx_messageInfo_SyncCommunityRequestsToJoin.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } } func (m *SyncCommunityRequestsToJoin) XXX_Merge(src proto.Message) { xxx_messageInfo_SyncCommunityRequestsToJoin.Merge(m, src) } func (m *SyncCommunityRequestsToJoin) XXX_Size() int { - return xxx_messageInfo_SyncCommunityRequestsToJoin.Size(m) + return m.Size() } func (m *SyncCommunityRequestsToJoin) XXX_DiscardUnknown() { xxx_messageInfo_SyncCommunityRequestsToJoin.DiscardUnknown(m) @@ -660,18 +726,26 @@ func (*SyncInstallation) ProtoMessage() {} func (*SyncInstallation) Descriptor() ([]byte, []int) { return fileDescriptor_d61ab7221f0b5518, []int{8} } - func (m *SyncInstallation) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_SyncInstallation.Unmarshal(m, b) + return m.Unmarshal(b) } func (m *SyncInstallation) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_SyncInstallation.Marshal(b, m, deterministic) + if deterministic { + return xxx_messageInfo_SyncInstallation.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } } func (m *SyncInstallation) XXX_Merge(src proto.Message) { xxx_messageInfo_SyncInstallation.Merge(m, src) } func (m *SyncInstallation) XXX_Size() int { - return xxx_messageInfo_SyncInstallation.Size(m) + return m.Size() } func (m *SyncInstallation) XXX_DiscardUnknown() { xxx_messageInfo_SyncInstallation.DiscardUnknown(m) @@ -721,18 +795,26 @@ func (*SyncChatRemoved) ProtoMessage() {} func (*SyncChatRemoved) Descriptor() ([]byte, []int) { return fileDescriptor_d61ab7221f0b5518, []int{9} } - func (m *SyncChatRemoved) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_SyncChatRemoved.Unmarshal(m, b) + return m.Unmarshal(b) } func (m *SyncChatRemoved) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_SyncChatRemoved.Marshal(b, m, deterministic) + if deterministic { + return xxx_messageInfo_SyncChatRemoved.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } } func (m *SyncChatRemoved) XXX_Merge(src proto.Message) { xxx_messageInfo_SyncChatRemoved.Merge(m, src) } func (m *SyncChatRemoved) XXX_Size() int { - return xxx_messageInfo_SyncChatRemoved.Size(m) + return m.Size() } func (m *SyncChatRemoved) XXX_DiscardUnknown() { xxx_messageInfo_SyncChatRemoved.DiscardUnknown(m) @@ -768,18 +850,26 @@ func (*SyncChatMessagesRead) ProtoMessage() {} func (*SyncChatMessagesRead) Descriptor() ([]byte, []int) { return fileDescriptor_d61ab7221f0b5518, []int{10} } - func (m *SyncChatMessagesRead) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_SyncChatMessagesRead.Unmarshal(m, b) + return m.Unmarshal(b) } func (m *SyncChatMessagesRead) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_SyncChatMessagesRead.Marshal(b, m, deterministic) + if deterministic { + return xxx_messageInfo_SyncChatMessagesRead.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } } func (m *SyncChatMessagesRead) XXX_Merge(src proto.Message) { xxx_messageInfo_SyncChatMessagesRead.Merge(m, src) } func (m *SyncChatMessagesRead) XXX_Size() int { - return xxx_messageInfo_SyncChatMessagesRead.Size(m) + return m.Size() } func (m *SyncChatMessagesRead) XXX_DiscardUnknown() { xxx_messageInfo_SyncChatMessagesRead.DiscardUnknown(m) @@ -815,18 +905,26 @@ func (*SyncActivityCenterRead) ProtoMessage() {} func (*SyncActivityCenterRead) Descriptor() ([]byte, []int) { return fileDescriptor_d61ab7221f0b5518, []int{11} } - func (m *SyncActivityCenterRead) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_SyncActivityCenterRead.Unmarshal(m, b) + return m.Unmarshal(b) } func (m *SyncActivityCenterRead) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_SyncActivityCenterRead.Marshal(b, m, deterministic) + if deterministic { + return xxx_messageInfo_SyncActivityCenterRead.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } } func (m *SyncActivityCenterRead) XXX_Merge(src proto.Message) { xxx_messageInfo_SyncActivityCenterRead.Merge(m, src) } func (m *SyncActivityCenterRead) XXX_Size() int { - return xxx_messageInfo_SyncActivityCenterRead.Size(m) + return m.Size() } func (m *SyncActivityCenterRead) XXX_DiscardUnknown() { xxx_messageInfo_SyncActivityCenterRead.DiscardUnknown(m) @@ -862,18 +960,26 @@ func (*SyncActivityCenterAccepted) ProtoMessage() {} func (*SyncActivityCenterAccepted) Descriptor() ([]byte, []int) { return fileDescriptor_d61ab7221f0b5518, []int{12} } - func (m *SyncActivityCenterAccepted) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_SyncActivityCenterAccepted.Unmarshal(m, b) + return m.Unmarshal(b) } func (m *SyncActivityCenterAccepted) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_SyncActivityCenterAccepted.Marshal(b, m, deterministic) + if deterministic { + return xxx_messageInfo_SyncActivityCenterAccepted.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } } func (m *SyncActivityCenterAccepted) XXX_Merge(src proto.Message) { xxx_messageInfo_SyncActivityCenterAccepted.Merge(m, src) } func (m *SyncActivityCenterAccepted) XXX_Size() int { - return xxx_messageInfo_SyncActivityCenterAccepted.Size(m) + return m.Size() } func (m *SyncActivityCenterAccepted) XXX_DiscardUnknown() { xxx_messageInfo_SyncActivityCenterAccepted.DiscardUnknown(m) @@ -909,18 +1015,26 @@ func (*SyncActivityCenterDismissed) ProtoMessage() {} func (*SyncActivityCenterDismissed) Descriptor() ([]byte, []int) { return fileDescriptor_d61ab7221f0b5518, []int{13} } - func (m *SyncActivityCenterDismissed) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_SyncActivityCenterDismissed.Unmarshal(m, b) + return m.Unmarshal(b) } func (m *SyncActivityCenterDismissed) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_SyncActivityCenterDismissed.Marshal(b, m, deterministic) + if deterministic { + return xxx_messageInfo_SyncActivityCenterDismissed.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } } func (m *SyncActivityCenterDismissed) XXX_Merge(src proto.Message) { xxx_messageInfo_SyncActivityCenterDismissed.Merge(m, src) } func (m *SyncActivityCenterDismissed) XXX_Size() int { - return xxx_messageInfo_SyncActivityCenterDismissed.Size(m) + return m.Size() } func (m *SyncActivityCenterDismissed) XXX_DiscardUnknown() { xxx_messageInfo_SyncActivityCenterDismissed.DiscardUnknown(m) @@ -959,18 +1073,26 @@ func (*SyncBookmark) ProtoMessage() {} func (*SyncBookmark) Descriptor() ([]byte, []int) { return fileDescriptor_d61ab7221f0b5518, []int{14} } - func (m *SyncBookmark) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_SyncBookmark.Unmarshal(m, b) + return m.Unmarshal(b) } func (m *SyncBookmark) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_SyncBookmark.Marshal(b, m, deterministic) + if deterministic { + return xxx_messageInfo_SyncBookmark.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } } func (m *SyncBookmark) XXX_Merge(src proto.Message) { xxx_messageInfo_SyncBookmark.Merge(m, src) } func (m *SyncBookmark) XXX_Size() int { - return xxx_messageInfo_SyncBookmark.Size(m) + return m.Size() } func (m *SyncBookmark) XXX_DiscardUnknown() { xxx_messageInfo_SyncBookmark.DiscardUnknown(m) @@ -1027,18 +1149,26 @@ func (*SyncClearHistory) ProtoMessage() {} func (*SyncClearHistory) Descriptor() ([]byte, []int) { return fileDescriptor_d61ab7221f0b5518, []int{15} } - func (m *SyncClearHistory) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_SyncClearHistory.Unmarshal(m, b) + return m.Unmarshal(b) } func (m *SyncClearHistory) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_SyncClearHistory.Marshal(b, m, deterministic) + if deterministic { + return xxx_messageInfo_SyncClearHistory.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } } func (m *SyncClearHistory) XXX_Merge(src proto.Message) { xxx_messageInfo_SyncClearHistory.Merge(m, src) } func (m *SyncClearHistory) XXX_Size() int { - return xxx_messageInfo_SyncClearHistory.Size(m) + return m.Size() } func (m *SyncClearHistory) XXX_DiscardUnknown() { xxx_messageInfo_SyncClearHistory.DiscardUnknown(m) @@ -1060,6 +1190,156 @@ func (m *SyncClearHistory) GetClearedAt() uint64 { return 0 } +type SyncProfilePicture struct { + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Payload []byte `protobuf:"bytes,2,opt,name=payload,proto3" json:"payload,omitempty"` + Width uint32 `protobuf:"varint,3,opt,name=width,proto3" json:"width,omitempty"` + Height uint32 `protobuf:"varint,4,opt,name=height,proto3" json:"height,omitempty"` + FileSize uint32 `protobuf:"varint,5,opt,name=file_size,json=fileSize,proto3" json:"file_size,omitempty"` + ResizeTarget uint32 `protobuf:"varint,6,opt,name=resize_target,json=resizeTarget,proto3" json:"resize_target,omitempty"` + Clock uint64 `protobuf:"varint,7,opt,name=clock,proto3" json:"clock,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *SyncProfilePicture) Reset() { *m = SyncProfilePicture{} } +func (m *SyncProfilePicture) String() string { return proto.CompactTextString(m) } +func (*SyncProfilePicture) ProtoMessage() {} +func (*SyncProfilePicture) Descriptor() ([]byte, []int) { + return fileDescriptor_d61ab7221f0b5518, []int{16} +} +func (m *SyncProfilePicture) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *SyncProfilePicture) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_SyncProfilePicture.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *SyncProfilePicture) XXX_Merge(src proto.Message) { + xxx_messageInfo_SyncProfilePicture.Merge(m, src) +} +func (m *SyncProfilePicture) XXX_Size() int { + return m.Size() +} +func (m *SyncProfilePicture) XXX_DiscardUnknown() { + xxx_messageInfo_SyncProfilePicture.DiscardUnknown(m) +} + +var xxx_messageInfo_SyncProfilePicture proto.InternalMessageInfo + +func (m *SyncProfilePicture) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *SyncProfilePicture) GetPayload() []byte { + if m != nil { + return m.Payload + } + return nil +} + +func (m *SyncProfilePicture) GetWidth() uint32 { + if m != nil { + return m.Width + } + return 0 +} + +func (m *SyncProfilePicture) GetHeight() uint32 { + if m != nil { + return m.Height + } + return 0 +} + +func (m *SyncProfilePicture) GetFileSize() uint32 { + if m != nil { + return m.FileSize + } + return 0 +} + +func (m *SyncProfilePicture) GetResizeTarget() uint32 { + if m != nil { + return m.ResizeTarget + } + return 0 +} + +func (m *SyncProfilePicture) GetClock() uint64 { + if m != nil { + return m.Clock + } + return 0 +} + +type SyncProfilePictures struct { + KeyUid string `protobuf:"bytes,1,opt,name=key_uid,json=keyUid,proto3" json:"key_uid,omitempty"` + Pictures []*SyncProfilePicture `protobuf:"bytes,2,rep,name=pictures,proto3" json:"pictures,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *SyncProfilePictures) Reset() { *m = SyncProfilePictures{} } +func (m *SyncProfilePictures) String() string { return proto.CompactTextString(m) } +func (*SyncProfilePictures) ProtoMessage() {} +func (*SyncProfilePictures) Descriptor() ([]byte, []int) { + return fileDescriptor_d61ab7221f0b5518, []int{17} +} +func (m *SyncProfilePictures) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *SyncProfilePictures) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_SyncProfilePictures.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *SyncProfilePictures) XXX_Merge(src proto.Message) { + xxx_messageInfo_SyncProfilePictures.Merge(m, src) +} +func (m *SyncProfilePictures) XXX_Size() int { + return m.Size() +} +func (m *SyncProfilePictures) XXX_DiscardUnknown() { + xxx_messageInfo_SyncProfilePictures.DiscardUnknown(m) +} + +var xxx_messageInfo_SyncProfilePictures proto.InternalMessageInfo + +func (m *SyncProfilePictures) GetKeyUid() string { + if m != nil { + return m.KeyUid + } + return "" +} + +func (m *SyncProfilePictures) GetPictures() []*SyncProfilePicture { + if m != nil { + return m.Pictures + } + return nil +} + func init() { proto.RegisterType((*Backup)(nil), "protobuf.Backup") proto.RegisterType((*PairInstallation)(nil), "protobuf.PairInstallation") @@ -1077,67 +1357,4755 @@ func init() { proto.RegisterType((*SyncActivityCenterDismissed)(nil), "protobuf.SyncActivityCenterDismissed") proto.RegisterType((*SyncBookmark)(nil), "protobuf.SyncBookmark") proto.RegisterType((*SyncClearHistory)(nil), "protobuf.SyncClearHistory") + proto.RegisterType((*SyncProfilePicture)(nil), "protobuf.SyncProfilePicture") + proto.RegisterType((*SyncProfilePictures)(nil), "protobuf.SyncProfilePictures") } func init() { proto.RegisterFile("pairing.proto", fileDescriptor_d61ab7221f0b5518) } var fileDescriptor_d61ab7221f0b5518 = []byte{ - // 904 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xd4, 0x55, 0x4f, 0x8f, 0xdb, 0x44, - 0x14, 0x97, 0xe3, 0x6c, 0xfe, 0xbc, 0x38, 0xdb, 0xd5, 0x68, 0xd5, 0x75, 0x5b, 0x55, 0x4d, 0x5d, - 0x2a, 0xf6, 0xb4, 0xa0, 0x72, 0x40, 0xa8, 0x20, 0xc8, 0xa6, 0x08, 0x52, 0xa0, 0x54, 0x66, 0x97, - 0x03, 0x17, 0x6b, 0x76, 0xfc, 0x36, 0x3b, 0xc4, 0xf6, 0x18, 0xcf, 0x38, 0xc8, 0x47, 0x2e, 0x1c, - 0x38, 0xc2, 0xb7, 0xe0, 0xcb, 0xf0, 0x3d, 0xf8, 0x14, 0x68, 0x66, 0x9c, 0xac, 0xb3, 0x4b, 0xd2, - 0x20, 0x4e, 0x3d, 0xd9, 0xef, 0xf7, 0xfe, 0xce, 0x6f, 0xde, 0x7b, 0x03, 0xc3, 0x9c, 0xf2, 0x82, - 0x67, 0xb3, 0x93, 0xbc, 0x10, 0x4a, 0x90, 0x9e, 0xf9, 0x5c, 0x94, 0x97, 0xc1, 0x9f, 0x0e, 0x74, - 0x4e, 0x29, 0x9b, 0x97, 0x39, 0x39, 0x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93, 0x04, - 0x69, 0xf1, 0x25, 0x97, 0x4a, 0x14, 0x55, 0x73, 0x88, 0x9c, 0xb5, 0x21, 0x7a, 0x08, 0xc0, 0xb4, - 0x21, 0xc6, 0x11, 0x55, 0xa6, 0xa0, 0x76, 0xd8, 0xaf, 0x91, 0xb1, 0x3a, 0x1d, 0xfe, 0x30, 0x38, - 0x79, 0xef, 0xf9, 0xb2, 0x7f, 0x2e, 0x3a, 0xe6, 0xef, 0x83, 0x7f, 0x02, 0x00, 0x00, 0xff, 0xff, - 0x08, 0x8c, 0x35, 0x24, 0xb0, 0x09, 0x00, 0x00, + // 1055 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xd4, 0x56, 0xcd, 0x72, 0x1b, 0x45, + 0x10, 0x66, 0x25, 0x59, 0x5a, 0xb5, 0x56, 0x8e, 0x6b, 0x70, 0xc5, 0x9b, 0x04, 0x3b, 0xca, 0x86, + 0x14, 0x3e, 0x19, 0x2a, 0x1c, 0x80, 0x0a, 0x14, 0xc8, 0x0a, 0x05, 0x0a, 0x10, 0x5c, 0x13, 0x9b, + 0x03, 0x97, 0xad, 0xf1, 0xec, 0x58, 0x1a, 0xb4, 0x7f, 0xec, 0xcc, 0x2a, 0xb5, 0xb9, 0x71, 0xe1, + 0xc0, 0x11, 0x2e, 0x3c, 0x03, 0x4f, 0x92, 0x1b, 0x3c, 0x02, 0x65, 0x6e, 0x3c, 0x05, 0x35, 0x33, + 0x2b, 0x69, 0x65, 0x23, 0x5b, 0x14, 0xa7, 0x9c, 0xb4, 0xfd, 0x4d, 0x77, 0x4f, 0xf7, 0x37, 0xfd, + 0x23, 0xe8, 0xa6, 0x84, 0x67, 0x3c, 0x1e, 0x1d, 0xa4, 0x59, 0x22, 0x13, 0x64, 0xeb, 0x9f, 0xd3, + 0xfc, 0xcc, 0xfb, 0xcd, 0x82, 0xe6, 0x21, 0xa1, 0x93, 0x3c, 0x45, 0xdb, 0xb0, 0x41, 0xc3, 0x84, + 0x4e, 0x5c, 0xab, 0x67, 0xed, 0x37, 0xb0, 0x11, 0xd0, 0x26, 0xd4, 0x78, 0xe0, 0xd6, 0x7a, 0xd6, + 0x7e, 0x1b, 0xd7, 0x78, 0x80, 0x3e, 0x06, 0x9b, 0x26, 0xb1, 0x24, 0x54, 0x0a, 0xb7, 0xde, 0xab, + 0xef, 0x77, 0x1e, 0xde, 0x3f, 0x98, 0x79, 0x3b, 0x78, 0x56, 0xc4, 0x74, 0x18, 0x0b, 0x49, 0xc2, + 0x90, 0x48, 0x9e, 0xc4, 0x03, 0xa3, 0xf9, 0xcd, 0x43, 0x3c, 0x37, 0x42, 0x1f, 0x40, 0x87, 0x26, + 0x51, 0x94, 0xc7, 0x5c, 0x72, 0x26, 0xdc, 0x86, 0xf6, 0xb1, 0xb3, 0xec, 0x63, 0x50, 0x2a, 0x14, + 0xb8, 0xaa, 0xeb, 0xfd, 0x68, 0xc1, 0xd6, 0x11, 0xe1, 0x59, 0xf5, 0x8a, 0x15, 0x61, 0xbf, 0x05, + 0x37, 0x78, 0x45, 0xcb, 0x9f, 0xe7, 0xb0, 0x59, 0x85, 0x87, 0x01, 0xba, 0x0b, 0x9d, 0x80, 0x4d, + 0x39, 0x65, 0xbe, 0x2c, 0x52, 0xe6, 0xd6, 0xb5, 0x12, 0x18, 0xe8, 0xb8, 0x48, 0x19, 0x42, 0xd0, + 0x88, 0x49, 0xc4, 0xdc, 0x86, 0x3e, 0xd1, 0xdf, 0xde, 0xdf, 0x16, 0xec, 0xac, 0xc8, 0x75, 0x4d, + 0x1a, 0xef, 0x43, 0x37, 0xcd, 0x92, 0x33, 0x1e, 0x32, 0x9f, 0x47, 0x64, 0x34, 0xbb, 0xd8, 0x29, + 0xc1, 0xa1, 0xc2, 0xd0, 0x2d, 0xb0, 0x59, 0x2c, 0xfc, 0xca, 0xf5, 0x2d, 0x16, 0x8b, 0xa7, 0x24, + 0x62, 0xe8, 0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 0xb3, 0x3d, 0x6d, 0xea, 0xaf, + 0x77, 0xff, 0x09, 0x00, 0x00, 0xff, 0xff, 0xbe, 0xe1, 0x16, 0x6b, 0xf5, 0x0a, 0x00, 0x00, } + +func (m *Backup) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Backup) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Backup) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if len(m.Communities) > 0 { + for iNdEx := len(m.Communities) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Communities[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintPairing(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + } + if len(m.Contacts) > 0 { + for iNdEx := len(m.Contacts) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Contacts[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintPairing(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + } + if len(m.Id) > 0 { + i -= len(m.Id) + copy(dAtA[i:], m.Id) + i = encodeVarintPairing(dAtA, i, uint64(len(m.Id))) + i-- + dAtA[i] = 0x12 + } + if m.Clock != 0 { + i = encodeVarintPairing(dAtA, i, uint64(m.Clock)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *PairInstallation) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *PairInstallation) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *PairInstallation) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintPairing(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0x22 + } + if len(m.DeviceType) > 0 { + i -= len(m.DeviceType) + copy(dAtA[i:], m.DeviceType) + i = encodeVarintPairing(dAtA, i, uint64(len(m.DeviceType))) + i-- + dAtA[i] = 0x1a + } + if len(m.InstallationId) > 0 { + i -= len(m.InstallationId) + copy(dAtA[i:], m.InstallationId) + i = encodeVarintPairing(dAtA, i, uint64(len(m.InstallationId))) + i-- + dAtA[i] = 0x12 + } + if m.Clock != 0 { + i = encodeVarintPairing(dAtA, i, uint64(m.Clock)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *SyncInstallationContact) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *SyncInstallationContact) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SyncInstallationContact) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if len(m.LocalNickname) > 0 { + i -= len(m.LocalNickname) + copy(dAtA[i:], m.LocalNickname) + i = encodeVarintPairing(dAtA, i, uint64(len(m.LocalNickname))) + i-- + dAtA[i] = 0x3a + } + if len(m.SystemTags) > 0 { + for iNdEx := len(m.SystemTags) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.SystemTags[iNdEx]) + copy(dAtA[i:], m.SystemTags[iNdEx]) + i = encodeVarintPairing(dAtA, i, uint64(len(m.SystemTags[iNdEx]))) + i-- + dAtA[i] = 0x32 + } + } + if m.LastUpdated != 0 { + i = encodeVarintPairing(dAtA, i, uint64(m.LastUpdated)) + i-- + dAtA[i] = 0x28 + } + if len(m.EnsName) > 0 { + i -= len(m.EnsName) + copy(dAtA[i:], m.EnsName) + i = encodeVarintPairing(dAtA, i, uint64(len(m.EnsName))) + i-- + dAtA[i] = 0x22 + } + if len(m.ProfileImage) > 0 { + i -= len(m.ProfileImage) + copy(dAtA[i:], m.ProfileImage) + i = encodeVarintPairing(dAtA, i, uint64(len(m.ProfileImage))) + i-- + dAtA[i] = 0x1a + } + if len(m.Id) > 0 { + i -= len(m.Id) + copy(dAtA[i:], m.Id) + i = encodeVarintPairing(dAtA, i, uint64(len(m.Id))) + i-- + dAtA[i] = 0x12 + } + if m.Clock != 0 { + i = encodeVarintPairing(dAtA, i, uint64(m.Clock)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *SyncInstallationContactV2) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *SyncInstallationContactV2) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SyncInstallationContactV2) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if m.HasAddedUs { + i-- + if m.HasAddedUs { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x68 + } + if m.Removed { + i-- + if m.Removed { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x60 + } + if m.Muted { + i-- + if m.Muted { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x58 + } + if m.Blocked { + i-- + if m.Blocked { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x50 + } + if m.Added { + i-- + if m.Added { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x48 + } + if len(m.LocalNickname) > 0 { + i -= len(m.LocalNickname) + copy(dAtA[i:], m.LocalNickname) + i = encodeVarintPairing(dAtA, i, uint64(len(m.LocalNickname))) + i-- + dAtA[i] = 0x3a + } + if len(m.SystemTags) > 0 { + for iNdEx := len(m.SystemTags) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.SystemTags[iNdEx]) + copy(dAtA[i:], m.SystemTags[iNdEx]) + i = encodeVarintPairing(dAtA, i, uint64(len(m.SystemTags[iNdEx]))) + i-- + dAtA[i] = 0x32 + } + } + if m.LastUpdated != 0 { + i = encodeVarintPairing(dAtA, i, uint64(m.LastUpdated)) + i-- + dAtA[i] = 0x28 + } + if len(m.EnsName) > 0 { + i -= len(m.EnsName) + copy(dAtA[i:], m.EnsName) + i = encodeVarintPairing(dAtA, i, uint64(len(m.EnsName))) + i-- + dAtA[i] = 0x22 + } + if len(m.ProfileImage) > 0 { + i -= len(m.ProfileImage) + copy(dAtA[i:], m.ProfileImage) + i = encodeVarintPairing(dAtA, i, uint64(len(m.ProfileImage))) + i-- + dAtA[i] = 0x1a + } + if len(m.Id) > 0 { + i -= len(m.Id) + copy(dAtA[i:], m.Id) + i = encodeVarintPairing(dAtA, i, uint64(len(m.Id))) + i-- + dAtA[i] = 0x12 + } + if m.LastUpdatedLocally != 0 { + i = encodeVarintPairing(dAtA, i, uint64(m.LastUpdatedLocally)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *SyncInstallationAccount) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *SyncInstallationAccount) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SyncInstallationAccount) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if m.LastUpdated != 0 { + i = encodeVarintPairing(dAtA, i, uint64(m.LastUpdated)) + i-- + dAtA[i] = 0x18 + } + if len(m.ProfileImage) > 0 { + i -= len(m.ProfileImage) + copy(dAtA[i:], m.ProfileImage) + i = encodeVarintPairing(dAtA, i, uint64(len(m.ProfileImage))) + i-- + dAtA[i] = 0x12 + } + if m.Clock != 0 { + i = encodeVarintPairing(dAtA, i, uint64(m.Clock)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *SyncInstallationPublicChat) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *SyncInstallationPublicChat) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SyncInstallationPublicChat) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if len(m.Id) > 0 { + i -= len(m.Id) + copy(dAtA[i:], m.Id) + i = encodeVarintPairing(dAtA, i, uint64(len(m.Id))) + i-- + dAtA[i] = 0x12 + } + if m.Clock != 0 { + i = encodeVarintPairing(dAtA, i, uint64(m.Clock)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *SyncCommunity) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *SyncCommunity) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SyncCommunity) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if len(m.RequestsToJoin) > 0 { + for iNdEx := len(m.RequestsToJoin) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.RequestsToJoin[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintPairing(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x42 + } + } + if m.Muted { + i-- + if m.Muted { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x38 + } + if m.Verified { + i-- + if m.Verified { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x30 + } + if m.Joined { + i-- + if m.Joined { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x28 + } + if len(m.Description) > 0 { + i -= len(m.Description) + copy(dAtA[i:], m.Description) + i = encodeVarintPairing(dAtA, i, uint64(len(m.Description))) + i-- + dAtA[i] = 0x22 + } + if len(m.PrivateKey) > 0 { + i -= len(m.PrivateKey) + copy(dAtA[i:], m.PrivateKey) + i = encodeVarintPairing(dAtA, i, uint64(len(m.PrivateKey))) + i-- + dAtA[i] = 0x1a + } + if len(m.Id) > 0 { + i -= len(m.Id) + copy(dAtA[i:], m.Id) + i = encodeVarintPairing(dAtA, i, uint64(len(m.Id))) + i-- + dAtA[i] = 0x12 + } + if m.Clock != 0 { + i = encodeVarintPairing(dAtA, i, uint64(m.Clock)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *SyncCommunityRequestsToJoin) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *SyncCommunityRequestsToJoin) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SyncCommunityRequestsToJoin) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if m.State != 0 { + i = encodeVarintPairing(dAtA, i, uint64(m.State)) + i-- + dAtA[i] = 0x38 + } + if len(m.CommunityId) > 0 { + i -= len(m.CommunityId) + copy(dAtA[i:], m.CommunityId) + i = encodeVarintPairing(dAtA, i, uint64(len(m.CommunityId))) + i-- + dAtA[i] = 0x32 + } + if len(m.ChatId) > 0 { + i -= len(m.ChatId) + copy(dAtA[i:], m.ChatId) + i = encodeVarintPairing(dAtA, i, uint64(len(m.ChatId))) + i-- + dAtA[i] = 0x2a + } + if len(m.EnsName) > 0 { + i -= len(m.EnsName) + copy(dAtA[i:], m.EnsName) + i = encodeVarintPairing(dAtA, i, uint64(len(m.EnsName))) + i-- + dAtA[i] = 0x22 + } + if m.Clock != 0 { + i = encodeVarintPairing(dAtA, i, uint64(m.Clock)) + i-- + dAtA[i] = 0x18 + } + if len(m.PublicKey) > 0 { + i -= len(m.PublicKey) + copy(dAtA[i:], m.PublicKey) + i = encodeVarintPairing(dAtA, i, uint64(len(m.PublicKey))) + i-- + dAtA[i] = 0x12 + } + if len(m.Id) > 0 { + i -= len(m.Id) + copy(dAtA[i:], m.Id) + i = encodeVarintPairing(dAtA, i, uint64(len(m.Id))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *SyncInstallation) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *SyncInstallation) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SyncInstallation) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if len(m.Communities) > 0 { + for iNdEx := len(m.Communities) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Communities[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintPairing(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + } + if m.Account != nil { + { + size, err := m.Account.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintPairing(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if len(m.PublicChats) > 0 { + for iNdEx := len(m.PublicChats) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.PublicChats[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintPairing(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + if len(m.Contacts) > 0 { + for iNdEx := len(m.Contacts) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Contacts[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintPairing(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *SyncChatRemoved) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *SyncChatRemoved) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SyncChatRemoved) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if len(m.Id) > 0 { + i -= len(m.Id) + copy(dAtA[i:], m.Id) + i = encodeVarintPairing(dAtA, i, uint64(len(m.Id))) + i-- + dAtA[i] = 0x12 + } + if m.Clock != 0 { + i = encodeVarintPairing(dAtA, i, uint64(m.Clock)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *SyncChatMessagesRead) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *SyncChatMessagesRead) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SyncChatMessagesRead) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if len(m.Id) > 0 { + i -= len(m.Id) + copy(dAtA[i:], m.Id) + i = encodeVarintPairing(dAtA, i, uint64(len(m.Id))) + i-- + dAtA[i] = 0x12 + } + if m.Clock != 0 { + i = encodeVarintPairing(dAtA, i, uint64(m.Clock)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *SyncActivityCenterRead) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *SyncActivityCenterRead) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SyncActivityCenterRead) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if len(m.Ids) > 0 { + for iNdEx := len(m.Ids) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Ids[iNdEx]) + copy(dAtA[i:], m.Ids[iNdEx]) + i = encodeVarintPairing(dAtA, i, uint64(len(m.Ids[iNdEx]))) + i-- + dAtA[i] = 0x12 + } + } + if m.Clock != 0 { + i = encodeVarintPairing(dAtA, i, uint64(m.Clock)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *SyncActivityCenterAccepted) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *SyncActivityCenterAccepted) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SyncActivityCenterAccepted) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if len(m.Ids) > 0 { + for iNdEx := len(m.Ids) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Ids[iNdEx]) + copy(dAtA[i:], m.Ids[iNdEx]) + i = encodeVarintPairing(dAtA, i, uint64(len(m.Ids[iNdEx]))) + i-- + dAtA[i] = 0x12 + } + } + if m.Clock != 0 { + i = encodeVarintPairing(dAtA, i, uint64(m.Clock)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *SyncActivityCenterDismissed) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *SyncActivityCenterDismissed) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SyncActivityCenterDismissed) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if len(m.Ids) > 0 { + for iNdEx := len(m.Ids) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Ids[iNdEx]) + copy(dAtA[i:], m.Ids[iNdEx]) + i = encodeVarintPairing(dAtA, i, uint64(len(m.Ids[iNdEx]))) + i-- + dAtA[i] = 0x12 + } + } + if m.Clock != 0 { + i = encodeVarintPairing(dAtA, i, uint64(m.Clock)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *SyncBookmark) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *SyncBookmark) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SyncBookmark) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if m.Removed { + i-- + if m.Removed { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x28 + } + if len(m.ImageUrl) > 0 { + i -= len(m.ImageUrl) + copy(dAtA[i:], m.ImageUrl) + i = encodeVarintPairing(dAtA, i, uint64(len(m.ImageUrl))) + i-- + dAtA[i] = 0x22 + } + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintPairing(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0x1a + } + if len(m.Url) > 0 { + i -= len(m.Url) + copy(dAtA[i:], m.Url) + i = encodeVarintPairing(dAtA, i, uint64(len(m.Url))) + i-- + dAtA[i] = 0x12 + } + if m.Clock != 0 { + i = encodeVarintPairing(dAtA, i, uint64(m.Clock)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *SyncClearHistory) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *SyncClearHistory) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SyncClearHistory) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if m.ClearedAt != 0 { + i = encodeVarintPairing(dAtA, i, uint64(m.ClearedAt)) + i-- + dAtA[i] = 0x10 + } + if len(m.ChatId) > 0 { + i -= len(m.ChatId) + copy(dAtA[i:], m.ChatId) + i = encodeVarintPairing(dAtA, i, uint64(len(m.ChatId))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *SyncProfilePicture) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *SyncProfilePicture) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SyncProfilePicture) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if m.Clock != 0 { + i = encodeVarintPairing(dAtA, i, uint64(m.Clock)) + i-- + dAtA[i] = 0x38 + } + if m.ResizeTarget != 0 { + i = encodeVarintPairing(dAtA, i, uint64(m.ResizeTarget)) + i-- + dAtA[i] = 0x30 + } + if m.FileSize != 0 { + i = encodeVarintPairing(dAtA, i, uint64(m.FileSize)) + i-- + dAtA[i] = 0x28 + } + if m.Height != 0 { + i = encodeVarintPairing(dAtA, i, uint64(m.Height)) + i-- + dAtA[i] = 0x20 + } + if m.Width != 0 { + i = encodeVarintPairing(dAtA, i, uint64(m.Width)) + i-- + dAtA[i] = 0x18 + } + if len(m.Payload) > 0 { + i -= len(m.Payload) + copy(dAtA[i:], m.Payload) + i = encodeVarintPairing(dAtA, i, uint64(len(m.Payload))) + i-- + dAtA[i] = 0x12 + } + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintPairing(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *SyncProfilePictures) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *SyncProfilePictures) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SyncProfilePictures) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if len(m.Pictures) > 0 { + for iNdEx := len(m.Pictures) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Pictures[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintPairing(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + if len(m.KeyUid) > 0 { + i -= len(m.KeyUid) + copy(dAtA[i:], m.KeyUid) + i = encodeVarintPairing(dAtA, i, uint64(len(m.KeyUid))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintPairing(dAtA []byte, offset int, v uint64) int { + offset -= sovPairing(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *Backup) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Clock != 0 { + n += 1 + sovPairing(uint64(m.Clock)) + } + l = len(m.Id) + if l > 0 { + n += 1 + l + sovPairing(uint64(l)) + } + if len(m.Contacts) > 0 { + for _, e := range m.Contacts { + l = e.Size() + n += 1 + l + sovPairing(uint64(l)) + } + } + if len(m.Communities) > 0 { + for _, e := range m.Communities { + l = e.Size() + n += 1 + l + sovPairing(uint64(l)) + } + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *PairInstallation) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Clock != 0 { + n += 1 + sovPairing(uint64(m.Clock)) + } + l = len(m.InstallationId) + if l > 0 { + n += 1 + l + sovPairing(uint64(l)) + } + l = len(m.DeviceType) + if l > 0 { + n += 1 + l + sovPairing(uint64(l)) + } + l = len(m.Name) + if l > 0 { + n += 1 + l + sovPairing(uint64(l)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *SyncInstallationContact) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Clock != 0 { + n += 1 + sovPairing(uint64(m.Clock)) + } + l = len(m.Id) + if l > 0 { + n += 1 + l + sovPairing(uint64(l)) + } + l = len(m.ProfileImage) + if l > 0 { + n += 1 + l + sovPairing(uint64(l)) + } + l = len(m.EnsName) + if l > 0 { + n += 1 + l + sovPairing(uint64(l)) + } + if m.LastUpdated != 0 { + n += 1 + sovPairing(uint64(m.LastUpdated)) + } + if len(m.SystemTags) > 0 { + for _, s := range m.SystemTags { + l = len(s) + n += 1 + l + sovPairing(uint64(l)) + } + } + l = len(m.LocalNickname) + if l > 0 { + n += 1 + l + sovPairing(uint64(l)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *SyncInstallationContactV2) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.LastUpdatedLocally != 0 { + n += 1 + sovPairing(uint64(m.LastUpdatedLocally)) + } + l = len(m.Id) + if l > 0 { + n += 1 + l + sovPairing(uint64(l)) + } + l = len(m.ProfileImage) + if l > 0 { + n += 1 + l + sovPairing(uint64(l)) + } + l = len(m.EnsName) + if l > 0 { + n += 1 + l + sovPairing(uint64(l)) + } + if m.LastUpdated != 0 { + n += 1 + sovPairing(uint64(m.LastUpdated)) + } + if len(m.SystemTags) > 0 { + for _, s := range m.SystemTags { + l = len(s) + n += 1 + l + sovPairing(uint64(l)) + } + } + l = len(m.LocalNickname) + if l > 0 { + n += 1 + l + sovPairing(uint64(l)) + } + if m.Added { + n += 2 + } + if m.Blocked { + n += 2 + } + if m.Muted { + n += 2 + } + if m.Removed { + n += 2 + } + if m.HasAddedUs { + n += 2 + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *SyncInstallationAccount) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Clock != 0 { + n += 1 + sovPairing(uint64(m.Clock)) + } + l = len(m.ProfileImage) + if l > 0 { + n += 1 + l + sovPairing(uint64(l)) + } + if m.LastUpdated != 0 { + n += 1 + sovPairing(uint64(m.LastUpdated)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *SyncInstallationPublicChat) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Clock != 0 { + n += 1 + sovPairing(uint64(m.Clock)) + } + l = len(m.Id) + if l > 0 { + n += 1 + l + sovPairing(uint64(l)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *SyncCommunity) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Clock != 0 { + n += 1 + sovPairing(uint64(m.Clock)) + } + l = len(m.Id) + if l > 0 { + n += 1 + l + sovPairing(uint64(l)) + } + l = len(m.PrivateKey) + if l > 0 { + n += 1 + l + sovPairing(uint64(l)) + } + l = len(m.Description) + if l > 0 { + n += 1 + l + sovPairing(uint64(l)) + } + if m.Joined { + n += 2 + } + if m.Verified { + n += 2 + } + if m.Muted { + n += 2 + } + if len(m.RequestsToJoin) > 0 { + for _, e := range m.RequestsToJoin { + l = e.Size() + n += 1 + l + sovPairing(uint64(l)) + } + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *SyncCommunityRequestsToJoin) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Id) + if l > 0 { + n += 1 + l + sovPairing(uint64(l)) + } + l = len(m.PublicKey) + if l > 0 { + n += 1 + l + sovPairing(uint64(l)) + } + if m.Clock != 0 { + n += 1 + sovPairing(uint64(m.Clock)) + } + l = len(m.EnsName) + if l > 0 { + n += 1 + l + sovPairing(uint64(l)) + } + l = len(m.ChatId) + if l > 0 { + n += 1 + l + sovPairing(uint64(l)) + } + l = len(m.CommunityId) + if l > 0 { + n += 1 + l + sovPairing(uint64(l)) + } + if m.State != 0 { + n += 1 + sovPairing(uint64(m.State)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *SyncInstallation) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Contacts) > 0 { + for _, e := range m.Contacts { + l = e.Size() + n += 1 + l + sovPairing(uint64(l)) + } + } + if len(m.PublicChats) > 0 { + for _, e := range m.PublicChats { + l = e.Size() + n += 1 + l + sovPairing(uint64(l)) + } + } + if m.Account != nil { + l = m.Account.Size() + n += 1 + l + sovPairing(uint64(l)) + } + if len(m.Communities) > 0 { + for _, e := range m.Communities { + l = e.Size() + n += 1 + l + sovPairing(uint64(l)) + } + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *SyncChatRemoved) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Clock != 0 { + n += 1 + sovPairing(uint64(m.Clock)) + } + l = len(m.Id) + if l > 0 { + n += 1 + l + sovPairing(uint64(l)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *SyncChatMessagesRead) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Clock != 0 { + n += 1 + sovPairing(uint64(m.Clock)) + } + l = len(m.Id) + if l > 0 { + n += 1 + l + sovPairing(uint64(l)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *SyncActivityCenterRead) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Clock != 0 { + n += 1 + sovPairing(uint64(m.Clock)) + } + if len(m.Ids) > 0 { + for _, b := range m.Ids { + l = len(b) + n += 1 + l + sovPairing(uint64(l)) + } + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *SyncActivityCenterAccepted) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Clock != 0 { + n += 1 + sovPairing(uint64(m.Clock)) + } + if len(m.Ids) > 0 { + for _, b := range m.Ids { + l = len(b) + n += 1 + l + sovPairing(uint64(l)) + } + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *SyncActivityCenterDismissed) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Clock != 0 { + n += 1 + sovPairing(uint64(m.Clock)) + } + if len(m.Ids) > 0 { + for _, b := range m.Ids { + l = len(b) + n += 1 + l + sovPairing(uint64(l)) + } + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *SyncBookmark) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Clock != 0 { + n += 1 + sovPairing(uint64(m.Clock)) + } + l = len(m.Url) + if l > 0 { + n += 1 + l + sovPairing(uint64(l)) + } + l = len(m.Name) + if l > 0 { + n += 1 + l + sovPairing(uint64(l)) + } + l = len(m.ImageUrl) + if l > 0 { + n += 1 + l + sovPairing(uint64(l)) + } + if m.Removed { + n += 2 + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *SyncClearHistory) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.ChatId) + if l > 0 { + n += 1 + l + sovPairing(uint64(l)) + } + if m.ClearedAt != 0 { + n += 1 + sovPairing(uint64(m.ClearedAt)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *SyncProfilePicture) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Name) + if l > 0 { + n += 1 + l + sovPairing(uint64(l)) + } + l = len(m.Payload) + if l > 0 { + n += 1 + l + sovPairing(uint64(l)) + } + if m.Width != 0 { + n += 1 + sovPairing(uint64(m.Width)) + } + if m.Height != 0 { + n += 1 + sovPairing(uint64(m.Height)) + } + if m.FileSize != 0 { + n += 1 + sovPairing(uint64(m.FileSize)) + } + if m.ResizeTarget != 0 { + n += 1 + sovPairing(uint64(m.ResizeTarget)) + } + if m.Clock != 0 { + n += 1 + sovPairing(uint64(m.Clock)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *SyncProfilePictures) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.KeyUid) + if l > 0 { + n += 1 + l + sovPairing(uint64(l)) + } + if len(m.Pictures) > 0 { + for _, e := range m.Pictures { + l = e.Size() + n += 1 + l + sovPairing(uint64(l)) + } + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func sovPairing(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozPairing(x uint64) (n int) { + return sovPairing(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *Backup) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPairing + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Backup: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Backup: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Clock", wireType) + } + m.Clock = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPairing + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Clock |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPairing + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthPairing + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthPairing + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Id = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Contacts", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPairing + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthPairing + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthPairing + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Contacts = append(m.Contacts, &SyncInstallationContactV2{}) + if err := m.Contacts[len(m.Contacts)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Communities", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPairing + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthPairing + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthPairing + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Communities = append(m.Communities, &SyncCommunity{}) + if err := m.Communities[len(m.Communities)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipPairing(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthPairing + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *PairInstallation) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPairing + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: PairInstallation: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: PairInstallation: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Clock", wireType) + } + m.Clock = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPairing + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Clock |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field InstallationId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPairing + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthPairing + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthPairing + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.InstallationId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DeviceType", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPairing + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthPairing + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthPairing + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.DeviceType = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPairing + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthPairing + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthPairing + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipPairing(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthPairing + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *SyncInstallationContact) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPairing + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: SyncInstallationContact: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: SyncInstallationContact: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Clock", wireType) + } + m.Clock = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPairing + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Clock |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPairing + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthPairing + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthPairing + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Id = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ProfileImage", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPairing + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthPairing + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthPairing + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ProfileImage = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field EnsName", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPairing + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthPairing + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthPairing + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.EnsName = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field LastUpdated", wireType) + } + m.LastUpdated = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPairing + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.LastUpdated |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SystemTags", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPairing + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthPairing + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthPairing + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.SystemTags = append(m.SystemTags, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field LocalNickname", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPairing + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthPairing + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthPairing + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.LocalNickname = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipPairing(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthPairing + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *SyncInstallationContactV2) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPairing + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: SyncInstallationContactV2: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: SyncInstallationContactV2: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field LastUpdatedLocally", wireType) + } + m.LastUpdatedLocally = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPairing + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.LastUpdatedLocally |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPairing + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthPairing + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthPairing + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Id = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ProfileImage", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPairing + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthPairing + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthPairing + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ProfileImage = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field EnsName", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPairing + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthPairing + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthPairing + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.EnsName = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field LastUpdated", wireType) + } + m.LastUpdated = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPairing + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.LastUpdated |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SystemTags", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPairing + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthPairing + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthPairing + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.SystemTags = append(m.SystemTags, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field LocalNickname", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPairing + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthPairing + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthPairing + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.LocalNickname = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 9: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Added", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPairing + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Added = bool(v != 0) + case 10: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Blocked", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPairing + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Blocked = bool(v != 0) + case 11: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Muted", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPairing + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Muted = bool(v != 0) + case 12: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Removed", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPairing + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Removed = bool(v != 0) + case 13: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field HasAddedUs", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPairing + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.HasAddedUs = bool(v != 0) + default: + iNdEx = preIndex + skippy, err := skipPairing(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthPairing + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *SyncInstallationAccount) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPairing + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: SyncInstallationAccount: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: SyncInstallationAccount: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Clock", wireType) + } + m.Clock = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPairing + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Clock |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ProfileImage", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPairing + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthPairing + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthPairing + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ProfileImage = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field LastUpdated", wireType) + } + m.LastUpdated = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPairing + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.LastUpdated |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipPairing(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthPairing + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *SyncInstallationPublicChat) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPairing + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: SyncInstallationPublicChat: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: SyncInstallationPublicChat: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Clock", wireType) + } + m.Clock = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPairing + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Clock |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPairing + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthPairing + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthPairing + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Id = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipPairing(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthPairing + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *SyncCommunity) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPairing + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: SyncCommunity: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: SyncCommunity: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Clock", wireType) + } + m.Clock = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPairing + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Clock |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPairing + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthPairing + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthPairing + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Id = append(m.Id[:0], dAtA[iNdEx:postIndex]...) + if m.Id == nil { + m.Id = []byte{} + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PrivateKey", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPairing + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthPairing + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthPairing + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.PrivateKey = append(m.PrivateKey[:0], dAtA[iNdEx:postIndex]...) + if m.PrivateKey == nil { + m.PrivateKey = []byte{} + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Description", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPairing + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthPairing + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthPairing + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Description = append(m.Description[:0], dAtA[iNdEx:postIndex]...) + if m.Description == nil { + m.Description = []byte{} + } + iNdEx = postIndex + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Joined", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPairing + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Joined = bool(v != 0) + case 6: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Verified", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPairing + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Verified = bool(v != 0) + case 7: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Muted", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPairing + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Muted = bool(v != 0) + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RequestsToJoin", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPairing + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthPairing + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthPairing + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.RequestsToJoin = append(m.RequestsToJoin, &SyncCommunityRequestsToJoin{}) + if err := m.RequestsToJoin[len(m.RequestsToJoin)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipPairing(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthPairing + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *SyncCommunityRequestsToJoin) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPairing + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: SyncCommunityRequestsToJoin: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: SyncCommunityRequestsToJoin: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPairing + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthPairing + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthPairing + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Id = append(m.Id[:0], dAtA[iNdEx:postIndex]...) + if m.Id == nil { + m.Id = []byte{} + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PublicKey", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPairing + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthPairing + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthPairing + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.PublicKey = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Clock", wireType) + } + m.Clock = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPairing + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Clock |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field EnsName", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPairing + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthPairing + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthPairing + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.EnsName = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ChatId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPairing + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthPairing + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthPairing + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ChatId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CommunityId", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPairing + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthPairing + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthPairing + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.CommunityId = append(m.CommunityId[:0], dAtA[iNdEx:postIndex]...) + if m.CommunityId == nil { + m.CommunityId = []byte{} + } + iNdEx = postIndex + case 7: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field State", wireType) + } + m.State = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPairing + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.State |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipPairing(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthPairing + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *SyncInstallation) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPairing + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: SyncInstallation: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: SyncInstallation: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Contacts", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPairing + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthPairing + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthPairing + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Contacts = append(m.Contacts, &SyncInstallationContact{}) + if err := m.Contacts[len(m.Contacts)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PublicChats", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPairing + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthPairing + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthPairing + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.PublicChats = append(m.PublicChats, &SyncInstallationPublicChat{}) + if err := m.PublicChats[len(m.PublicChats)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Account", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPairing + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthPairing + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthPairing + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Account == nil { + m.Account = &SyncInstallationAccount{} + } + if err := m.Account.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Communities", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPairing + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthPairing + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthPairing + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Communities = append(m.Communities, &SyncCommunity{}) + if err := m.Communities[len(m.Communities)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipPairing(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthPairing + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *SyncChatRemoved) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPairing + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: SyncChatRemoved: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: SyncChatRemoved: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Clock", wireType) + } + m.Clock = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPairing + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Clock |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPairing + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthPairing + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthPairing + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Id = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipPairing(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthPairing + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *SyncChatMessagesRead) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPairing + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: SyncChatMessagesRead: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: SyncChatMessagesRead: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Clock", wireType) + } + m.Clock = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPairing + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Clock |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPairing + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthPairing + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthPairing + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Id = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipPairing(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthPairing + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *SyncActivityCenterRead) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPairing + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: SyncActivityCenterRead: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: SyncActivityCenterRead: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Clock", wireType) + } + m.Clock = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPairing + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Clock |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Ids", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPairing + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthPairing + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthPairing + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Ids = append(m.Ids, make([]byte, postIndex-iNdEx)) + copy(m.Ids[len(m.Ids)-1], dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipPairing(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthPairing + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *SyncActivityCenterAccepted) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPairing + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: SyncActivityCenterAccepted: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: SyncActivityCenterAccepted: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Clock", wireType) + } + m.Clock = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPairing + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Clock |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Ids", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPairing + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthPairing + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthPairing + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Ids = append(m.Ids, make([]byte, postIndex-iNdEx)) + copy(m.Ids[len(m.Ids)-1], dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipPairing(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthPairing + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *SyncActivityCenterDismissed) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPairing + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: SyncActivityCenterDismissed: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: SyncActivityCenterDismissed: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Clock", wireType) + } + m.Clock = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPairing + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Clock |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Ids", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPairing + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthPairing + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthPairing + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Ids = append(m.Ids, make([]byte, postIndex-iNdEx)) + copy(m.Ids[len(m.Ids)-1], dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipPairing(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthPairing + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *SyncBookmark) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPairing + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: SyncBookmark: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: SyncBookmark: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Clock", wireType) + } + m.Clock = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPairing + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Clock |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Url", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPairing + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthPairing + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthPairing + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Url = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPairing + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthPairing + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthPairing + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ImageUrl", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPairing + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthPairing + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthPairing + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ImageUrl = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Removed", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPairing + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Removed = bool(v != 0) + default: + iNdEx = preIndex + skippy, err := skipPairing(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthPairing + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *SyncClearHistory) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPairing + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: SyncClearHistory: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: SyncClearHistory: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ChatId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPairing + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthPairing + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthPairing + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ChatId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ClearedAt", wireType) + } + m.ClearedAt = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPairing + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ClearedAt |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipPairing(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthPairing + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *SyncProfilePicture) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPairing + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: SyncProfilePicture: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: SyncProfilePicture: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPairing + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthPairing + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthPairing + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Payload", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPairing + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthPairing + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthPairing + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Payload = append(m.Payload[:0], dAtA[iNdEx:postIndex]...) + if m.Payload == nil { + m.Payload = []byte{} + } + iNdEx = postIndex + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Width", wireType) + } + m.Width = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPairing + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Width |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Height", wireType) + } + m.Height = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPairing + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Height |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field FileSize", wireType) + } + m.FileSize = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPairing + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.FileSize |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 6: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ResizeTarget", wireType) + } + m.ResizeTarget = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPairing + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ResizeTarget |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 7: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Clock", wireType) + } + m.Clock = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPairing + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Clock |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipPairing(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthPairing + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *SyncProfilePictures) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPairing + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: SyncProfilePictures: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: SyncProfilePictures: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field KeyUid", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPairing + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthPairing + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthPairing + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.KeyUid = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pictures", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPairing + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthPairing + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthPairing + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Pictures = append(m.Pictures, &SyncProfilePicture{}) + if err := m.Pictures[len(m.Pictures)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipPairing(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthPairing + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipPairing(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowPairing + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowPairing + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowPairing + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthPairing + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupPairing + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthPairing + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthPairing = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowPairing = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupPairing = fmt.Errorf("proto: unexpected end of group") +) diff --git a/protocol/protobuf/pairing.proto b/protocol/protobuf/pairing.proto index 94bdec782..00da37f02 100644 --- a/protocol/protobuf/pairing.proto +++ b/protocol/protobuf/pairing.proto @@ -119,3 +119,18 @@ message SyncClearHistory { string chat_id = 1; uint64 cleared_at = 2; } + +message SyncProfilePicture { + string name = 1; + bytes payload = 2; + uint32 width = 3; + uint32 height = 4; + uint32 file_size = 5; + uint32 resize_target = 6; + uint64 clock = 7; +} + +message SyncProfilePictures { + string key_uid = 1; + repeated SyncProfilePicture pictures = 2; +} diff --git a/protocol/v1/status_message.go b/protocol/v1/status_message.go index d22e92680..4451c6343 100644 --- a/protocol/v1/status_message.go +++ b/protocol/v1/status_message.go @@ -209,6 +209,9 @@ func (m *StatusMessage) HandleApplication() error { case protobuf.ApplicationMetadataMessage_SYNC_INSTALLATION_ACCOUNT: return m.unmarshalProtobufData(new(protobuf.SyncInstallationAccount)) + case protobuf.ApplicationMetadataMessage_SYNC_PROFILE_PICTURE: + return m.unmarshalProtobufData(new(protobuf.SyncProfilePictures)) + case protobuf.ApplicationMetadataMessage_PAIR_INSTALLATION: return m.unmarshalProtobufData(new(protobuf.PairInstallation)) diff --git a/services/accounts/multiaccounts.go b/services/accounts/multiaccounts.go index ad4b78dae..cbcea8210 100644 --- a/services/accounts/multiaccounts.go +++ b/services/accounts/multiaccounts.go @@ -49,7 +49,7 @@ func (api *MultiAccountsAPI) StoreIdentityImage(keyUID, filepath string, aX, aY, return nil, err } - err = api.db.StoreIdentityImages(keyUID, iis) + err = api.db.StoreIdentityImages(keyUID, iis, true) if err != nil { return nil, err } @@ -63,7 +63,7 @@ func (api *MultiAccountsAPI) StoreIdentityImageFromURL(keyUID, url string) ([]*i return nil, err } - err = api.db.StoreIdentityImages(keyUID, iis) + err = api.db.StoreIdentityImages(keyUID, iis, true) if err != nil { return nil, err }