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`.
This commit is contained in:
Scott Nonnenberg 2018-06-21 12:01:56 -07:00 committed by GitHub
parent 2576c3fabe
commit b113cd0ad2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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;