Add missing messages fetch & display name update

pull/57/head
Niels Andriesse 6 years ago
parent 78ce3e23c2
commit 0f5ac64363

@ -83,9 +83,12 @@ final class NewPublicChatVC : OWSViewController {
return showError(title: NSLocalizedString("Invalid URL", comment: ""), message: NSLocalizedString("Please check the URL you entered and try again.", comment: ""))
}
updateAddButton(isConnecting: true)
// TODO: Upon adding we should fetch previous messages
LokiPublicChatManager.shared.addChat(server: url.absoluteString, channel: 1)
let urlAsString = url.absoluteString
let displayName = OWSProfileManager.shared().localProfileName()
LokiPublicChatManager.shared.addChat(server: urlAsString, channel: 1)
.done(on: .main) { [weak self] _ in
let _ = LokiGroupChatAPI.getMessages(for: 1, on: urlAsString)
let _ = LokiGroupChatAPI.setDisplayName(to: displayName, on: urlAsString)
self?.presentingViewController!.dismiss(animated: true, completion: nil)
}
.catch(on: .main) { [weak self] _ in

Loading…
Cancel
Save