remove getSendOptions as this is now fetch on encrypt() of a message

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

@ -699,8 +699,7 @@
this.ourNumber, this.ourNumber,
{ syncMessage: true } { syncMessage: true }
); );
const contactSendOptions = this.getSendOptions(); const options = Object.assign({}, sendOptions, {});
const options = Object.assign({}, sendOptions, contactSendOptions);
const promise = textsecure.storage.protocol.loadIdentityKey(number); const promise = textsecure.storage.protocol.loadIdentityKey(number);
return promise.then(key => return promise.then(key =>
@ -1309,8 +1308,8 @@
); );
return message.sendSyncMessageOnly(dataMessage); return message.sendSyncMessageOnly(dataMessage);
} }
const options = {};
const options = this.getSendOptions();
options.messageType = message.get('type'); options.messageType = message.get('type');
options.isPublic = this.isPublic(); options.isPublic = this.isPublic();
if (options.isPublic) { if (options.isPublic) {
@ -1334,12 +1333,11 @@
now, now,
expireTimer, expireTimer,
profileKey, profileKey,
options {}
); );
case Message.GROUP: { case Message.GROUP: {
let dest = destination; let dest = destination;
let numbers = groupNumbers; let numbers = groupNumbers;
if (this.isMediumGroup()) { if (this.isMediumGroup()) {
dest = this.id; dest = this.id;
numbers = [destination]; numbers = [destination];
@ -1356,7 +1354,7 @@
now, now,
expireTimer, expireTimer,
profileKey, profileKey,
options {}
); );
} }
default: default:
@ -1675,7 +1673,6 @@
if (this.get('profileSharing')) { if (this.get('profileSharing')) {
profileKey = storage.get('profileKey'); profileKey = storage.get('profileKey');
} }
const sendOptions = this.getSendOptions();
let promise; let promise;
if (this.isMe()) { if (this.isMe()) {
@ -1701,7 +1698,7 @@
expireTimer, expireTimer,
message.get('sent_at'), message.get('sent_at'),
profileKey, profileKey,
sendOptions {}
); );
} else { } else {
promise = textsecure.messaging.sendExpirationTimerUpdateToGroup( promise = textsecure.messaging.sendExpirationTimerUpdateToGroup(
@ -1710,7 +1707,7 @@
expireTimer, expireTimer,
message.get('sent_at'), message.get('sent_at'),
profileKey, profileKey,
sendOptions {}
); );
} }
@ -1805,13 +1802,12 @@
type: 'outgoing', type: 'outgoing',
endSessionType: 'ongoing', endSessionType: 'ongoing',
}); });
const options = this.getSendOptions();
await message.send( await message.send(
this.wrapSend( this.wrapSend(
textsecure.messaging.resetSession( textsecure.messaging.resetSession(
this.id, this.id,
message.get('sent_at'), message.get('sent_at'),
options {}
) )
) )
); );
@ -1854,7 +1850,6 @@
); );
message.set({ id: messageId }); message.set({ id: messageId });
const options = this.getSendOptions();
if (groupUpdate.is_medium_group) { if (groupUpdate.is_medium_group) {
// Constructing a "create group" message // Constructing a "create group" message
@ -1890,7 +1885,7 @@
this.get('members'), this.get('members'),
this.get('groupAdmins'), this.get('groupAdmins'),
groupUpdate.recipients, groupUpdate.recipients,
options {}
) )
) )
); );
@ -1898,7 +1893,6 @@
sendGroupInfo(recipients) { sendGroupInfo(recipients) {
if (this.isClosedGroup()) { if (this.isClosedGroup()) {
const options = this.getSendOptions();
textsecure.messaging.sendGroupUpdate( textsecure.messaging.sendGroupUpdate(
this.id, this.id,
this.get('name'), this.get('name'),
@ -1906,7 +1900,7 @@
this.get('members'), this.get('members'),
this.get('groupAdmins'), this.get('groupAdmins'),
recipients, recipients,
options {}
); );
} }
}, },
@ -1943,10 +1937,9 @@
}); });
message.set({ id }); message.set({ id });
const options = this.getSendOptions();
message.send( message.send(
this.wrapSend( this.wrapSend(
textsecure.messaging.leaveGroup(this.id, groupNumbers, options) textsecure.messaging.leaveGroup(this.id, groupNumbers, {})
) )
); );
@ -2047,7 +2040,6 @@
); );
if (storage.get('read-receipt-setting')) { if (storage.get('read-receipt-setting')) {
const convoSendOptions = this.getSendOptions();
await Promise.all( await Promise.all(
_.map(_.groupBy(read, 'sender'), async (receipts, sender) => { _.map(_.groupBy(read, 'sender'), async (receipts, sender) => {
@ -2056,7 +2048,7 @@
textsecure.messaging.sendReadReceipts( textsecure.messaging.sendReadReceipts(
sender, sender,
timestamps, timestamps,
convoSendOptions {}
) )
); );
}) })

Loading…
Cancel
Save