From d52050d43f31c4a9cf4b7f1a2df6f28a1ed6cdfa Mon Sep 17 00:00:00 2001 From: lilia Date: Tue, 4 Oct 2016 17:42:50 +0900 Subject: [PATCH] Fix group timer updates --- js/libtextsecure.js | 9 +++++---- libtextsecure/message_receiver.js | 9 +++++---- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/js/libtextsecure.js b/js/libtextsecure.js index 296c97f5..4501de6e 100644 --- a/js/libtextsecure.js +++ b/js/libtextsecure.js @@ -38467,14 +38467,15 @@ MessageReceiver.prototype.extend({ decrypted.expireTimer = 0; } - if (decrypted.flags & ( textsecure.protobuf.DataMessage.Flags.END_SESSION - | textsecure.protobuf.DataMessage.Flags.EXPIRATION_TIMER_UPDATE )) { + if (decrypted.flags & textsecure.protobuf.DataMessage.Flags.END_SESSION) { decrypted.body = null; decrypted.attachments = []; decrypted.group = null; return Promise.resolve(decrypted); - } - if (decrypted.flags != 0) { + } else if (decrypted.flags & textsecure.protobuf.DataMessage.Flags.EXPIRATION_TIMER_UPDATE ) { + decrypted.body = null; + decrypted.attachments = []; + } else if (decrypted.flags != 0) { throw new Error("Unknown flags in message"); } diff --git a/libtextsecure/message_receiver.js b/libtextsecure/message_receiver.js index 884cc0ac..58307e47 100644 --- a/libtextsecure/message_receiver.js +++ b/libtextsecure/message_receiver.js @@ -396,14 +396,15 @@ MessageReceiver.prototype.extend({ decrypted.expireTimer = 0; } - if (decrypted.flags & ( textsecure.protobuf.DataMessage.Flags.END_SESSION - | textsecure.protobuf.DataMessage.Flags.EXPIRATION_TIMER_UPDATE )) { + if (decrypted.flags & textsecure.protobuf.DataMessage.Flags.END_SESSION) { decrypted.body = null; decrypted.attachments = []; decrypted.group = null; return Promise.resolve(decrypted); - } - if (decrypted.flags != 0) { + } else if (decrypted.flags & textsecure.protobuf.DataMessage.Flags.EXPIRATION_TIMER_UPDATE ) { + decrypted.body = null; + decrypted.attachments = []; + } else if (decrypted.flags != 0) { throw new Error("Unknown flags in message"); }