enable back delivery Receipt and read receipt message

pull/1259/head
Audric Ackermann 5 years ago
parent f4af41e07f
commit a17edd0ce9
No known key found for this signature in database
GPG Key ID: 999F434D76324AD4

@ -2099,31 +2099,26 @@
window.log.info(`Sending ${read.length} read receipts`); window.log.info(`Sending ${read.length} read receipts`);
// Because syncReadMessages sends to our other devices, and sendReadReceipts goes // Because syncReadMessages sends to our other devices, and sendReadReceipts goes
// to a contact, we need accessKeys for both. // to a contact, we need accessKeys for both.
const { sendOptions } = ConversationController.prepareForSend( await textsecure.messaging.syncReadMessages(read);
this.ourNumber,
{ syncMessage: true } if (storage.get('read-receipt-setting')) {
); await Promise.all(
await textsecure.messaging.syncReadMessages(read, sendOptions); _.map(_.groupBy(read, 'sender'), async (receipts, sender) => {
const timestamps = _.map(receipts, 'timestamp');
// FIXME AUDRIC const receiptMessage = new libsession.Messages.Outgoing.ReadReceiptMessage(
// if (storage.get('read-receipt-setting')) { {
// await Promise.all( timestamp: Date.now(),
// _.map(_.groupBy(read, 'sender'), async (receipts, sender) => { timestamps,
// const timestamps = _.map(receipts, 'timestamp'); }
// const receiptMessage = new libsession.Messages.Outgoing.ReadReceiptMessage( );
// {
// timestamp: Date.now(), const device = new libsession.Types.PubKey(sender);
// timestamps, await libsession
// } .getMessageQueue()
// ); .sendUsingMultiDevice(device, receiptMessage);
})
// const device = new libsession.Types.PubKey(sender); );
// await libsession }
// .getMessageQueue()
// .sendUsingMultiDevice(device, receiptMessage);
// })
// );
// }
} }
}, },

@ -14,6 +14,8 @@ import { handleUnpairRequest } from './multidevice';
import { downloadAttachment } from './attachments'; import { downloadAttachment } from './attachments';
import _ from 'lodash'; import _ from 'lodash';
import { StringUtils } from '../session/utils'; import { StringUtils } from '../session/utils';
import { DeliveryReceiptMessage } from '../session/messages/outgoing';
import { getMessageQueue } from '../session';
export async function updateProfile( export async function updateProfile(
conversation: any, conversation: any,
@ -528,13 +530,12 @@ function createMessage(
} }
function sendDeliveryReceipt(source: string, timestamp: any) { function sendDeliveryReceipt(source: string, timestamp: any) {
// FIXME audric const receiptMessage = new DeliveryReceiptMessage({
// const receiptMessage = new DeliveryReceiptMessage({ timestamp: Date.now(),
// timestamp: Date.now(), timestamps: [timestamp],
// timestamps: [timestamp], });
// }); const device = new PubKey(source);
// const device = new PubKey(source); void getMessageQueue().sendUsingMultiDevice(device, receiptMessage);
// await getMessageQueue().sendUsingMultiDevice(device, receiptMessage);
} }
interface MessageEvent { interface MessageEvent {

Loading…
Cancel
Save