|
@@ -18,7 +18,7 @@ require_once(BASE_ROOT_PATH . '/helper/ugc_helper.php');
|
|
|
require_once(BASE_ROOT_PATH . '/helper/search/tcp_client.php');
|
|
|
|
|
|
function all_channels() {
|
|
|
- return array('special','fellow');
|
|
|
+ return array('special','fellow','inviter');
|
|
|
}
|
|
|
|
|
|
$gMessageStates = null;
|
|
@@ -51,12 +51,14 @@ class UgcHandler
|
|
|
static public function onFellow($msg)
|
|
|
{
|
|
|
if(empty($msg)) return false;
|
|
|
- $params = unserialize($msg);
|
|
|
- if($params == false || !is_array($params)) {
|
|
|
+
|
|
|
+ $content = unserialize($msg);
|
|
|
+ if($content == false || !is_array($content)) {
|
|
|
return false;
|
|
|
}
|
|
|
+ $type = $content['type'];
|
|
|
+ $params = $content['params'];
|
|
|
|
|
|
- $type = $params['type'];
|
|
|
if($type == 'add') {
|
|
|
search\relation_client::instance()->add_follow(['user_id' => $params['user_id'],'friends' => $params['friends']]);
|
|
|
}
|
|
@@ -68,6 +70,24 @@ class UgcHandler
|
|
|
}
|
|
|
return true;
|
|
|
}
|
|
|
+ static public function onInviter($msg)
|
|
|
+ {
|
|
|
+ if(empty($msg)) return false;
|
|
|
+
|
|
|
+ $content = unserialize($msg);
|
|
|
+ if($content == false || !is_array($content)) {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ $type = $content['type'];
|
|
|
+ $params = $content['params'];
|
|
|
+
|
|
|
+ if($type == 'add') {
|
|
|
+ search\relation_client::instance()->add_inviter(['user_id' => $params['user_id'],'inviter_id' => $params['inviter_id']]);
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ }
|
|
|
+ return true;
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
function work_proc()
|