Commit debdb746 authored by christ's avatar christ

message

parent ad0e354b
......@@ -244,6 +244,9 @@ $tcp_server->on('receive', function($serv, $fd, $from_id, $data) use($conf) {
echo json_encode($value);
$sendStoreFd=$redis->hGet(KEY_PRE_STORE.$value['storeId'],'fd');
if(!empty($sendStoreFd)){
if(!$value['message']){
$value['message']=new \stdClass();
}
$serv->push($sendStoreFd, responseJson(1,"fromMsg","success", $value));
}
}else{
......@@ -253,6 +256,9 @@ $tcp_server->on('receive', function($serv, $fd, $from_id, $data) use($conf) {
$sendFd=$redis->hGet(KEY_PRE.$value['toId'],'fd');
$redis->hIncrBy(KEY_PRE.$value['toId'],'unread_message_count',\Our\ApiConst::one);
if(!empty($sendFd)){
if(!$value['message']){
$value['message']=new \stdClass();
}
$serv->push($sendFd, responseJson(1,"fromMsg","success", $value));
$redis->hSet(KEY_PRE.$value['fromId'],'sendTime', time());
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment