send sync message when a message was sent to someone

pull/1205/head
Audric Ackermann 5 years ago
parent c95bf57b28
commit 63c6f12a66
No known key found for this signature in database
GPG Key ID: 999F434D76324AD4

@ -1279,7 +1279,6 @@
Message: Whisper.Message,
});
message.set({ id });
message.markPendingSend();
this.set({
lastMessage: model.getNotificationText(),
@ -1840,7 +1839,6 @@
const mediumGroupCreateMessage = new libsession.Messages.Outgoing.MediumGroupCreateMessage(
createParams
);
message.markPendingSend();
members.forEach(member => {
const memberPubKey = new libsession.Types.PubKey(member);

@ -1098,7 +1098,6 @@
// Special-case the self-send case - we send only a sync message
if (recipients.length === 1 && recipients[0] === this.OUR_NUMBER) {
this.trigger('pending');
// FIXME audric add back profileKey
return this.sendSyncMessageOnly(chatMessage);
}
@ -1106,14 +1105,12 @@
if (conversation.isPrivate()) {
const [number] = recipients;
const recipientPubKey = new libsession.Types.PubKey(number);
this.trigger('pending');
return libsession
.getMessageQueue()
.sendUsingMultiDevice(recipientPubKey, chatMessage);
}
this.trigger('pending');
// TODO should we handle medium groups message here too?
// Not sure there is the concept of retrySend for those
const closedGroupChatMessage = new libsession.Messages.Outgoing.ClosedGroupChatMessage(
@ -1173,8 +1170,6 @@
quote,
});
this.trigger('pending');
// Special-case the self-send case - we send only a sync message
if (number === this.OUR_NUMBER) {
return this.sendSyncMessageOnly(chatMessage);

@ -10,6 +10,7 @@
Whisper,
textsecure,
Signal,
libsession,
_
*/
@ -316,17 +317,21 @@
// Handle the sync logic here
if (!isOurDevice && !msg.get('synced') && !msg.get('sentSync')) {
// FIXME audric send the syncMessage
// const contentDecoded = textsecure.protobuf.Content.decode(m.plainTextBuffer);
// const { dataMessage } = contentDecoded;
const contentDecoded = textsecure.protobuf.Content.decode(
m.plainTextBuffer
);
const { dataMessage } = contentDecoded;
msg.sendSyncMessageOnly(dataMessage);
msg.set({ sentSync: true });
} else if (isOurDevice && msg.get('sentSync')) {
msg.set({ synced: true });
}
const primaryPubKey = await libsession.Protocols.MultiDeviceProtocol.getPrimaryDevice(
m.device
);
msg.set({
sent_to: _.union(sentTo, [m.device]),
sent_to: _.union(sentTo, [primaryPubKey.key]),
sent: true,
expirationStartTimestamp: Date.now(),
// unidentifiedDeliveries: result.unidentifiedDeliveries,
@ -355,8 +360,6 @@
await c.getProfiles();
}
}
// if (result.successfulNumbers.length > 0) {
// const sentTo = this.get('sent_to') || [];
const expirationStartTimestamp = Date.now();
if (

Loading…
Cancel
Save