fixing the saved media read receipt

pull/2334/head
Emily 3 years ago
parent 1ba748d5ad
commit 775ddfda12

@ -636,8 +636,10 @@ export async function handleDataExtractionNotification(
await removeFromCache(envelope); await removeFromCache(envelope);
const convo = getConversationController().get(source); const convo = getConversationController().get(source);
if (!convo || !convo.isPrivate()) { if (!convo || !convo.isPrivate() || !Storage.get(SettingsKey.settingsReadReceipt)) {
window?.log?.info('Got DataNotification for unknown or non private convo'); window?.log?.info(
'Got DataNotification for unknown or non private convo or read receipt not enabled'
);
return; return;
} }

@ -6,6 +6,8 @@ import { PubKey } from '../../../types';
import { getMessageQueue } from '../../..'; import { getMessageQueue } from '../../..';
import { getConversationController } from '../../../conversations'; import { getConversationController } from '../../../conversations';
import { UserUtils } from '../../../utils'; import { UserUtils } from '../../../utils';
import { SettingsKey } from '../../../../data/settings-key';
import { Storage } from '../../../../util/storage';
interface DataExtractionNotificationMessageParams extends MessageParams { interface DataExtractionNotificationMessageParams extends MessageParams {
referencedAttachmentTimestamp: number; referencedAttachmentTimestamp: number;
} }
@ -49,7 +51,13 @@ export const sendDataExtractionNotification = async (
referencedAttachmentTimestamp: number referencedAttachmentTimestamp: number
) => { ) => {
const convo = getConversationController().get(conversationId); const convo = getConversationController().get(conversationId);
if (!convo || !convo.isPrivate() || convo.isMe() || UserUtils.isUsFromCache(attachmentSender)) { if (
!convo ||
!convo.isPrivate() ||
convo.isMe() ||
UserUtils.isUsFromCache(attachmentSender) ||
!Storage.get(SettingsKey.settingsReadReceipt)
) {
window.log.warn('Not sending saving attachment notification for', attachmentSender); window.log.warn('Not sending saving attachment notification for', attachmentSender);
return; return;
} }

Loading…
Cancel
Save