From 29192edcb8adab4b459b3ee607e2e497e676f6ac Mon Sep 17 00:00:00 2001 From: Matt Corallo Date: Wed, 25 Feb 2015 17:33:45 -0800 Subject: [PATCH] Ignore END_SESSION on messages with a sync context --- js/libtextsecure.js | 3 ++- libtextsecure/axolotl_wrapper.js | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/js/libtextsecure.js b/js/libtextsecure.js index 8b2d9c86..9fe4b6b4 100644 --- a/js/libtextsecure.js +++ b/js/libtextsecure.js @@ -139,7 +139,8 @@ var finalMessage = textsecure.protobuf.PushMessageContent.decode(res[0]); if ((finalMessage.flags & textsecure.protobuf.PushMessageContent.Flags.END_SESSION) - == textsecure.protobuf.PushMessageContent.Flags.END_SESSION) + == textsecure.protobuf.PushMessageContent.Flags.END_SESSION && + finalMessage.sync !== null) res[1](); return finalMessage; diff --git a/libtextsecure/axolotl_wrapper.js b/libtextsecure/axolotl_wrapper.js index 379fcc96..a9f5959d 100644 --- a/libtextsecure/axolotl_wrapper.js +++ b/libtextsecure/axolotl_wrapper.js @@ -62,7 +62,8 @@ var finalMessage = textsecure.protobuf.PushMessageContent.decode(res[0]); if ((finalMessage.flags & textsecure.protobuf.PushMessageContent.Flags.END_SESSION) - == textsecure.protobuf.PushMessageContent.Flags.END_SESSION) + == textsecure.protobuf.PushMessageContent.Flags.END_SESSION && + finalMessage.sync !== null) res[1](); return finalMessage;