var system=require("../../system")
var settings=require("../../../config/settings");
class SocketNotifyCtl{
   constructor(){
   }
   setSocketServer(s){
     this.socketServer=s;
   }
   //异步推送消息到客户端
   notifyClientMsg(user,msg){
    var uk= this.buildPrivateChannel(user);
    var msgHandler=this.socketServer.users[uk];
    msgHandler.notifyClient(uk,msg);
   }
   buildPrivateChannel(user){
     var ukchannel= user.app_id+"￥"+user.id;
     return ukchannel;
   }
   buildMsgTarget(user){
     var ukchannel= user.app_id+"￥"+user.id;
     var nickName=user.nickName;
     var imgUrl=user.imgUrl;
     var rtn=ukchannel+"￥"+nickName+"￥"+imgUrl;
     return rtn;
   }
}
module.exports=SocketNotifyCtl;
