mirror of
https://github.com/signalapp/Signal-Desktop.git
synced 2025-12-24 20:26:24 +00:00
Allow unknown groups
Save groups even if we've never heard of them. Previously we would fail to save due to a missing 'type' attribute.
This commit is contained in:
@@ -180,7 +180,11 @@
|
||||
},
|
||||
|
||||
getTitle: function() {
|
||||
return this.get('name') || this.get('members') || this.id;
|
||||
if (this.isPrivate()) {
|
||||
return this.get('name') || this.id;
|
||||
} else {
|
||||
return this.get('name') || 'Unknown group';
|
||||
}
|
||||
},
|
||||
|
||||
getNumber: function() {
|
||||
|
||||
@@ -122,6 +122,10 @@
|
||||
conversation.fetch().always(function() {
|
||||
if (pushMessageContent.group) {
|
||||
var group_update = {};
|
||||
attributes = {
|
||||
type: 'group',
|
||||
groupId: pushMessageContent.group.id,
|
||||
};
|
||||
if (pushMessageContent.group.type === textsecure.protobuf.PushMessageContent.GroupContext.Type.UPDATE) {
|
||||
attributes = {
|
||||
type : 'group',
|
||||
@@ -138,7 +142,7 @@
|
||||
}
|
||||
else if (pushMessageContent.group.type === textsecure.protobuf.PushMessageContent.GroupContext.Type.QUIT) {
|
||||
group_update = { left: source };
|
||||
attributes = { members: _.without(conversation.get('members'), source) };
|
||||
attributes.members = _.without(conversation.get('members'), source);
|
||||
}
|
||||
|
||||
if (_.keys(group_update).length > 0) {
|
||||
|
||||
Reference in New Issue
Block a user