@@ -61,30 +61,20 @@ open class ChatMessageReplyCell: ChatMessageAIStreamTextCell {
6161 super. setModel ( model, isSend)
6262
6363 let replyImageView = isSend ? replyImageViewRight : replyImageViewLeft
64- if model. message? . messageType == . MESSAGE_TYPE_IMAGE,
65- let imageObject = model. message? . attachment as? V2NIMMessageImageAttachment {
66- var urlString = " "
67- if let path = imageObject. path, FileManager . default. fileExists ( atPath: path) {
68- urlString = path
69- } else if let url = imageObject. url {
70- if imageObject. ext? . lowercased ( ) != " .gif " {
71- urlString = V2NIMStorageUtil . imageThumbUrl ( url, thumbSize: 350 )
72- }
73- urlString = url
74- }
75-
64+ if let m = model as? MessageImageModel ,
65+ let urlString = m. urlString {
7666 var options : SDWebImageOptions = [ . retryFailed]
77- if imageObject. ext? . lowercased ( ) != " .gif " {
67+ if let imageObject = model. message? . attachment as? V2NIMMessageImageAttachment ,
68+ imageObject. ext? . lowercased ( ) != " .gif " {
7869 options = [ . retryFailed, . progressiveLoad]
7970 }
8071
81- let context : [ SDWebImageContextOption : Any ] = [ . imageThumbnailPixelSize: CGSize ( width: 1000 , height: 1000 ) ]
8272 if urlString. hasPrefix ( " http " ) {
8373 let url = URL ( string: urlString)
84- replyImageView. sd_setImage ( with: url, placeholderImage: nil , options: options, context: context )
74+ replyImageView. sd_setImage ( with: url, placeholderImage: nil , options: options, context: nil )
8575 } else {
8676 let url = URL ( fileURLWithPath: urlString)
87- replyImageView. sd_setImage ( with: url, placeholderImage: nil , options: options, context: context )
77+ replyImageView. sd_setImage ( with: url, placeholderImage: nil , options: options, context: nil )
8878 }
8979 } else {
9080 replyImageView. image = nil
0 commit comments