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