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))))
|
promise(.success(.databaseAction(.storeMessageFailed(reason: L10n.Global.Error.genericDbError))))
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
guard message.contentType != .typing else {
|
guard message.contentType != .typing, message.body != nil else {
|
||||||
promise(.success(.empty))
|
promise(.success(.empty))
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
|
@ -109,11 +109,13 @@ final class XMPPService: ObservableObject {
|
||||||
completion(false)
|
completion(false)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
let message = Martin.Message()
|
guard let chat = client.module(MessageModule.self).chatManager.chat(for: client.context, with: BareJID(to)) else {
|
||||||
message.to = JID(to)
|
completion(false)
|
||||||
message.body = message.body
|
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 {
|
switch res {
|
||||||
case .success:
|
case .success:
|
||||||
completion(true)
|
completion(true)
|
||||||
|
|
Loading…
Reference in a new issue