From ce49d14d857a7093106338140f713cc1dbdf340a Mon Sep 17 00:00:00 2001 From: lilia Date: Mon, 21 Sep 2015 10:43:20 -0700 Subject: [PATCH] Fix leave group bug This one's been around since forever, but only manifests when someone leaves the group and comes back. In that case we fail to reinit their numberRegistrationId object, which causes a npe when we try to send send them group messages. Affected parties must ask their fickle friends to leave/join again. // FREEBIE --- js/libtextsecure.js | 2 +- libtextsecure/storage/groups.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/js/libtextsecure.js b/js/libtextsecure.js index 389dab340..a1cb37b13 100644 --- a/js/libtextsecure.js +++ b/js/libtextsecure.js @@ -38205,7 +38205,7 @@ axolotlInternal.RecipientRecord = function() { var i = group.numbers.indexOf(number); if (i > -1) { - group.numbers.slice(i, 1); + group.numbers.splice(i, 1); delete group.numberRegistrationIds[number]; return textsecure.storage.axolotl.putGroup(groupId, group).then(function() { return group.numbers; diff --git a/libtextsecure/storage/groups.js b/libtextsecure/storage/groups.js index ce1fb862a..90154a0fd 100644 --- a/libtextsecure/storage/groups.js +++ b/libtextsecure/storage/groups.js @@ -86,7 +86,7 @@ var i = group.numbers.indexOf(number); if (i > -1) { - group.numbers.slice(i, 1); + group.numbers.splice(i, 1); delete group.numberRegistrationIds[number]; return textsecure.storage.axolotl.putGroup(groupId, group).then(function() { return group.numbers;