242 lines
7.6 KiB
Protocol Buffer
242 lines
7.6 KiB
Protocol Buffer
/**
|
|
* Copyright (C) 2019 Open Whisper Systems
|
|
*
|
|
* Licensed according to the LICENSE file in this repository.
|
|
*/
|
|
syntax = "proto3";
|
|
|
|
package signalservice;
|
|
|
|
option java_package = "org.whispersystems.signalservice.internal.storage.protos";
|
|
option java_multiple_files = true;
|
|
|
|
enum OptionalBool {
|
|
UNSET = 0;
|
|
ENABLED = 1;
|
|
DISABLED = 2;
|
|
}
|
|
|
|
message StorageManifest {
|
|
uint64 version = 1;
|
|
bytes value = 2;
|
|
}
|
|
|
|
message StorageItem {
|
|
bytes key = 1;
|
|
bytes value = 2;
|
|
}
|
|
|
|
message StorageItems {
|
|
repeated StorageItem items = 1;
|
|
}
|
|
|
|
message ReadOperation {
|
|
repeated bytes readKey = 1;
|
|
}
|
|
|
|
message WriteOperation {
|
|
StorageManifest manifest = 1;
|
|
repeated StorageItem insertItem = 2;
|
|
repeated bytes deleteKey = 3;
|
|
bool clearAll = 4;
|
|
}
|
|
|
|
message ManifestRecord {
|
|
message Identifier {
|
|
enum Type {
|
|
UNKNOWN = 0;
|
|
CONTACT = 1;
|
|
GROUPV1 = 2;
|
|
GROUPV2 = 3;
|
|
ACCOUNT = 4;
|
|
STORY_DISTRIBUTION_LIST = 5;
|
|
CALL_LINK = 7;
|
|
}
|
|
|
|
bytes raw = 1;
|
|
Type type = 2;
|
|
}
|
|
|
|
uint64 version = 1;
|
|
uint32 sourceDevice = 3;
|
|
repeated Identifier identifiers = 2;
|
|
// Next ID: 4
|
|
|
|
optional bytes recordIkm = 4; // Copied manually from Signal Desktop
|
|
}
|
|
|
|
message StorageRecord {
|
|
oneof record {
|
|
ContactRecord contact = 1;
|
|
GroupV1Record groupV1 = 2;
|
|
GroupV2Record groupV2 = 3;
|
|
AccountRecord account = 4;
|
|
StoryDistributionListRecord storyDistributionList = 5;
|
|
CallLinkRecord callLink = 7;
|
|
}
|
|
}
|
|
|
|
message ContactRecord {
|
|
enum IdentityState {
|
|
DEFAULT = 0;
|
|
VERIFIED = 1;
|
|
UNVERIFIED = 2;
|
|
}
|
|
|
|
message Name {
|
|
string given = 1;
|
|
string family = 2;
|
|
}
|
|
|
|
string aci = 1;
|
|
string e164 = 2;
|
|
string pni = 15;
|
|
bytes profileKey = 3;
|
|
bytes identityKey = 4;
|
|
IdentityState identityState = 5;
|
|
string givenName = 6;
|
|
string familyName = 7;
|
|
string username = 8;
|
|
bool blocked = 9;
|
|
bool whitelisted = 10;
|
|
bool archived = 11;
|
|
bool markedUnread = 12;
|
|
uint64 mutedUntilTimestamp = 13;
|
|
bool hideStory = 14;
|
|
uint64 unregisteredAtTimestamp = 16;
|
|
string systemGivenName = 17;
|
|
string systemFamilyName = 18;
|
|
string systemNickname = 19;
|
|
bool hidden = 20;
|
|
bool pniSignatureVerified = 21;
|
|
Name nickname = 22;
|
|
string note = 23;
|
|
// NEXT ID: 24
|
|
}
|
|
|
|
message GroupV1Record {
|
|
bytes id = 1;
|
|
bool blocked = 2;
|
|
bool whitelisted = 3;
|
|
bool archived = 4;
|
|
bool markedUnread = 5;
|
|
uint64 mutedUntilTimestamp = 6;
|
|
}
|
|
|
|
message GroupV2Record {
|
|
enum StorySendMode {
|
|
DEFAULT = 0;
|
|
DISABLED = 1;
|
|
ENABLED = 2;
|
|
}
|
|
|
|
bytes masterKey = 1;
|
|
bool blocked = 2;
|
|
bool whitelisted = 3;
|
|
bool archived = 4;
|
|
bool markedUnread = 5;
|
|
uint64 mutedUntilTimestamp = 6;
|
|
bool dontNotifyForMentionsIfMuted = 7;
|
|
bool hideStory = 8;
|
|
reserved /* storySendEnabled */ 9;
|
|
StorySendMode storySendMode = 10;
|
|
}
|
|
|
|
message Payments {
|
|
bool enabled = 1;
|
|
bytes entropy = 2;
|
|
}
|
|
|
|
message AccountRecord {
|
|
|
|
enum PhoneNumberSharingMode {
|
|
UNKNOWN = 0;
|
|
EVERYBODY = 1;
|
|
NOBODY = 2;
|
|
}
|
|
|
|
message PinnedConversation {
|
|
message Contact {
|
|
string serviceId = 1;
|
|
string e164 = 2;
|
|
}
|
|
|
|
oneof identifier {
|
|
Contact contact = 1;
|
|
bytes legacyGroupId = 3;
|
|
bytes groupMasterKey = 4;
|
|
}
|
|
}
|
|
|
|
message UsernameLink {
|
|
enum Color {
|
|
UNKNOWN = 0;
|
|
BLUE = 1;
|
|
WHITE = 2;
|
|
GREY = 3;
|
|
OLIVE = 4;
|
|
GREEN = 5;
|
|
ORANGE = 6;
|
|
PINK = 7;
|
|
PURPLE = 8;
|
|
}
|
|
|
|
bytes entropy = 1; // 32 bytes of entropy used for encryption
|
|
bytes serverId = 2; // 16 bytes of encoded UUID provided by the server
|
|
Color color = 3;
|
|
}
|
|
|
|
bytes profileKey = 1;
|
|
string givenName = 2;
|
|
string familyName = 3;
|
|
string avatarUrlPath = 4;
|
|
bool noteToSelfArchived = 5;
|
|
bool readReceipts = 6;
|
|
bool sealedSenderIndicators = 7;
|
|
bool typingIndicators = 8;
|
|
reserved /* proxiedLinkPreviews */ 9;
|
|
bool noteToSelfMarkedUnread = 10;
|
|
bool linkPreviews = 11;
|
|
PhoneNumberSharingMode phoneNumberSharingMode = 12;
|
|
bool unlistedPhoneNumber = 13;
|
|
repeated PinnedConversation pinnedConversations = 14;
|
|
bool preferContactAvatars = 15;
|
|
Payments payments = 16;
|
|
uint32 universalExpireTimer = 17;
|
|
bool primarySendsSms = 18;
|
|
string e164 = 19;
|
|
repeated string preferredReactionEmoji = 20;
|
|
bytes subscriberId = 21;
|
|
string subscriberCurrencyCode = 22;
|
|
bool displayBadgesOnProfile = 23;
|
|
bool subscriptionManuallyCancelled = 24;
|
|
bool keepMutedChatsArchived = 25;
|
|
bool hasSetMyStoriesPrivacy = 26;
|
|
bool hasViewedOnboardingStory = 27;
|
|
reserved /* storiesDisabled */ 28;
|
|
bool storiesDisabled = 29;
|
|
OptionalBool storyViewReceiptsEnabled = 30;
|
|
reserved /* hasReadOnboardingStory */ 31;
|
|
bool hasSeenGroupStoryEducationSheet = 32;
|
|
string username = 33;
|
|
bool hasCompletedUsernameOnboarding = 34;
|
|
UsernameLink usernameLink = 35;
|
|
bytes backupsSubscriberId = 36;
|
|
string backupsSubscriberCurrencyCode = 37;
|
|
}
|
|
|
|
message StoryDistributionListRecord {
|
|
bytes identifier = 1;
|
|
string name = 2;
|
|
repeated string recipientServiceIds = 3;
|
|
uint64 deletedAtTimestamp = 4;
|
|
bool allowsReplies = 5;
|
|
bool isBlockList = 6;
|
|
}
|
|
|
|
message CallLinkRecord {
|
|
bytes rootKey = 1;
|
|
bytes adminPasskey = 2;
|
|
uint64 deletedAtTimestampMs = 3;
|
|
}
|