Commit faf723d68074dd7f5328664435c51456382d6d13
1 parent
1bce1bbf
共享商品消息添加时间
Showing
2 changed files
with
12 additions
and
37 deletions
CNLiveNewIMAManagerKit.podspec
| @@ -8,7 +8,7 @@ | @@ -8,7 +8,7 @@ | ||
| 8 | 8 | ||
| 9 | Pod::Spec.new do |s| | 9 | Pod::Spec.new do |s| |
| 10 | s.name = 'CNLiveNewIMAManagerKit' | 10 | s.name = 'CNLiveNewIMAManagerKit' |
| 11 | - s.version = '0.7.6' | 11 | + s.version = '0.7.7' |
| 12 | s.summary = 'A short description of CNLiveNewIMAManagerKit.' | 12 | s.summary = 'A short description of CNLiveNewIMAManagerKit.' |
| 13 | 13 | ||
| 14 | #s.description = <<-DESC | 14 | #s.description = <<-DESC |
CNLiveNewIMAManagerKit/Classes/TIMModel/Conversation/IMAConversation.m
| @@ -241,6 +241,9 @@ | @@ -241,6 +241,9 @@ | ||
| 241 | continue; | 241 | continue; |
| 242 | } | 242 | } |
| 243 | 243 | ||
| 244 | + /**自定义消息类型*/ | ||
| 245 | + NSInteger customMsgType = 0; | ||
| 246 | + | ||
| 244 | if ([[msg getElem:0] isKindOfClass:[TIMCustomElem class]]) | 247 | if ([[msg getElem:0] isKindOfClass:[TIMCustomElem class]]) |
| 245 | { | 248 | { |
| 246 | //过滤不需要展示的自定义消息 | 249 | //过滤不需要展示的自定义消息 |
| @@ -249,7 +252,8 @@ | @@ -249,7 +252,8 @@ | ||
| 249 | NSDictionary *dic = [NSJSONSerialization JSONObjectWithData:customElem.data | 252 | NSDictionary *dic = [NSJSONSerialization JSONObjectWithData:customElem.data |
| 250 | options:NSJSONReadingMutableContainers | 253 | options:NSJSONReadingMutableContainers |
| 251 | error:&err]; | 254 | error:&err]; |
| 252 | - if ([[dic objectForKey:@"type"] integerValue] == CustomMsgTypeSenderInvitationReceiver) { | 255 | + customMsgType = [[dic objectForKey:@"type"] integerValue]; |
| 256 | + if (customMsgType == CustomMsgTypeSenderInvitationReceiver) { | ||
| 253 | idx--; | 257 | idx--; |
| 254 | continue; | 258 | continue; |
| 255 | } | 259 | } |
| @@ -272,7 +276,6 @@ | @@ -272,7 +276,6 @@ | ||
| 272 | 276 | ||
| 273 | } | 277 | } |
| 274 | 278 | ||
| 275 | - // IMAMsg *timeMsg = nil; | ||
| 276 | if (temp) | 279 | if (temp) |
| 277 | { | 280 | { |
| 278 | NSDate *lastDate = [temp timestamp]; | 281 | NSDate *lastDate = [temp timestamp]; |
| @@ -281,7 +284,12 @@ | @@ -281,7 +284,12 @@ | ||
| 281 | if (timeinterval > 5 * 60) | 284 | if (timeinterval > 5 * 60) |
| 282 | { | 285 | { |
| 283 | // 大于五分钟 | 286 | // 大于五分钟 |
| 284 | - // timeMsg = [IMAMsg msgWithDate:date]; | 287 | + IMAMsg *timeTip = [IMAMsg msgWithDate:date]; |
| 288 | + [array addObject:timeTip]; | ||
| 289 | + } | ||
| 290 | + else if (customMsgType == CustomMsgTypeShareGoodsToHome) | ||
| 291 | + { | ||
| 292 | + //共享商品消息 | ||
| 285 | IMAMsg *timeTip = [IMAMsg msgWithDate:date]; | 293 | IMAMsg *timeTip = [IMAMsg msgWithDate:date]; |
| 286 | [array addObject:timeTip]; | 294 | [array addObject:timeTip]; |
| 287 | } | 295 | } |
| @@ -291,40 +299,7 @@ | @@ -291,40 +299,7 @@ | ||
| 291 | // NSLog(@"lastDate ==== %@",date); | 299 | // NSLog(@"lastDate ==== %@",date); |
| 292 | 300 | ||
| 293 | temp = msg; | 301 | temp = msg; |
| 294 | -// 处理转发消息 出现一条消息转发多次的情况 | ||
| 295 | -//// niu | ||
| 296 | -// if (![msgIdArray containsObject:msg.msgId]) { | ||
| 297 | -// | ||
| 298 | -// [msgIdArray addObject:msg.msgId]; | ||
| 299 | -// | ||
| 300 | -// IMAMsg *imamsg = [IMAMsg msgWith:msg]; | ||
| 301 | -// if (imamsg) | ||
| 302 | -// { | ||
| 303 | -// if (timeMsg) { | ||
| 304 | -// [array addObject:timeMsg]; | ||
| 305 | -// } | ||
| 306 | -// [array addObject:imamsg]; | ||
| 307 | -// } | ||
| 308 | -// } | ||
| 309 | -// | ||
| 310 | -// if ([msgIdArray containsObject:msg.msgId]) { | ||
| 311 | -// if (msg.status == TIM_MSG_STATUS_SEND_SUCC) { | ||
| 312 | -// [array enumerateObjectsUsingBlock:^(IMAMsg * _Nonnull message, NSUInteger idx, BOOL * _Nonnull stop) { | ||
| 313 | -// if ([msg.msgId isEqualToString:message.msg.msgId]) { | ||
| 314 | -// [array removeObject:message]; | ||
| 315 | -// IMAMsg *imamsg = [IMAMsg msgWith:msg]; | ||
| 316 | -// if (imamsg) | ||
| 317 | -// { | ||
| 318 | -// [array insertObject:imamsg atIndex:idx]; | ||
| 319 | -// } | ||
| 320 | -// } | ||
| 321 | -// }]; | ||
| 322 | -// } | ||
| 323 | -// } | ||
| 324 | 302 | ||
| 325 | - | ||
| 326 | - | ||
| 327 | - | ||
| 328 | //niu | 303 | //niu |
| 329 | IMAMsg *imamsg = [IMAMsg msgWith:msg]; | 304 | IMAMsg *imamsg = [IMAMsg msgWith:msg]; |
| 330 | if (imamsg) | 305 | if (imamsg) |