Introduce infrastructure for Notification Profiles

This commit is contained in:
Scott Nonnenberg
2025-05-06 00:39:04 +10:00
committed by GitHub
parent 80872ef15c
commit 98270316c5
35 changed files with 2917 additions and 38 deletions
+56 -12
View File
@@ -54,6 +54,7 @@ message ManifestRecord {
STICKER_PACK = 6;
CALL_LINK = 7;
CHAT_FOLDER = 8;
NOTIFICATION_PROFILE = 9;
}
bytes raw = 1;
@@ -77,6 +78,7 @@ message StorageRecord {
StickerPackRecord stickerPack = 6;
CallLinkRecord callLink = 7;
ChatFolderRecord chatFolder = 8;
NotificationProfile notificationProfile = 9;
}
}
@@ -228,6 +230,20 @@ message AccountRecord {
optional uint64 endedAtTimestamp = 2;
}
message NotificationProfileManualOverride {
message ManuallyEnabled {
bytes id = 1;
// This will be unset if no timespan was chosen in the UI.
uint64 endAtTimestampMs = 3;
}
oneof override {
uint64 disabledAtTimestampMs = 1;
ManuallyEnabled enabled = 2;
}
}
bytes profileKey = 1;
string givenName = 2;
string familyName = 3;
@@ -275,6 +291,7 @@ message AccountRecord {
optional uint64 backupTier = 40;
IAPSubscriberData backupSubscriberData = 41;
optional AvatarColor avatarColor = 42;
NotificationProfileManualOverride notificationProfileManualOverride = 44;
}
message StoryDistributionListRecord {
@@ -314,20 +331,20 @@ message CallLinkRecord {
// should be cleared
}
message ChatFolderRecord {
message Recipient {
message Contact {
string serviceId = 1;
string e164 = 2;
}
oneof identifier {
Contact contact = 1;
bytes legacyGroupId = 2;
bytes groupMasterKey = 3;
}
message Recipient {
message Contact {
string serviceId = 1;
string e164 = 2;
}
oneof identifier {
Contact contact = 1;
bytes legacyGroupId = 2;
bytes groupMasterKey = 3;
}
}
message ChatFolderRecord {
// Represents the default "All chats" folder record vs all other custom folders
enum FolderType {
UNKNOWN = 0;
@@ -347,3 +364,30 @@ message ChatFolderRecord {
repeated Recipient excludedRecipients = 10;
uint64 deletedAtTimestampMs = 11; // When non-zero, `position` should be set to -1 and `includedRecipients` should be empty
}
message NotificationProfile {
enum DayOfWeek {
UNKNOWN = 0; // Interpret as "Monday"
MONDAY = 1;
TUESDAY = 2;
WEDNESDAY = 3;
THURSDAY = 4;
FRIDAY = 5;
SATURDAY = 6;
SUNDAY = 7;
}
bytes id = 1;
string name = 2;
optional string emoji = 3;
fixed32 color = 4; // 0xAARRGGBB
uint64 createdAtMs = 5;
bool allowAllCalls = 6;
bool allowAllMentions = 7;
repeated Recipient allowedMembers = 8;
bool scheduleEnabled = 9;
uint32 scheduleStartTime = 10; // 24-hour clock int, 0000-2359 (e.g., 15, 900, 1130, 2345)
uint32 scheduleEndTime = 11; // 24-hour clock int, 0000-2359 (e.g., 15, 900, 1130, 2345)
repeated DayOfWeek scheduleDaysEnabled = 12;
uint64 deletedAtTimestampMs = 13;
}