vali 6 lat temu
rodzic
commit
35e3c7e8a6

+ 16 - 8
vendor/GatewayWorker_windows/Applications/whisper/Events.php

@@ -424,18 +424,23 @@ class Events
             'message_type' => 'onlinekfs',
             'data' => [],
         ];
+        $nowkfid = $_SESSION['uid'];
+
         $kfs = self::$global->kfList;
-        if (!$kfs) {
+        $groupnamemap = self::$global->groupmap;
+
+        if (!$kfs  ||  empty($nowkfid)) {
             return $return;
         }
 
         $ret = [];
-        foreach ($kfs as $gruop => $fs) {
-            foreach ($fs as $kfid => $kfdata) {
-                if ($kfdata['status'] == 1) {
-                    $ret[$gruop][] = ['id' => $kfid, 'name' => $kfdata['name'], 'job_member' => $kfdata['job_name'], 'avatar' => $kfdata['avatar'], 'signature' => $kfdata['signature']];
-                }
-            }
+
+        foreach ($kfs as $gruop => $users) {
+               foreach ($users as $uid=>$uinfo){
+                   if ($uid != $nowkfid){
+                       $ret[] = ['group'=>$gruop,'name'=>$groupnamemap[$gruop],'kfuid'=>$uid,'kfjobname'=>$uinfo['job_name']];
+                   }
+               }
         }
         $return['data'] = $ret;
         return $return;
@@ -529,7 +534,9 @@ class Events
             'message_type' => 'connect',
             'data' => [
                 'kf_id' => $toukfid,
+                'conversationId' => $new_id,
                 'kf_name' => Gateway::getSession(Gateway::getClientIdByUid($toukfid)['0'])['name'],
+                'serverInfo' => self::$global->kfList[$groupid][$toukfid],
             ]
         ];
         Gateway::sendToClient($uidclientid, json_encode($noticeUser, 256));
@@ -539,7 +546,8 @@ class Events
         $noticeKf = [
             'message_type' => 'connect',
             'data' => [
-                'user_info' => $uid
+                'user_info' => $uid,
+                'conversationId' => $new_id,
             ]
         ];
         Gateway::sendToClient($tokfidclientid, json_encode($noticeKf, 256));