pull/1127/head
Mikunj 5 years ago
parent 13832f83bb
commit 873dadef48

@ -1252,9 +1252,7 @@ MessageReceiver.prototype.extend({
if (!friendRequest && this.isMessageEmpty(message)) { if (!friendRequest && this.isMessageEmpty(message)) {
window.log.warn( window.log.warn(
`Message ${this.getEnvelopeId( `Message ${this.getEnvelopeId(envelope)} ignored; it was empty`
envelope
)} ignored; it was empty`
); );
return this.removeFromCache(envelope); return this.removeFromCache(envelope);
} }
@ -1274,8 +1272,26 @@ MessageReceiver.prototype.extend({
}) })
); );
}, },
isMessageEmpty({ body, attachments, group, flags, quote, contact, preview, groupInvitation }) { isMessageEmpty({
return !flags && _.isEmpty(body) && _.isEmpty(attachments) && _.isEmpty(group) && _.isEmpty(quote) && _.isEmpty(contact) && _.isEmpty(preview) && _.isEmpty(groupInvitation) body,
attachments,
group,
flags,
quote,
contact,
preview,
groupInvitation,
}) {
return (
!flags &&
_.isEmpty(body) &&
_.isEmpty(attachments) &&
_.isEmpty(group) &&
_.isEmpty(quote) &&
_.isEmpty(contact) &&
_.isEmpty(preview) &&
_.isEmpty(groupInvitation)
);
}, },
handleLegacyMessage(envelope) { handleLegacyMessage(envelope) {
return this.decrypt(envelope, envelope.legacyMessage).then(plaintext => { return this.decrypt(envelope, envelope.legacyMessage).then(plaintext => {

Loading…
Cancel
Save