Skip to content

Commit

Permalink
Improve sealed sender icon display logic
Browse files Browse the repository at this point in the history
  • Loading branch information
scottnonnenberg-signal committed Nov 29, 2018
1 parent 313d083 commit 822ea9a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
10 changes: 7 additions & 3 deletions libtextsecure/message_receiver.js
Original file line number Diff line number Diff line change
Expand Up @@ -466,7 +466,7 @@ MessageReceiver.prototype.extend({
window.log.info('getAllFromCache');
const count = await textsecure.storage.unprocessed.getCount();

if (count > 250) {
if (count > 1500) {
await textsecure.storage.unprocessed.removeAll();
window.log.warn(
`There were ${count} messages in cache. Deleted all instead of reprocessing`
Expand Down Expand Up @@ -719,12 +719,14 @@ MessageReceiver.prototype.extend({
// Here we take this sender information and attach it back to the envelope
// to make the rest of the app work properly.

const originalSource = envelope.source;

// eslint-disable-next-line no-param-reassign
envelope.source = sender.getName();
// eslint-disable-next-line no-param-reassign
envelope.sourceDevice = sender.getDeviceId();
// eslint-disable-next-line no-param-reassign
envelope.unidentifiedDeliveryReceived = true;
envelope.unidentifiedDeliveryReceived = !originalSource;

// Return just the content because that matches the signature of the other
// decrypt methods used above.
Expand All @@ -734,12 +736,14 @@ MessageReceiver.prototype.extend({
const { sender } = error || {};

if (sender) {
const originalSource = envelope.source;

// eslint-disable-next-line no-param-reassign
envelope.source = sender.getName();
// eslint-disable-next-line no-param-reassign
envelope.sourceDevice = sender.getDeviceId();
// eslint-disable-next-line no-param-reassign
envelope.unidentifiedDeliveryReceived = true;
envelope.unidentifiedDeliveryReceived = !originalSource;

throw error;
}
Expand Down
4 changes: 2 additions & 2 deletions ts/util/lint/exceptions.json
Original file line number Diff line number Diff line change
Expand Up @@ -2352,15 +2352,15 @@
"rule": "jQuery-wrap(",
"path": "libtextsecure/message_receiver.js",
"line": " const buffer = dcodeIO.ByteBuffer.wrap(ciphertext);",
"lineNumber": 781,
"lineNumber": 785,
"reasonCategory": "falseMatch",
"updated": "2018-09-19T18:13:29.628Z"
},
{
"rule": "jQuery-wrap(",
"path": "libtextsecure/message_receiver.js",
"line": " const buffer = dcodeIO.ByteBuffer.wrap(ciphertext);",
"lineNumber": 806,
"lineNumber": 810,
"reasonCategory": "falseMatch",
"updated": "2018-09-19T18:13:29.628Z"
},
Expand Down

0 comments on commit 822ea9a

Please sign in to comment.