drop synced message with the autoFR content

pull/1252/head
Audric Ackermann 5 years ago
parent 598d6d1010
commit 17cae3937d
No known key found for this signature in database
GPG Key ID: 999F434D76324AD4

@ -252,9 +252,7 @@ function isMessageEmpty(message: SignalService.DataMessage) {
return (
!flags &&
// FIXME remove this hack to drop auto friend requests messages in a few weeks 15/07/2020
(_.isEmpty(body) ||
body ===
'Please accept to enable messages to be synced across devices') &&
isBodyEmpty(body) &&
_.isEmpty(attachments) &&
_.isEmpty(group) &&
_.isEmpty(quote) &&
@ -265,6 +263,16 @@ function isMessageEmpty(message: SignalService.DataMessage) {
);
}
function isBodyEmpty(body: string) {
return _.isEmpty(body) || isBodyAutoFRContent(body);
}
export function isBodyAutoFRContent(body: string) {
return (
body === 'Please accept to enable messages to be synced across devices'
);
}
export async function handleDataMessage(
envelope: EnvelopePlus,
dataMessage: SignalService.IDataMessage

@ -7,7 +7,11 @@ import ByteBuffer from 'bytebuffer';
import { handleEndSession } from './sessionHandling';
import { handleMediumGroupUpdate } from './mediumGroups';
import { handleMessageEvent, processDecrypted } from './dataMessage';
import {
handleMessageEvent,
isBodyAutoFRContent,
processDecrypted,
} from './dataMessage';
import { updateProfile } from './receiver';
import { handleContacts } from './multidevice';
import { onGroupReceived } from './groups';
@ -84,6 +88,11 @@ async function handleSentMessage(
if (!msg) {
window.log('Inner message is missing in a sync message');
return;
}
if (msg.body && isBodyAutoFRContent(msg.body)) {
window.console.log('dropping autoFR message synced');
await removeFromCache(envelope);
return;
}

Loading…
Cancel
Save