fixing the saved media read receipt

This commit is contained in:
Emily 2022-05-19 16:42:23 +10:00
parent 1ba748d5ad
commit 775ddfda12
2 changed files with 13 additions and 3 deletions

View File

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

View File

@ -6,6 +6,8 @@ import { PubKey } from '../../../types';
import { getMessageQueue } from '../../..';
import { getConversationController } from '../../../conversations';
import { UserUtils } from '../../../utils';
import { SettingsKey } from '../../../../data/settings-key';
import { Storage } from '../../../../util/storage';
interface DataExtractionNotificationMessageParams extends MessageParams {
referencedAttachmentTimestamp: number;
}
@ -49,7 +51,13 @@ export const sendDataExtractionNotification = async (
referencedAttachmentTimestamp: number
) => {
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);
return;
}