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:
parent
3dd8056487
commit
5925c2fe84
9 changed files with 246 additions and 69 deletions
|
@ -290,6 +290,20 @@ window.textsecure.messaging = function() {
|
|||
}
|
||||
}
|
||||
|
||||
self.sendRequestGroupSyncMessage = function() {
|
||||
var myNumber = textsecure.storage.user.getNumber();
|
||||
var myDevice = textsecure.storage.user.getDeviceId();
|
||||
if (myDevice != 1) {
|
||||
var request = new textsecure.protobuf.SyncMessage.Request();
|
||||
request.type = textsecure.protobuf.SyncMessage.Request.Type.GROUPS;
|
||||
var syncMessage = new textsecure.protobuf.SyncMessage();
|
||||
syncMessage.request = request;
|
||||
var contentMessage = new textsecure.protobuf.Content();
|
||||
contentMessage.syncMessage = syncMessage;
|
||||
|
||||
return sendIndividualProto(myNumber, contentMessage, Date.now());
|
||||
}
|
||||
};
|
||||
self.sendRequestContactSyncMessage = function() {
|
||||
var myNumber = textsecure.storage.user.getNumber();
|
||||
var myDevice = textsecure.storage.user.getDeviceId();
|
||||
|
@ -414,7 +428,7 @@ window.textsecure.messaging = function() {
|
|||
}
|
||||
proto.group.members = numbers;
|
||||
|
||||
if (avatar !== undefined) {
|
||||
if (avatar !== undefined && avatar !== null) {
|
||||
return makeAttachmentPointer(avatar).then(function(attachment) {
|
||||
proto.group.avatar = attachment;
|
||||
return sendGroupProto(numbers, proto).then(function() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue