Merge branch 'charlesmchen/linkPreviewsVsIncomingAttachments'

This commit is contained in:
Matthew Chen 2019-01-23 10:00:40 -05:00
commit 1ab5a7ed6b

View file

@ -116,6 +116,10 @@ public class OWSLinkPreview: MTLModel {
guard let previewProto = dataMessage.preview.first else {
throw LinkPreviewError.noPreview
}
guard dataMessage.attachments.count < 1 else {
Logger.error("Discarding link preview; message has attachments.")
throw LinkPreviewError.invalidInput
}
let urlString = previewProto.url
guard URL(string: urlString) != nil else {