Throttle typing events, fix profile logging, fix group typing
This commit is contained in:
parent
a8fbd085e2
commit
3851bf351f
4 changed files with 14 additions and 11 deletions
|
@ -96,6 +96,7 @@
|
||||||
this.messageCollection.on('change:errors', this.handleMessageError, this);
|
this.messageCollection.on('change:errors', this.handleMessageError, this);
|
||||||
this.messageCollection.on('send-error', this.onMessageError, this);
|
this.messageCollection.on('send-error', this.onMessageError, this);
|
||||||
|
|
||||||
|
this.throttledBumpTyping = _.throttle(this.bumpTyping, 300);
|
||||||
const debouncedUpdateLastMessage = _.debounce(
|
const debouncedUpdateLastMessage = _.debounce(
|
||||||
this.updateLastMessage.bind(this),
|
this.updateLastMessage.bind(this),
|
||||||
200
|
200
|
||||||
|
@ -1502,11 +1503,13 @@
|
||||||
// This might throw if we can't pull the avatar down, so we do it last
|
// This might throw if we can't pull the avatar down, so we do it last
|
||||||
await c.setProfileAvatar(profile.avatar);
|
await c.setProfileAvatar(profile.avatar);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
window.log.error(
|
if (error.code !== 403 && error.code !== 404) {
|
||||||
'getProfile error:',
|
window.log.error(
|
||||||
id,
|
'getProfile error:',
|
||||||
error && error.stack ? error.stack : error
|
id,
|
||||||
);
|
error && error.stack ? error.stack : error
|
||||||
|
);
|
||||||
|
}
|
||||||
} finally {
|
} finally {
|
||||||
if (c.hasChanged()) {
|
if (c.hasChanged()) {
|
||||||
await window.Signal.Data.updateConversation(id, c.attributes, {
|
await window.Signal.Data.updateConversation(id, c.attributes, {
|
||||||
|
|
|
@ -1592,7 +1592,7 @@
|
||||||
maybeBumpTyping() {
|
maybeBumpTyping() {
|
||||||
const messageText = this.$messageField.val();
|
const messageText = this.$messageField.val();
|
||||||
if (messageText.length) {
|
if (messageText.length) {
|
||||||
this.model.bumpTyping();
|
this.model.throttledBumpTyping();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
@ -90,10 +90,10 @@
|
||||||
|
|
||||||
return verifyMAC(ivAndCiphertext, macKey, mac, 32)
|
return verifyMAC(ivAndCiphertext, macKey, mac, 32)
|
||||||
.then(() => {
|
.then(() => {
|
||||||
if (theirDigest !== null) {
|
if (!theirDigest) {
|
||||||
return verifyDigest(encryptedBin, theirDigest);
|
throw new Error('Failure: Ask sender to update Signal and resend.');
|
||||||
}
|
}
|
||||||
return null;
|
return verifyDigest(encryptedBin, theirDigest);
|
||||||
})
|
})
|
||||||
.then(() => decrypt(aesKey, ciphertext, iv));
|
.then(() => decrypt(aesKey, ciphertext, iv));
|
||||||
},
|
},
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* global textsecure, WebAPI, libsignal, OutgoingMessage, window */
|
/* global _, textsecure, WebAPI, libsignal, OutgoingMessage, window */
|
||||||
|
|
||||||
/* eslint-disable more/no-then, no-bitwise */
|
/* eslint-disable more/no-then, no-bitwise */
|
||||||
|
|
||||||
|
@ -533,7 +533,7 @@ MessageSender.prototype = {
|
||||||
}
|
}
|
||||||
|
|
||||||
const recipients = groupId
|
const recipients = groupId
|
||||||
? await textsecure.storage.groups.getNumbers(groupId)
|
? _.without(await textsecure.storage.groups.getNumbers(groupId), myNumber)
|
||||||
: [recipientId];
|
: [recipientId];
|
||||||
const groupIdBuffer = groupId
|
const groupIdBuffer = groupId
|
||||||
? window.Signal.Crypto.fromEncodedBinaryToArrayBuffer(groupId)
|
? window.Signal.Crypto.fromEncodedBinaryToArrayBuffer(groupId)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue