2023-01-03 19:55:46 +00:00
|
|
|
// Copyright 2020 Signal Messenger, LLC
|
2021-07-20 20:18:35 +00:00
|
|
|
// SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
|
2020-07-07 00:56:56 +00:00
|
|
|
package signalservice;
|
|
|
|
|
|
|
|
option java_package = "org.whispersystems.signalservice.internal.storage";
|
|
|
|
option java_outer_classname = "SignalStorageProtos";
|
|
|
|
|
2022-10-25 22:18:42 +00:00
|
|
|
enum OptionalBool {
|
|
|
|
UNSET = 0;
|
|
|
|
ENABLED = 1;
|
|
|
|
DISABLED = 2;
|
|
|
|
}
|
|
|
|
|
2020-07-07 00:56:56 +00:00
|
|
|
message StorageManifest {
|
|
|
|
optional uint64 version = 1;
|
|
|
|
optional bytes value = 2;
|
|
|
|
}
|
|
|
|
|
|
|
|
message StorageItem {
|
|
|
|
optional bytes key = 1;
|
|
|
|
optional bytes value = 2;
|
|
|
|
}
|
|
|
|
|
|
|
|
message StorageItems {
|
|
|
|
repeated StorageItem items = 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
message ReadOperation {
|
|
|
|
repeated bytes readKey = 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
message WriteOperation {
|
|
|
|
optional StorageManifest manifest = 1;
|
|
|
|
repeated StorageItem insertItem = 2;
|
|
|
|
repeated bytes deleteKey = 3;
|
|
|
|
optional bool clearAll = 4;
|
|
|
|
}
|
|
|
|
|
|
|
|
message ManifestRecord {
|
|
|
|
message Identifier {
|
|
|
|
enum Type {
|
|
|
|
UNKNOWN = 0;
|
|
|
|
CONTACT = 1;
|
|
|
|
GROUPV1 = 2;
|
|
|
|
GROUPV2 = 3;
|
|
|
|
ACCOUNT = 4;
|
2022-07-01 00:52:03 +00:00
|
|
|
STORY_DISTRIBUTION_LIST = 5;
|
2022-08-03 17:10:49 +00:00
|
|
|
STICKER_PACK = 6;
|
2020-07-07 00:56:56 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
optional bytes raw = 1;
|
|
|
|
optional Type type = 2;
|
|
|
|
}
|
|
|
|
|
2022-05-25 19:20:45 +00:00
|
|
|
optional uint64 version = 1;
|
|
|
|
optional uint32 sourceDevice = 3;
|
|
|
|
repeated Identifier keys = 2;
|
|
|
|
// Next ID: 4
|
2020-07-07 00:56:56 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
message StorageRecord {
|
|
|
|
oneof record {
|
|
|
|
ContactRecord contact = 1;
|
|
|
|
GroupV1Record groupV1 = 2;
|
|
|
|
GroupV2Record groupV2 = 3;
|
|
|
|
AccountRecord account = 4;
|
2022-07-01 00:52:03 +00:00
|
|
|
StoryDistributionListRecord storyDistributionList = 5;
|
2022-08-03 17:10:49 +00:00
|
|
|
StickerPackRecord stickerPack = 6;
|
2020-07-07 00:56:56 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
message ContactRecord {
|
|
|
|
enum IdentityState {
|
2022-09-19 18:47:49 +00:00
|
|
|
DEFAULT = 0;
|
|
|
|
VERIFIED = 1;
|
2020-07-07 00:56:56 +00:00
|
|
|
UNVERIFIED = 2;
|
|
|
|
}
|
|
|
|
|
2024-03-26 19:48:33 +00:00
|
|
|
message Name {
|
|
|
|
optional string given = 1;
|
|
|
|
optional string family = 2;
|
|
|
|
}
|
|
|
|
|
2023-08-10 16:43:33 +00:00
|
|
|
optional string aci = 1;
|
2022-09-19 18:47:49 +00:00
|
|
|
optional string serviceE164 = 2;
|
|
|
|
optional string pni = 15;
|
|
|
|
optional bytes profileKey = 3;
|
|
|
|
optional bytes identityKey = 4;
|
|
|
|
optional IdentityState identityState = 5;
|
|
|
|
optional string givenName = 6;
|
|
|
|
optional string familyName = 7;
|
|
|
|
optional string username = 8;
|
|
|
|
optional bool blocked = 9;
|
|
|
|
optional bool whitelisted = 10;
|
|
|
|
optional bool archived = 11;
|
|
|
|
optional bool markedUnread = 12;
|
|
|
|
optional uint64 mutedUntilTimestamp = 13;
|
|
|
|
optional bool hideStory = 14;
|
|
|
|
optional uint64 unregisteredAtTimestamp = 16;
|
2022-09-27 23:07:00 +00:00
|
|
|
optional string systemGivenName = 17;
|
|
|
|
optional string systemFamilyName = 18;
|
2023-02-13 22:40:11 +00:00
|
|
|
optional string systemNickname = 19;
|
2023-04-05 20:48:00 +00:00
|
|
|
optional bool hidden = 20;
|
2024-01-29 22:37:26 +00:00
|
|
|
optional bool pniSignatureVerified = 21;
|
2024-03-26 19:48:33 +00:00
|
|
|
optional Name nickname = 22;
|
|
|
|
optional string note = 23;
|
2020-07-07 00:56:56 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
message GroupV1Record {
|
2021-04-09 16:19:38 +00:00
|
|
|
optional bytes id = 1;
|
|
|
|
optional bool blocked = 2;
|
|
|
|
optional bool whitelisted = 3;
|
|
|
|
optional bool archived = 4;
|
|
|
|
optional bool markedUnread = 5;
|
|
|
|
optional uint64 mutedUntilTimestamp = 6;
|
2020-07-07 00:56:56 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
message GroupV2Record {
|
2022-10-08 00:19:02 +00:00
|
|
|
enum StorySendMode {
|
|
|
|
DEFAULT = 0;
|
|
|
|
DISABLED = 1;
|
|
|
|
ENABLED = 2;
|
|
|
|
}
|
|
|
|
|
|
|
|
optional bytes masterKey = 1;
|
|
|
|
optional bool blocked = 2;
|
|
|
|
optional bool whitelisted = 3;
|
|
|
|
optional bool archived = 4;
|
|
|
|
optional bool markedUnread = 5;
|
|
|
|
optional uint64 mutedUntilTimestamp = 6;
|
|
|
|
optional bool dontNotifyForMentionsIfMuted = 7;
|
|
|
|
optional bool hideStory = 8;
|
|
|
|
reserved /* storySendEnabled */ 9; // removed
|
|
|
|
optional StorySendMode storySendMode = 10;
|
2020-07-07 00:56:56 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
message AccountRecord {
|
2021-04-05 16:03:27 +00:00
|
|
|
enum PhoneNumberSharingMode {
|
2024-02-22 17:29:58 +00:00
|
|
|
UNKNOWN = 0;
|
|
|
|
EVERYBODY = 1;
|
2021-04-05 16:03:27 +00:00
|
|
|
NOBODY = 2;
|
|
|
|
}
|
|
|
|
|
2020-09-29 22:07:03 +00:00
|
|
|
message PinnedConversation {
|
|
|
|
message Contact {
|
2023-08-16 20:54:39 +00:00
|
|
|
optional string serviceId = 1;
|
2020-09-29 22:07:03 +00:00
|
|
|
optional string e164 = 2;
|
|
|
|
}
|
|
|
|
|
|
|
|
oneof identifier {
|
|
|
|
Contact contact = 1;
|
|
|
|
bytes legacyGroupId = 3;
|
|
|
|
bytes groupMasterKey = 4;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-07-20 03:14:08 +00:00
|
|
|
message UsernameLink {
|
|
|
|
enum Color {
|
|
|
|
UNKNOWN = 0;
|
|
|
|
BLUE = 1;
|
|
|
|
WHITE = 2;
|
|
|
|
GREY = 3;
|
|
|
|
OLIVE = 4;
|
|
|
|
GREEN = 5;
|
|
|
|
ORANGE = 6;
|
|
|
|
PINK = 7;
|
|
|
|
PURPLE = 8;
|
|
|
|
}
|
|
|
|
|
|
|
|
optional bytes entropy = 1; // 32 bytes of entropy used for encryption
|
|
|
|
optional bytes serverId = 2; // 16 bytes of encoded UUID provided by the server
|
|
|
|
optional Color color = 3; // color of the QR code itself
|
|
|
|
}
|
|
|
|
|
2022-10-07 17:02:08 +00:00
|
|
|
optional bytes profileKey = 1;
|
|
|
|
optional string givenName = 2;
|
|
|
|
optional string familyName = 3;
|
|
|
|
optional string avatarUrl = 4;
|
|
|
|
optional bool noteToSelfArchived = 5;
|
|
|
|
optional bool readReceipts = 6;
|
|
|
|
optional bool sealedSenderIndicators = 7;
|
|
|
|
optional bool typingIndicators = 8;
|
2024-03-15 14:20:33 +00:00
|
|
|
reserved 9; // proxiedLinkPreviews
|
2022-10-07 17:02:08 +00:00
|
|
|
optional bool noteToSelfMarkedUnread = 10;
|
|
|
|
optional bool linkPreviews = 11;
|
|
|
|
optional PhoneNumberSharingMode phoneNumberSharingMode = 12;
|
|
|
|
optional bool notDiscoverableByPhoneNumber = 13;
|
|
|
|
repeated PinnedConversation pinnedConversations = 14;
|
|
|
|
optional bool preferContactAvatars = 15;
|
|
|
|
optional uint32 universalExpireTimer = 17;
|
|
|
|
optional bool primarySendsSms = 18;
|
2024-02-16 19:49:48 +00:00
|
|
|
reserved 19; // deprecatedE164
|
2022-10-07 17:02:08 +00:00
|
|
|
repeated string preferredReactionEmoji = 20;
|
|
|
|
optional bytes subscriberId = 21;
|
|
|
|
optional string subscriberCurrencyCode = 22;
|
|
|
|
optional bool displayBadgesOnProfile = 23;
|
2024-06-12 20:36:02 +00:00
|
|
|
optional bool donorSubscriptionManuallyCancelled = 24;
|
2022-10-07 17:02:08 +00:00
|
|
|
optional bool keepMutedChatsArchived = 25;
|
|
|
|
optional bool hasSetMyStoriesPrivacy = 26;
|
2022-11-09 02:38:19 +00:00
|
|
|
optional bool hasViewedOnboardingStory = 27;
|
2022-10-07 17:02:08 +00:00
|
|
|
reserved 28; // deprecatedStoriesDisabled
|
|
|
|
optional bool storiesDisabled = 29;
|
2022-10-25 22:18:42 +00:00
|
|
|
optional OptionalBool storyViewReceiptsEnabled = 30;
|
2023-02-08 17:14:59 +00:00
|
|
|
reserved 31; // hasReadOnboardingStory
|
2024-06-12 20:36:02 +00:00
|
|
|
optional bool hasSeenGroupStoryEducationSheet = 32;
|
2023-02-08 17:14:59 +00:00
|
|
|
optional string username = 33;
|
2023-02-13 18:51:41 +00:00
|
|
|
optional bool hasCompletedUsernameOnboarding = 34;
|
2023-07-20 03:14:08 +00:00
|
|
|
optional UsernameLink usernameLink = 35;
|
2024-06-10 21:37:14 +00:00
|
|
|
optional bytes backupsSubscriberId = 36;
|
|
|
|
optional string backupsSubscriberCurrencyCode = 37;
|
2024-06-12 20:36:02 +00:00
|
|
|
optional bool backupsSubscriptionManuallyCancelled = 38;
|
2020-07-07 00:56:56 +00:00
|
|
|
}
|
2022-07-01 00:52:03 +00:00
|
|
|
|
|
|
|
message StoryDistributionListRecord {
|
|
|
|
optional bytes identifier = 1;
|
|
|
|
optional string name = 2;
|
2023-08-10 16:43:33 +00:00
|
|
|
repeated string recipientServiceIds = 3;
|
2022-07-01 00:52:03 +00:00
|
|
|
optional uint64 deletedAtTimestamp = 4;
|
|
|
|
optional bool allowsReplies = 5;
|
|
|
|
optional bool isBlockList = 6;
|
|
|
|
}
|
2022-08-03 17:10:49 +00:00
|
|
|
|
|
|
|
message StickerPackRecord {
|
|
|
|
optional bytes packId = 1; // 16 bytes
|
|
|
|
optional bytes packKey = 2; // 32 bytes, used to derive the AES-256 key
|
|
|
|
// aesKey = HKDF(
|
|
|
|
// input = packKey,
|
|
|
|
// salt = 32 zero bytes,
|
|
|
|
// info = "Sticker Pack"
|
|
|
|
// )
|
|
|
|
optional uint32 position = 3; // When displayed sticker packs should be first sorted
|
|
|
|
// in descending order by zero-based `position` and
|
|
|
|
// then by ascending `packId` (lexicographically,
|
|
|
|
// packId can be treated as a hex string).
|
|
|
|
// When installing a sticker pack the client should find
|
|
|
|
// the maximum `position` among currently known stickers
|
|
|
|
// and use `max_position + 1` as the value for the new
|
|
|
|
// `position`.
|
|
|
|
optional uint64 deletedAtTimestamp = 4; // Timestamp in milliseconds. When present and
|
|
|
|
// non-zero - `packKey` and `position` should
|
|
|
|
// be unset
|
|
|
|
}
|