Expire timer updates: don't send if updated via remote message (#2473)

A recent change removed the type property to make markRead() behave
properly, but that broke our check 'should we send an update?' logic. So
instead of using `isIncoming()` we now use the thing we previously used
to determine whether a message was incoming: `receivedAt`.
pull/1/head
Scott Nonnenberg 7 years ago committed by GitHub
parent 2576c3fabe
commit b113cd0ad2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -925,11 +925,11 @@
wrapDeferred(message.save()),
wrapDeferred(this.save({ expireTimer })),
]).then(() => {
if (message.isIncoming()) {
// if change was made remotely, don't send it to the number/group
if (receivedAt) {
return message;
}
// change was made locally, send it to the number/group
let sendFunc;
if (this.get('type') === 'private') {
sendFunc = textsecure.messaging.sendExpirationTimerUpdateToNumber;

Loading…
Cancel
Save