From 9b8b5d1ae6fa5d90e9b6d08aebf5dfc539d9f690 Mon Sep 17 00:00:00 2001 From: Woit Date: Mon, 25 Nov 2024 16:44:05 +0100 Subject: [PATCH] wip --- Monal/another.im/XMPP/MonalXmppWrapper.swift | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/Monal/another.im/XMPP/MonalXmppWrapper.swift b/Monal/another.im/XMPP/MonalXmppWrapper.swift index 915a47e..bd1cf28 100644 --- a/Monal/another.im/XMPP/MonalXmppWrapper.swift +++ b/Monal/another.im/XMPP/MonalXmppWrapper.swift @@ -208,19 +208,20 @@ final class MonalChatWrapper: ObservableObject { } func sendText(_ text: String) { - let msgId = db.addMessageHistory( + let newMessageId = UUID().uuidString + _ = db.addMessageHistory( to: contact.contactJid, forAccount: monalContact.accountID, withMessage: text, actuallyFrom: account.jid, - withId: UUID().uuidString, + withId: newMessageId, encrypted: monalContact.isEncrypted, messageType: kMessageTypeText, mimeType: nil, size: nil ) - xmpp.sendMessage(text, to: monalContact, isEncrypted: monalContact.isEncrypted, isUpload: false, messageId: "\(msgId)") - NotificationCenter.default.post(name: Notification.Name(kMonalSentMessageNotice), object: nil) + print(newMessageId) + xmpp.sendMessage(text, to: monalContact, isEncrypted: monalContact.isEncrypted, isUpload: false, messageId: newMessageId) } }