Support for group sync

Protocol and handling is all analogous to contact sync: Multiple
GroupDetails structs are packed into a single attachment blob and parsed
on our end. We don't display the synced groups in the conversation list
until a new message is sent to one of them.

// FREEBIE
This commit is contained in:
lilia 2015-06-22 14:45:42 -07:00
parent 3dd8056487
commit 5925c2fe84
9 changed files with 246 additions and 69 deletions

View file

@ -48,21 +48,22 @@ message SyncMessage {
optional AttachmentPointer blob = 1;
}
message Group {
optional GroupContext group = 1;
message Groups {
optional AttachmentPointer blob = 1;
}
message Request {
enum Type {
UNKNOWN = 0;
CONTACTS = 1;
GROUPS = 2;
}
optional Type type = 1;
}
optional Sent sent = 1;
optional Contacts contacts = 2;
optional Group group = 3;
optional Groups groups = 3;
optional Request request = 4;
}
@ -86,12 +87,19 @@ message GroupContext {
optional AttachmentPointer avatar = 5;
}
message ContactDetails {
message Avatar {
optional string contentType = 1;
optional uint64 length = 2;
}
message Avatar {
optional string contentType = 1;
optional uint32 length = 2;
}
message GroupDetails {
optional bytes id = 1;
optional string name = 2;
repeated string members = 3;
optional Avatar avatar = 4;
}
message ContactDetails {
optional string number = 1;
optional string name = 2;
optional Avatar avatar = 3;