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) } }