Bail early when processing timer updates

Also let expireTimer default to 0.
This commit is contained in:
lilia 2016-09-26 23:44:46 -07:00
parent 8f76548a53
commit 448835e4d5
2 changed files with 14 additions and 6 deletions

View file

@ -38458,11 +38458,15 @@ MessageReceiver.prototype.extend({
// Note that messages may (generally) only perform one action and we ignore remaining fields
// after the first action.
if (decrypted.flags == null)
if (decrypted.flags == null) {
decrypted.flags = 0;
}
if (decrypted.expireTimer == null) {
decrypted.expireTimer = 0;
}
if ((decrypted.flags & textsecure.protobuf.DataMessage.Flags.END_SESSION)
== textsecure.protobuf.DataMessage.Flags.END_SESSION) {
if (decrypted.flags & ( textsecure.protobuf.DataMessage.Flags.END_SESSION
| textsecure.protobuf.DataMessage.Flags.EXPIRATION_TIMER_UPDATE )) {
decrypted.body = null;
decrypted.attachments = [];
decrypted.group = null;

View file

@ -387,11 +387,15 @@ MessageReceiver.prototype.extend({
// Note that messages may (generally) only perform one action and we ignore remaining fields
// after the first action.
if (decrypted.flags == null)
if (decrypted.flags == null) {
decrypted.flags = 0;
}
if (decrypted.expireTimer == null) {
decrypted.expireTimer = 0;
}
if ((decrypted.flags & textsecure.protobuf.DataMessage.Flags.END_SESSION)
== textsecure.protobuf.DataMessage.Flags.END_SESSION) {
if (decrypted.flags & ( textsecure.protobuf.DataMessage.Flags.END_SESSION
| textsecure.protobuf.DataMessage.Flags.EXPIRATION_TIMER_UPDATE )) {
decrypted.body = null;
decrypted.attachments = [];
decrypted.group = null;