Fix crash

pull/63/head
Niels Andriesse 6 years ago
parent e7c4aef09b
commit 29b0ea9b04

@ -155,10 +155,12 @@ public final class LokiPublicChatPoller : NSObject {
guard let messageID = message.uniqueId else { return print("[Loki] Failed to save public chat message.") }
storage.setIDForMessageWithServerID(UInt(messageServerID), to: messageID, in: transaction)
}
DispatchQueue.main.async {
if let linkPreviewURL = OWSLinkPreview.previewUrl(forMessageBodyText: message.body, selectedRange: nil) {
message.generateLinkPreviewIfNeeded(fromURL: linkPreviewURL)
}
}
}
// Poll
let _ = LokiPublicChatAPI.getMessages(for: publicChat.channel, on: publicChat.server).done(on: DispatchQueue.global()) { messages in
func proceed() {

Loading…
Cancel
Save