Commit faf723d68074dd7f5328664435c51456382d6d13

Authored by niudaojian
1 parent 1bce1bbf

共享商品消息添加时间

CNLiveNewIMAManagerKit.podspec
... ... @@ -8,7 +8,7 @@
8 8  
9 9 Pod::Spec.new do |s|
10 10 s.name = 'CNLiveNewIMAManagerKit'
11   - s.version = '0.7.6'
  11 + s.version = '0.7.7'
12 12 s.summary = 'A short description of CNLiveNewIMAManagerKit.'
13 13  
14 14 #s.description = <<-DESC
... ...
CNLiveNewIMAManagerKit/Classes/TIMModel/Conversation/IMAConversation.m
... ... @@ -241,6 +241,9 @@
241 241 continue;
242 242 }
243 243  
  244 + /**自定义消息类型*/
  245 + NSInteger customMsgType = 0;
  246 +
244 247 if ([[msg getElem:0] isKindOfClass:[TIMCustomElem class]])
245 248 {
246 249 //过滤不需要展示的自定义消息
... ... @@ -249,7 +252,8 @@
249 252 NSDictionary *dic = [NSJSONSerialization JSONObjectWithData:customElem.data
250 253 options:NSJSONReadingMutableContainers
251 254 error:&err];
252   - if ([[dic objectForKey:@"type"] integerValue] == CustomMsgTypeSenderInvitationReceiver) {
  255 + customMsgType = [[dic objectForKey:@"type"] integerValue];
  256 + if (customMsgType == CustomMsgTypeSenderInvitationReceiver) {
253 257 idx--;
254 258 continue;
255 259 }
... ... @@ -272,7 +276,6 @@
272 276  
273 277 }
274 278  
275   - // IMAMsg *timeMsg = nil;
276 279 if (temp)
277 280 {
278 281 NSDate *lastDate = [temp timestamp];
... ... @@ -281,7 +284,12 @@
281 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 293 IMAMsg *timeTip = [IMAMsg msgWithDate:date];
286 294 [array addObject:timeTip];
287 295 }
... ... @@ -291,40 +299,7 @@
291 299 // NSLog(@"lastDate ==== %@",date);
292 300  
293 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 303 //niu
329 304 IMAMsg *imamsg = [IMAMsg msgWith:msg];
330 305 if (imamsg)
... ...