Просмотр исходного кода

offlineOperation?offlineTime=1596066837&language=zh&access_token=886cf4a43fe54a7594e3430fda9e4467&salt=1596066889848&secret=bWzxQgCzkjCshlJ%2Bfwfa%2Bw%3D%3D

offineTime bug 待修复 - URL	http://58.82.243.159:8092/friends/attention/list 获取了所有数据列表显示没有
曾 伟 5 лет назад
Родитель
Сommit
1f0d823599

+ 2 - 2
shiku_im.xcodeproj/project.pbxproj

@@ -11798,7 +11798,7 @@
 					"$(inherited)",
 					"$(PROJECT_DIR)/shiku_im/audioRecorder",
 				);
-				MARKETING_VERSION = 3.1.0;
+				MARKETING_VERSION = 3.1.3;
 				NGN_STACK_HOME = "";
 				ONLY_ACTIVE_ARCH = YES;
 				OTHER_LDFLAGS = "-ObjC";
@@ -11886,7 +11886,7 @@
 					"$(PROJECT_DIR)/shiku_im/3rd/UMSocial_Sdk_5.2.1/QQ",
 					"$(PROJECT_DIR)/shiku_im/3rd/QQ",
 				);
-				MARKETING_VERSION = 3.1.0;
+				MARKETING_VERSION = 3.1.3;
 				NGN_STACK_HOME = "";
 				ONLY_ACTIVE_ARCH = YES;
 				OTHER_LDFLAGS = "-ObjC";

+ 1 - 18
shiku_im/ClassesNew/MainClass/XMGMainViewController.m

@@ -56,7 +56,7 @@
         [g_notify addObserver:self selector:@selector(appDidEnterForeground) name:kApplicationWillEnterForeground object:nil];
         [g_notify addObserver:self selector:@selector(getUserInfo:) name:kXMPPMessageUpadteUserInfoNotification object:nil];
         [g_notify addObserver:self selector:@selector(getRoomSet:) name:kXMPPMessageUpadteGroupNotification object:nil];
-        [g_notify addObserver:self selector:@selector(onXmppLoginChanged:) name:kXmppLoginNotifaction object:nil];
+        
         [g_notify addObserver:self selector:@selector(hasLoginOther:) name:kXMPPLoginOtherNotification object:nil];
         [g_notify addObserver:self selector:@selector(showDeviceAuth:) name:kDeviceAuthNotification object:nil];
       
@@ -181,23 +181,6 @@
 }
  
 
--(void)onXmppLoginChanged:(NSNumber*)isLogin{
-    if([JXXMPP sharedInstance].isLogined == login_status_yes){
-        // 获取离线调用接口列表
-        CGFloat  lastOffLineTime=(g_server.lastOfflineTime *1000 + 0)/1000;
-                     
-              CGFloat  lastOffLineTime2=(g_server.timeDifference)/1000;
-           
-        
-       // [g_server offlineOperation:(g_server.lastOfflineTime *1000 + g_server.timeDifference)/1000 toView:self];
-        [self onAfterLogin];
-    }
-     
-}
-
--(void)onAfterLogin{
-//    [_msgVc scrollToPageUp];
-}
 
 -(void)hasLoginOther:(NSNotification *)notifcation{
     [g_App showAlert:Localized(@"JXXMPP_Other") delegate:self tag:10002 onlyConfirm:YES];

+ 21 - 4
shiku_im/ClassesNew/classes/homeVc/JXCsHomeVc.m

@@ -52,7 +52,7 @@
  
 -(instancetype)init{
     if (self=[super init]) {
-    
+    [g_notify addObserver:self selector:@selector(onXmppLoginChanged:) name:kXmppLoginNotifaction object:nil];
         [g_notify  addObserver:self selector:@selector(newMsgCome:) name:kXMPPNewMsgNotifaction object:nil];//收到了一条新消息
         
           [g_notify  addObserver:self selector:@selector(hiddenTipLabel:) name:@"hiddenTip" object:nil];//收到了一条新消息
@@ -85,14 +85,14 @@
     
     // 获取服务器时间
    // [g_server getCurrentTimeToView:self];
-    [g_server offlineOperation:(g_server.lastOfflineTime *1000 + g_server.timeDifference)/1000 toView:self];
+   // [g_server offlineOperation:(g_server.lastOfflineTime *1000 + g_server.timeDifference)/1000 toView:self];
        //NSLog(@"login_%@",g_server.myself.userId);
        
       // [g_server getUser:g_server.myself.userId toView:self];
         
-     CGFloat  lastOffLineTime=(g_server.lastOfflineTime *1000 + 0)/1000;
+     //CGFloat  lastOffLineTime=(g_server.lastOfflineTime *1000 + 0)/1000;
                   
-           CGFloat  lastOffLineTime2=(g_server.timeDifference)/1000;
+    // CGFloat  lastOffLineTime2=(g_server.timeDifference)/1000;
         
     [self setupChildViewControllers];
     
@@ -113,6 +113,23 @@
 }
  
 
+-(void)onXmppLoginChanged:(NSNumber*)isLogin{
+    if([JXXMPP sharedInstance].isLogined == login_status_yes){
+        // 获取离线调用接口列表
+        CGFloat  lastOffLineTime=(g_server.lastOfflineTime *1000 + 0)/1000;
+                     
+              CGFloat  lastOffLineTime2=(g_server.timeDifference)/1000;
+           
+        
+         //[g_server offlineOperation:(g_server.lastOfflineTime *1000 + g_server.timeDifference)/1000 toView:self];
+        [self onAfterLogin];
+    }
+     
+}
+
+-(void)onAfterLogin{
+//    [_msgVc scrollToPageUp];
+}
 - (void)showAD {
     [JXShowMainView showView];
 }

+ 17 - 15
shiku_im/ClassesNew/classes/messageVc/JXMsgViewController.m

@@ -242,7 +242,7 @@
         if ([g_myself.chatSyncTimeLen longLongValue] == 0 || [g_myself.chatSyncTimeLen longLongValue] == -1) {
             syncTimeLen = 0;
         }
-         [g_default setBool:YES forKey:kISFirstGetLastChatList];
+        // [g_default setBool:YES forKey:kISFirstGetLastChatList];
         
     }else {
       syncTimeLen = g_server.lastOfflineTime * 1000.0;
@@ -934,7 +934,7 @@
 - (void) delAllChatLogNotifi:(NSNotification *)notif {
     [self getServerData];
     self.msgTotal = 0;
-    _strCount=0;
+    
 }
  
  
@@ -951,13 +951,19 @@
         NSTimeInterval timeSend =[obj.message.timeSend timeIntervalSince1970];
         NSTimeInterval currentTime =[[NSDate date] timeIntervalSince1970];
         
-        //NSLog(@"obj.user.userNickname %@",obj.user.userNickname);
         JXMessageObject *userx=obj.message;
-        if ([userx.fromUserId isEqualToString:@"10000"]||timeSend>currentTime ||[obj.user.groupStatus intValue]==2||[obj.user.groupStatus intValue]==1||obj.user.userNickname.length==0) {
+     
+            
+       
+        
+      NSLog(@"obj.user.userNickname    %@ === userx.content %@",obj.user.userNickname,userx.content);
+        
+        if ([userx.fromUserId isEqualToString:@"10000"]||timeSend>currentTime ||[obj.user.groupStatus intValue]==2||[obj.user.groupStatus intValue]==1||obj.user.userNickname.length==0||userx.content.length==0||([obj.message.type intValue] == kWCMessageTypeSuperDelete || [obj.message.type intValue] == kWCMessageTypeGroupActivity)) {
             // [temArr insertObject:obj atIndex:0];
              [_array removeObjectAtIndex:idx];
             
             
+            
         }else{
 
             [temArr addObject:obj];
@@ -982,9 +988,7 @@
 - (void)sendServiecGroupJid:(NSString *)jid{
     
     
-    [_array enumerateObjectsUsingBlock:^(JXMsgAndUserObject * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
-        
-    }];
+    
      
       
 }
@@ -1056,9 +1060,7 @@
     cell.user = dict.user;
     cell.userId = dict.user.userId;
     
-    if (cell.user.groupType.length) {
-        
-    }
+   
     
     
 //    cell.bage = [NSString stringWithFormat:@"%d",[dict.user.msgsNew intValue]];
@@ -1089,7 +1091,7 @@
         cell.headImage=@"ALOGO_1200";
       }
     
-    
+   
     NSString *lastContet = [dict.message getLastContent];
     BOOL flag = NO;
     if ([dict.user.isAtMe intValue] == 1 && _seekTextField.text.length <= 0 && (dict.user.roomFlag || dict.user.roomId.length > 0)) {
@@ -1989,8 +1991,8 @@
         case login_status_yes:{
            // self.title = Localized(@"JXMsgViewController_OnLine");
             // 同步最近一条聊天记录
-          // [self getLastChatList];
-            //[_activity stopAnimating];
+           [self getLastChatList];
+             [_activity stopAnimating];
         }
 
             break;
@@ -2475,8 +2477,8 @@
             
             //访问DB获取好友消息列表
           //  NSMutableArray* p = [[JXMessageObject sharedInstance] fetchRecentChat];
-          //[self getServerData];
-          //  [self getLastChatList];
+          [self getServerData];
+          // [self getLastChatList];
  
         }
      

+ 2 - 1
shiku_im/model/JXUserObject.m

@@ -813,7 +813,8 @@ static JXUserObject *sharedUser;
     for (NSInteger i = 0; i < array.count; i ++) {
         NSDictionary *dict = array[i];
         NSString  *dicJid=dict[@"jid"];
-        if ([g_xmpp.blackList containsObject:dict[@"jid"]]||dicJid.length>=10) {
+        //修改了修改了 //||dicJid.length>=10
+        if ([g_xmpp.blackList containsObject:dict[@"jid"]]) {
             continue;
         }
         JXUserObject *user = [[JXUserObject sharedInstance] getUserById:dict[@"jid"]];

+ 2 - 2
shiku_im/network/JXServer.m

@@ -204,12 +204,12 @@
         }else{
 //            NSLog(@"%@成功:%@",task.action,string);
 //|| [task.action isEqualToString:act_Config]
-            if ([task.action isEqualToString:act_getCurrentTime] ) {
+            if ([task.action isEqualToString:act_getCurrentTime]) {
                 // 获取服务器时间,然后对比当前客户端时间
                 // 两个接口调用,防止单个接口出现空值
                 if ([[(NSDictionary *)resultObject objectForKey:@"currentTime"] doubleValue] > 0) {
                     self.serverCurrentTime = [[(NSDictionary *)resultObject objectForKey:@"currentTime"] doubleValue];
-                    NSTimeInterval plusTime = self.serverCurrentTime;//- ([[NSDate date] timeIntervalSince1970] *1000);
+                    NSTimeInterval plusTime = self.serverCurrentTime;//-([[NSDate date] timeIntervalSince1970] *1000);
                     //NSTimeInterval plusTime = self.serverCurrentTime;
                     
                    // [g_App showAlert:[NSString stringWithFormat:@"%f",plusTime]];