Merge branch 'master' into development
This commit is contained in:
commit
ed4ef181af
4 changed files with 53 additions and 19 deletions
|
@ -438,17 +438,24 @@
|
|||
color: details.color,
|
||||
active_at: activeAt,
|
||||
})).then(function() {
|
||||
// this needs to be inline to get access to conversation model
|
||||
if (typeof details.expireTimer !== 'undefined') {
|
||||
var source = textsecure.storage.user.getNumber();
|
||||
var receivedAt = Date.now();
|
||||
return conversation.updateExpirationTimer(
|
||||
details.expireTimer,
|
||||
source,
|
||||
receivedAt,
|
||||
{fromSync: true}
|
||||
const { expireTimer } = details;
|
||||
const isValidExpireTimer = typeof expireTimer === 'number';
|
||||
if (!isValidExpireTimer) {
|
||||
console.log(
|
||||
'Ignore invalid expire timer.',
|
||||
'Expected numeric `expireTimer`, got:', expireTimer
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
var source = textsecure.storage.user.getNumber();
|
||||
var receivedAt = Date.now();
|
||||
return conversation.updateExpirationTimer(
|
||||
expireTimer,
|
||||
source,
|
||||
receivedAt,
|
||||
{fromSync: true}
|
||||
);
|
||||
});
|
||||
})
|
||||
.then(function() {
|
||||
|
@ -498,16 +505,24 @@
|
|||
}
|
||||
|
||||
return wrapDeferred(conversation.save(updates)).then(function() {
|
||||
if (typeof details.expireTimer !== 'undefined') {
|
||||
var source = textsecure.storage.user.getNumber();
|
||||
var receivedAt = Date.now();
|
||||
return conversation.updateExpirationTimer(
|
||||
details.expireTimer,
|
||||
source,
|
||||
receivedAt,
|
||||
{fromSync: true}
|
||||
const { expireTimer } = details;
|
||||
const isValidExpireTimer = typeof expireTimer === 'number';
|
||||
if (!isValidExpireTimer) {
|
||||
console.log(
|
||||
'Ignore invalid expire timer.',
|
||||
'Expected numeric `expireTimer`, got:', expireTimer
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
var source = textsecure.storage.user.getNumber();
|
||||
var receivedAt = Date.now();
|
||||
return conversation.updateExpirationTimer(
|
||||
expireTimer,
|
||||
source,
|
||||
receivedAt,
|
||||
{fromSync: true}
|
||||
);
|
||||
}).then(ev.confirm);
|
||||
});
|
||||
}
|
||||
|
|
|
@ -675,7 +675,9 @@
|
|||
return collection.fetchConversation(this.id, 1).then(function() {
|
||||
var lastMessage = collection.at(0);
|
||||
if (lastMessage) {
|
||||
if (lastMessage.get('type') === 'verified-change') {
|
||||
var type = lastMessage.get('type');
|
||||
var shouldSkipUpdate = type === 'verified-change' || lastMessage.get('expirationTimerUpdate');
|
||||
if (shouldSkipUpdate) {
|
||||
return;
|
||||
}
|
||||
this.set({
|
||||
|
@ -707,6 +709,8 @@
|
|||
console.log(
|
||||
'Updating expireTimer for conversation',
|
||||
this.idForLogging(),
|
||||
'to',
|
||||
expireTimer,
|
||||
'via',
|
||||
source
|
||||
);
|
||||
|
|
|
@ -457,6 +457,21 @@
|
|||
message.set({expireTimer: dataMessage.expireTimer});
|
||||
}
|
||||
|
||||
// NOTE: Remove once the above uses
|
||||
// `Conversation::updateExpirationTimer`:
|
||||
const { expireTimer } = dataMessage;
|
||||
const shouldLogExpireTimerChange =
|
||||
message.isExpirationTimerUpdate() || expireTimer;
|
||||
if (shouldLogExpireTimerChange) {
|
||||
console.log(
|
||||
'Updating expireTimer for conversation',
|
||||
conversation.idForLogging(),
|
||||
'to',
|
||||
expireTimer,
|
||||
'via `handleDataMessage`'
|
||||
);
|
||||
}
|
||||
|
||||
if (!message.isEndSession() && !message.isGroupUpdate()) {
|
||||
if (dataMessage.expireTimer) {
|
||||
if (dataMessage.expireTimer !== conversation.get('expireTimer')) {
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
"productName": "Signal",
|
||||
"description": "Private messaging from your desktop",
|
||||
"repository": "https://github.com/signalapp/Signal-Desktop.git",
|
||||
"version": "1.5.0-beta.1",
|
||||
"version": "1.5.1",
|
||||
"license": "GPL-3.0",
|
||||
"author": {
|
||||
"name": "Open Whisper Systems",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue