Commit 4debd6cf by pidan

修复在聊天室内收到图片不显示的问题

parent a5703a44
...@@ -37,8 +37,12 @@ ...@@ -37,8 +37,12 @@
- (void)setMsgModel:(FUSChatDetailMessageModel *)msgModel - (void)setMsgModel:(FUSChatDetailMessageModel *)msgModel
{ {
_msgModel = msgModel;
if ([msgModel isKindOfClass:[NSDictionary class]]) {
msgModel = [FUSChatDetailMessageModel fus_modelWithDict:(NSDictionary *)msgModel];
}
_msgModel = msgModel;
// 系统消息的Frame(默认为zero) // 系统消息的Frame(默认为zero)
_systemNoticeBgFrame = CGRectZero; _systemNoticeBgFrame = CGRectZero;
...@@ -58,7 +62,7 @@ ...@@ -58,7 +62,7 @@
_msgPaidInfoFrame = CGRectZero; _msgPaidInfoFrame = CGRectZero;
//时间的Frame //时间的Frame
if (msgModel.messageNeedShowTime == YES) { if (_msgModel.messageNeedShowTime == YES) {
CGFloat timeFrameW = [msgModel.messageTime sizeWithFont:timeFont maxWidth:timeW].width + All_MSG_PADDING * 1.5; CGFloat timeFrameW = [msgModel.messageTime sizeWithFont:timeFont maxWidth:timeW].width + All_MSG_PADDING * 1.5;
CGFloat timeFrameH = timeH; CGFloat timeFrameH = timeH;
CGFloat timeFrameX = UIView.fus_screenW/2 - timeFrameW/2; CGFloat timeFrameX = UIView.fus_screenW/2 - timeFrameW/2;
...@@ -69,7 +73,7 @@ ...@@ -69,7 +73,7 @@
} }
//系统消息是没有头像的 //系统消息是没有头像的
if (msgModel.messageContentType == FUSMsgContentTypeSystemNotice) { if (_msgModel.messageContentType == FUSMsgContentTypeSystemNotice) {
// 计算宽高 // 计算宽高
NSMutableAttributedString *muAttrString = [FUSIMChatCellHelper getColorAttributedStringFromString:msgModel.systemNoticeWords]; NSMutableAttributedString *muAttrString = [FUSIMChatCellHelper getColorAttributedStringFromString:msgModel.systemNoticeWords];
CGSize bgSysNoticeSize = [YYTextLayout layoutWithContainerSize:CGSizeMake(systemNoticeW, MAXFLOAT) text:muAttrString].textBoundingSize; CGSize bgSysNoticeSize = [YYTextLayout layoutWithContainerSize:CGSizeMake(systemNoticeW, MAXFLOAT) text:muAttrString].textBoundingSize;
......
...@@ -1298,7 +1298,7 @@ typedef NS_ENUM(NSInteger, FUSIMChatMessageType) { ...@@ -1298,7 +1298,7 @@ typedef NS_ENUM(NSInteger, FUSIMChatMessageType) {
msgModel.thumb = [UIImage imageWithContentsOfFile:body.thumbnailLocalPath]; msgModel.thumb = [UIImage imageWithContentsOfFile:body.thumbnailLocalPath];
// 针对那些重启之后缩略图依然下载失败的情况 // 针对那些重启之后缩略图依然下载失败的情况
if ((body.thumbnailDownloadStatus == EMDownloadStatusPending || body.thumbnailDownloadStatus == EMDownloadStatusFailed)&& !msgModel.thumb) { if (!msgModel.thumb && !msgModel.image) {
[[EMClient sharedClient].chatManager downloadMessageThumbnail:message progress:nil completion:^(EMMessage *message, EMError *error) { [[EMClient sharedClient].chatManager downloadMessageThumbnail:message progress:nil completion:^(EMMessage *message, EMError *error) {
if (!error) { if (!error) {
[self fus_didReceiveFileMessageWithTalkObj:self.currentTalkObj messageObj:message]; [self fus_didReceiveFileMessageWithTalkObj:self.currentTalkObj messageObj:message];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment