Fix “can’t paste GIF from iMessage” issue.

// FREEBIE
This commit is contained in:
Matthew Chen 2017-06-01 12:20:56 -04:00
parent 5897ca1b6a
commit 5dcdace26f
1 changed files with 6 additions and 0 deletions

View File

@ -322,6 +322,12 @@ class SignalAttachment: NSObject {
return false
}
let pasteboardUTISet = Set<String>(pasteboardUTITypes[0])
let mediaUTISet = inputImageUTISet.union(animatedImageUTISet.union(videoUTISet.union(audioUTISet)))
if pasteboardUTISet.intersection(mediaUTISet).count > 0 {
return false
}
return pasteboardUTISet.intersection(textUTISet).count > 0
}