wip
This commit is contained in:
parent
9329cd3ab5
commit
a4ccd9af0d
|
@ -167,7 +167,7 @@ final class DatabaseMiddleware {
|
|||
promise(.success(.databaseAction(.storeMessageFailed(reason: L10n.Global.Error.genericDbError))))
|
||||
return
|
||||
}
|
||||
guard message.contentType != .typing else {
|
||||
guard message.contentType != .typing, message.body != nil else {
|
||||
promise(.success(.empty))
|
||||
return
|
||||
}
|
||||
|
|
|
@ -109,11 +109,13 @@ final class XMPPService: ObservableObject {
|
|||
completion(false)
|
||||
return
|
||||
}
|
||||
let message = Martin.Message()
|
||||
message.to = JID(to)
|
||||
message.body = message.body
|
||||
guard let chat = client.module(MessageModule.self).chatManager.chat(for: client.context, with: BareJID(to)) else {
|
||||
completion(false)
|
||||
return
|
||||
}
|
||||
|
||||
client.context.writer.write(message) { res in
|
||||
let msg = chat.createMessage(text: message.body ?? "??", id: message.id)
|
||||
chat.send(message: msg) { res in
|
||||
switch res {
|
||||
case .success:
|
||||
completion(true)
|
||||
|
|
Loading…
Reference in a new issue