Skip to content

Commit

Permalink
comments
Browse files Browse the repository at this point in the history
  • Loading branch information
codabrink committed Jan 22, 2025
1 parent 1eefc87 commit 6060230
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 0 deletions.
3 changes: 3 additions & 0 deletions proto/device_sync/consent_backup.proto
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
syntax = "proto3";
package xmtp.device_sync.consent_backup;

// Proto representation of a consent record save
message ConsentSave {
ConsentTypeSave entity_type = 1;
ConsentStateSave state = 2;
string entity = 3;
}

// Consent record type
enum ConsentTypeSave {
CONSENT_TYPE_SAVE_CONVERSATION_ID = 0;
CONSENT_TYPE_SAVE_INBOX_ID = 1;
CONSENT_TYPE_SAVE_ADDRESS = 2;
}

// Consent record state
enum ConsentStateSave {
CONSENT_STATE_SAVE_UNKNOWN = 0;
CONSENT_STATE_SAVE_ALLOWED = 1;
Expand Down
4 changes: 4 additions & 0 deletions proto/device_sync/device_sync.proto
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import "device_sync/group_backup.proto";
import "device_sync/message_backup.proto";
import "device_sync/consent_backup.proto";

// Union type representing everything that can be serialied and saved in a backup archive.
message BackupElement {
oneof element {
BackupMetadataSave metadata = 1;
Expand All @@ -14,13 +15,16 @@ message BackupElement {
}
}

// Proto representation of backup metadata
// (Backup version is explicitly missing - it's stored as a header.)
message BackupMetadataSave {
repeated BackupElementSelection elements = 2;
int64 exported_at_ns = 3;
optional int64 start_ns = 4;
optional int64 end_ns = 5;
}

// Elements selected for backup
enum BackupElementSelection {
BACKUP_ELEMENT_SELECTION_MESSAGES = 0;
BACKUP_ELEMENT_SELECTION_CONSENT = 1;
Expand Down
3 changes: 3 additions & 0 deletions proto/device_sync/group_backup.proto
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
syntax = "proto3";
package xmtp.device_sync.group_backup;

// Proto representation of a stored group
message GroupSave {
bytes id = 1;
int64 created_at_ns = 2;
Expand All @@ -14,12 +15,14 @@ message GroupSave {
optional int64 last_message_ns = 10;
}

// Group membership state
enum GroupMembershipStateSave {
GROUP_MEMBERSHIP_STATE_SAVE_ALLOWED = 0;
GROUP_MEMBERSHIP_STATE_SAVE_REJECTED = 1;
GROUP_MEMBERSHIP_STATE_SAVE_PENDING = 2;
}

// Conversation type
enum ConversationTypeSave {
CONVERSATION_TYPE_SAVE_GROUP = 0;
CONVERSATION_TYPE_SAVE_DM = 1;
Expand Down
4 changes: 4 additions & 0 deletions proto/device_sync/message_backup.proto
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
syntax = "proto3";
package xmtp.device_sync.message_backup;

// Proto representation of a stored group message
message GroupMessageSave {
bytes id = 1;
bytes group_id = 2;
Expand All @@ -17,17 +18,20 @@ message GroupMessageSave {
optional bytes reference_id = 13;
}

// Group message kind
enum GroupMessageKindSave {
GROUP_MESSAGE_KIND_SAVE_APPLICATION = 0;
GROUP_MESSAGE_KIND_SAVE_MEMBERSHIP_CHANGE = 1;
}

// Group message delivery status
enum DeliveryStatusSave {
DELIVERY_STATUS_SAVE_UNPUBLISHED = 0;
DELIVERY_STATUS_SAVE_PUBLISHED = 1;
DELIVERY_STATUS_SAVE_FAILED = 2;
}

// Group message content type
enum ContentTypeSave {
CONTENT_TYPE_SAVE_UNKNOWN = 0;
CONTENT_TYPE_SAVE_TEXT = 1;
Expand Down

0 comments on commit 6060230

Please sign in to comment.