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,
|
color: details.color,
|
||||||
active_at: activeAt,
|
active_at: activeAt,
|
||||||
})).then(function() {
|
})).then(function() {
|
||||||
// this needs to be inline to get access to conversation model
|
const { expireTimer } = details;
|
||||||
if (typeof details.expireTimer !== 'undefined') {
|
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 source = textsecure.storage.user.getNumber();
|
||||||
var receivedAt = Date.now();
|
var receivedAt = Date.now();
|
||||||
return conversation.updateExpirationTimer(
|
return conversation.updateExpirationTimer(
|
||||||
details.expireTimer,
|
expireTimer,
|
||||||
source,
|
source,
|
||||||
receivedAt,
|
receivedAt,
|
||||||
{fromSync: true}
|
{fromSync: true}
|
||||||
);
|
);
|
||||||
}
|
|
||||||
});
|
});
|
||||||
})
|
})
|
||||||
.then(function() {
|
.then(function() {
|
||||||
|
@ -498,16 +505,24 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
return wrapDeferred(conversation.save(updates)).then(function() {
|
return wrapDeferred(conversation.save(updates)).then(function() {
|
||||||
if (typeof details.expireTimer !== 'undefined') {
|
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 source = textsecure.storage.user.getNumber();
|
||||||
var receivedAt = Date.now();
|
var receivedAt = Date.now();
|
||||||
return conversation.updateExpirationTimer(
|
return conversation.updateExpirationTimer(
|
||||||
details.expireTimer,
|
expireTimer,
|
||||||
source,
|
source,
|
||||||
receivedAt,
|
receivedAt,
|
||||||
{fromSync: true}
|
{fromSync: true}
|
||||||
);
|
);
|
||||||
}
|
|
||||||
}).then(ev.confirm);
|
}).then(ev.confirm);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -675,7 +675,9 @@
|
||||||
return collection.fetchConversation(this.id, 1).then(function() {
|
return collection.fetchConversation(this.id, 1).then(function() {
|
||||||
var lastMessage = collection.at(0);
|
var lastMessage = collection.at(0);
|
||||||
if (lastMessage) {
|
if (lastMessage) {
|
||||||
if (lastMessage.get('type') === 'verified-change') {
|
var type = lastMessage.get('type');
|
||||||
|
var shouldSkipUpdate = type === 'verified-change' || lastMessage.get('expirationTimerUpdate');
|
||||||
|
if (shouldSkipUpdate) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
this.set({
|
this.set({
|
||||||
|
@ -707,6 +709,8 @@
|
||||||
console.log(
|
console.log(
|
||||||
'Updating expireTimer for conversation',
|
'Updating expireTimer for conversation',
|
||||||
this.idForLogging(),
|
this.idForLogging(),
|
||||||
|
'to',
|
||||||
|
expireTimer,
|
||||||
'via',
|
'via',
|
||||||
source
|
source
|
||||||
);
|
);
|
||||||
|
|
|
@ -457,6 +457,21 @@
|
||||||
message.set({expireTimer: dataMessage.expireTimer});
|
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 (!message.isEndSession() && !message.isGroupUpdate()) {
|
||||||
if (dataMessage.expireTimer) {
|
if (dataMessage.expireTimer) {
|
||||||
if (dataMessage.expireTimer !== conversation.get('expireTimer')) {
|
if (dataMessage.expireTimer !== conversation.get('expireTimer')) {
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
"productName": "Signal",
|
"productName": "Signal",
|
||||||
"description": "Private messaging from your desktop",
|
"description": "Private messaging from your desktop",
|
||||||
"repository": "https://github.com/signalapp/Signal-Desktop.git",
|
"repository": "https://github.com/signalapp/Signal-Desktop.git",
|
||||||
"version": "1.5.0-beta.1",
|
"version": "1.5.1",
|
||||||
"license": "GPL-3.0",
|
"license": "GPL-3.0",
|
||||||
"author": {
|
"author": {
|
||||||
"name": "Open Whisper Systems",
|
"name": "Open Whisper Systems",
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue