fix calls with NoteToSelf case -> morph the message to a syncMessage

pull/1197/head
Audric Ackermann 5 years ago
parent 67a9fcaa46
commit 1650d758a5
No known key found for this signature in database
GPG Key ID: 999F434D76324AD4

@ -1319,7 +1319,10 @@
// Special-case the self-send case - we send only a sync message
if (this.isMe()) {
await message.markMessageSyncOnly();
return libsession.getMessageQueue().sendSyncMessage(chatMessage);
const syncMessage = libsession.Utils.SyncMessageUtils.from(
chatMessage
);
return libsession.getMessageQueue().sendSyncMessage(syncMessage);
}
const options = {};
@ -1651,9 +1654,10 @@
expireUpdate
);
await message.markMessageSyncOnly();
return libsession
.getMessageQueue()
.sendSyncMessage(expirationTimerMessage);
const syncMessage = libsession.Utils.SyncMessageUtils.from(
expirationTimerMessage
);
return libsession.getMessageQueue().sendSyncMessage(syncMessage);
}
if (this.get('type') === 'private') {

@ -1044,7 +1044,8 @@
this.trigger('pending');
// FIXME audric add back profileKey
await this.markMessageSyncOnly();
return libsession.getMessageQueue().sendSyncMessage(chatMessage);
const syncMessage = libsession.Utils.SyncMessageUtils.from(chatMessage);
return libsession.getMessageQueue().sendSyncMessage(syncMessage);
}
if (conversation.isPrivate()) {
@ -1058,7 +1059,7 @@
}
this.trigger('pending');
// TODO should we handle open groups message here too?
// TODO should we handle open groups message here too? and mediumgroups
// Not sure there is the concept of retrySend for those
const closedGroupChatMessage = new libsession.Messages.Outgoing.ClosedGroupChatMessage(
{
@ -1123,7 +1124,8 @@
if (number === this.OUR_NUMBER) {
this.trigger('pending');
await this.markMessageSyncOnly();
return libsession.getMessageQueue().sendSyncMessage(chatMessage);
const syncMessage = libsession.Utils.SyncMessageUtils.from(chatMessage);
return libsession.getMessageQueue().sendSyncMessage(syncMessage);
}
const conversation = this.getConversation();
const recipientPubKey = new libsession.Types.PubKey(number);

Loading…
Cancel
Save