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

@ -1044,7 +1044,8 @@
this.trigger('pending'); this.trigger('pending');
// FIXME audric add back profileKey // FIXME audric add back profileKey
await this.markMessageSyncOnly(); await this.markMessageSyncOnly();
return libsession.getMessageQueue().sendSyncMessage(chatMessage); const syncMessage = libsession.Utils.SyncMessageUtils.from(chatMessage);
return libsession.getMessageQueue().sendSyncMessage(syncMessage);
} }
if (conversation.isPrivate()) { if (conversation.isPrivate()) {
@ -1058,7 +1059,7 @@
} }
this.trigger('pending'); 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 // Not sure there is the concept of retrySend for those
const closedGroupChatMessage = new libsession.Messages.Outgoing.ClosedGroupChatMessage( const closedGroupChatMessage = new libsession.Messages.Outgoing.ClosedGroupChatMessage(
{ {
@ -1123,7 +1124,8 @@
if (number === this.OUR_NUMBER) { if (number === this.OUR_NUMBER) {
this.trigger('pending'); this.trigger('pending');
await this.markMessageSyncOnly(); 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 conversation = this.getConversation();
const recipientPubKey = new libsession.Types.PubKey(number); const recipientPubKey = new libsession.Types.PubKey(number);

Loading…
Cancel
Save