فهرست منبع

Merge branch 'master' of http://129.204.155.107:3000/zengwei/jixin_new

曾 伟 5 سال پیش
والد
کامیت
78f1c70686

+ 59 - 5
shiku_im/ClassesNew/classes/messageVc/JXMsgViewController.m

@@ -123,7 +123,8 @@
 @property (nonatomic, assign) BOOL iskeFugongzong;
 
 @property (nonatomic, assign) int isRecordkeFugongzong;
-
+// 是否获取到了最近消息列表
+@property (nonatomic, assign) BOOL isGetLastMsgList;
 @end
 
 @implementation JXMsgViewController
@@ -153,7 +154,7 @@
           _webAddPointV=[CYWebAddPointVC new];
         _isRecordkeFugongzong=0;
         _indexNums=0;
-        
+        _isGetLastMsgList = NO;
         dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
 
              
@@ -2763,7 +2764,7 @@
     
     if([aDownload.action isEqualToString:act_roomListHis]){
             
-        
+        NSMutableArray *listArr = [NSMutableArray array];
         //            [[JXXMPP sharedInstance].roomPool joinRoom:tempDict[@"jid"] title:tempDict[@"name"] lastDate:nil isNew:NO];
         /*-------------------*/
         for (int i = 0; i < [array1 count]; i++) {
@@ -2828,16 +2829,67 @@
                 }
             }
             
+            /********************  ****************************/
+            // 如果最近一条信息接口没有获取到,就更新
+            if ([[dict objectForKey:@"jid"] intValue] > 0 && !_isGetLastMsgList) {
+                // 获取最近一条记录
+                NSArray *arr = [[JXMessageObject sharedInstance] fetchMessageListWithUser:[dict objectForKey:@"jid"] byAllNum:0 pageCount:20 startTime:[NSDate dateWithTimeIntervalSince1970:0]];
+                
+                // 去除
+                JXMessageObject *lastMsg = arr.lastObject;
+                if (!lastMsg) {
+                    lastMsg = arr.firstObject;
+                }
+                JXUserObject *user = [[JXUserObject sharedInstance] getUserById:dict[@"jid"]];
+                NSMutableDictionary *taskDic = [NSMutableDictionary dictionary];
+                [taskDic setObject:[dict objectForKey:@"jid"] forKey:@"userId"];
+                [taskDic setObject:[NSDate dateWithTimeIntervalSince1970:[dict[@"timeSend"] longLongValue]] forKey:@"lastTime"];
+                if (lastMsg) {
+                    [taskDic setObject:lastMsg.timeSend forKey:@"startTime"];
+                    if (lastMsg.messageId) {
+                        [taskDic setObject:lastMsg.messageId forKey:@"startMsgId"];
+                    }
+                }
+                if (user.roomId) {
+                    [taskDic setObject:user.roomId forKey:@"roomId"];
+                }
+                if ([g_myself.chatSyncTimeLen longLongValue] != -2) {
+                    
+                    [self createSynTask:taskDic];
+                    
+                    [_taskArray addObject:taskDic];
+                }
+                
+                long value = (long)([lastMsg.timeSend timeIntervalSince1970]*1000);
+                if (!lastMsg) {
+                    // 没有最后一条消息的记录就拉取一周前的数据
+                    value = (long)(g_server.lastOfflineTime*1000)-(7*24*3600*1000);
+                }
+                
+                NSString *listStr = [NSString stringWithFormat:@"%@,%ld",dict[@"jid"],value];
+                [listArr addObject:listStr];
+            }
+                       
+                /********************  ****************************/
+            
             //                        [tempArray addObject:user];
         }
         /*-------------------*/
-        
+        if (listArr.count > 0) {
+            dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(.5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
+                // 如果最近一条信息接口没有获取到,批量拉取消息
+                if (!_isGetLastMsgList) {
+                    [g_xmpp pullBatchGroupMessageReqWithJidListArray:listArr];
+                }
+            });
+        }
         
         [_table reloadData];
     }
 
     if ([aDownload.action isEqualToString:act_tigaseGetLastChatList]) {
         [self.header endRefreshing];
+        _isGetLastMsgList = YES;
         [g_default setBool:YES forKey:kISFirstGetLastChatList];
         if ([g_myself.chatSyncTimeLen longLongValue] != -2) {
             [[JXUserObject sharedInstance] updateUserLastChatList:array1];
@@ -2898,7 +2950,8 @@
                 
                 long value = (long)([lastMsg.timeSend timeIntervalSince1970]*1000);
                 if (!lastMsg) {
-                    value = (long)(g_server.lastOfflineTime*1000);
+                    // 没有最后一条消息的记录就拉取一周前的数据
+                    value = (long)(g_server.lastOfflineTime*1000)-(7*24*3600*1000);
                 }
                 
                 NSString *listStr = [NSString stringWithFormat:@"%@,%ld",dict[@"jid"],value];
@@ -3019,6 +3072,7 @@
     [_wait hide];
     
     if ([aDownload.action isEqualToString:act_tigaseGetLastChatList]) {
+        _isGetLastMsgList = NO;
         [self.header endRefreshing];
         [self getAllChatList];
         //[self getFriend];

BIN
xcode10&11适配.zip


+ 2 - 0
xcode10&11适配/MacOS/MacOS地址.txt

@@ -0,0 +1,2 @@
+
+/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib/

تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 1950 - 0
xcode10&11适配/MacOS/归档/libstdc++.6.0.9.tbd


+ 1 - 0
xcode10&11适配/MacOS/归档/libstdc++.6.tbd

@@ -0,0 +1 @@
+libstdc++.6.0.9.tbd

+ 1 - 0
xcode10&11适配/MacOS/归档/libstdc++.tbd

@@ -0,0 +1 @@
+libstdc++.6.tbd

BIN
xcode10&11适配/Xcode10 开发适配.docx


تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 1951 - 0
xcode10&11适配/模拟器1/归档/libstdc++.6.0.9.tbd


+ 1 - 0
xcode10&11适配/模拟器1/归档/libstdc++.6.tbd

@@ -0,0 +1 @@
+libstdc++.6.0.9.tbd

+ 1 - 0
xcode10&11适配/模拟器1/归档/libstdc++.tbd

@@ -0,0 +1 @@
+libstdc++.6.tbd

+ 2 - 0
xcode10&11适配/模拟器1/模拟器1地址.txt

@@ -0,0 +1,2 @@
+
+/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/lib/

BIN
xcode10&11适配/模拟器2/归档/libstdc++.6.0.9.dylib


+ 1 - 0
xcode10&11适配/模拟器2/归档/libstdc++.6.dylib

@@ -0,0 +1 @@
+libstdc++.6.0.9.dylib

+ 1 - 0
xcode10&11适配/模拟器2/归档/libstdc++.dylib

@@ -0,0 +1 @@
+libstdc++.6.dylib

+ 6 - 0
xcode10&11适配/模拟器2/模拟器2地址.txt

@@ -0,0 +1,6 @@
+
+xcode10+:
+/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/usr/lib/
+
+xcode11+:
+/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/usr/lib

تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 1980 - 0
xcode10&11适配/真机/归档/libstdc++.6.0.9.tbd


+ 1 - 0
xcode10&11适配/真机/归档/libstdc++.6.tbd

@@ -0,0 +1 @@
+libstdc++.6.0.9.tbd

+ 1 - 0
xcode10&11适配/真机/归档/libstdc++.tbd

@@ -0,0 +1 @@
+libstdc++.6.tbd

+ 2 - 0
xcode10&11适配/真机/真机地址.txt

@@ -0,0 +1,2 @@
+
+/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/usr/lib/