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:
parent
84237cae6f
commit
11b822eaf3
2 changed files with 10 additions and 2 deletions
|
@ -180,7 +180,11 @@
|
||||||
},
|
},
|
||||||
|
|
||||||
getTitle: function() {
|
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() {
|
getNumber: function() {
|
||||||
|
|
|
@ -122,6 +122,10 @@
|
||||||
conversation.fetch().always(function() {
|
conversation.fetch().always(function() {
|
||||||
if (pushMessageContent.group) {
|
if (pushMessageContent.group) {
|
||||||
var group_update = {};
|
var group_update = {};
|
||||||
|
attributes = {
|
||||||
|
type: 'group',
|
||||||
|
groupId: pushMessageContent.group.id,
|
||||||
|
};
|
||||||
if (pushMessageContent.group.type === textsecure.protobuf.PushMessageContent.GroupContext.Type.UPDATE) {
|
if (pushMessageContent.group.type === textsecure.protobuf.PushMessageContent.GroupContext.Type.UPDATE) {
|
||||||
attributes = {
|
attributes = {
|
||||||
type : 'group',
|
type : 'group',
|
||||||
|
@ -138,7 +142,7 @@
|
||||||
}
|
}
|
||||||
else if (pushMessageContent.group.type === textsecure.protobuf.PushMessageContent.GroupContext.Type.QUIT) {
|
else if (pushMessageContent.group.type === textsecure.protobuf.PushMessageContent.GroupContext.Type.QUIT) {
|
||||||
group_update = { left: source };
|
group_update = { left: source };
|
||||||
attributes = { members: _.without(conversation.get('members'), source) };
|
attributes.members = _.without(conversation.get('members'), source);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_.keys(group_update).length > 0) {
|
if (_.keys(group_update).length > 0) {
|
||||||
|
|
Loading…
Reference in a new issue