This commit is contained in:
Woit 2024-11-25 16:44:05 +01:00
parent 60e14a5406
commit 9b8b5d1ae6

View file

@ -208,19 +208,20 @@ final class MonalChatWrapper: ObservableObject {
} }
func sendText(_ text: String) { func sendText(_ text: String) {
let msgId = db.addMessageHistory( let newMessageId = UUID().uuidString
_ = db.addMessageHistory(
to: contact.contactJid, to: contact.contactJid,
forAccount: monalContact.accountID, forAccount: monalContact.accountID,
withMessage: text, withMessage: text,
actuallyFrom: account.jid, actuallyFrom: account.jid,
withId: UUID().uuidString, withId: newMessageId,
encrypted: monalContact.isEncrypted, encrypted: monalContact.isEncrypted,
messageType: kMessageTypeText, messageType: kMessageTypeText,
mimeType: nil, mimeType: nil,
size: nil size: nil
) )
xmpp.sendMessage(text, to: monalContact, isEncrypted: monalContact.isEncrypted, isUpload: false, messageId: "\(msgId)") print(newMessageId)
NotificationCenter.default.post(name: Notification.Name(kMonalSentMessageNotice), object: nil) xmpp.sendMessage(text, to: monalContact, isEncrypted: monalContact.isEncrypted, isUpload: false, messageId: newMessageId)
} }
} }