/* 好友消息 //消息接口 //0 好友或者群聊天消息 //1 2 添加好友获取群友进群消息提示 //3 用户给拉入群处理 //4 用户确定添加进入群消息 */ Namespace.register("U.F.N"); //好友消息命名空间 U.F.N.UXFN = []; //消息盒子 U.F.N.MSE = []; //好友消息同步推 /** * 用户消息模块 * * @param {string} 用户id */ U.F.N.GNM = function (userid) { U.A.Request(US.Auth, ["GetAllUnreadMessage", userid, US.userInfo.LoginId, US.PageId], U.F.N.AsynGNM, [""]); //获取好友未读消息 } //--------------------------------------------------------------------------获取好友消息------------------------------------------------------------------------------ //这个是消息的异步处理 U.F.N.AsynGNM = function (r, UTF) { if ((r = r.value)) {//获取信息异步 var i, _UIF = US.userInfo, _UDE = r[0], _UTE = r[1]; (UTF !== true) && (U.D.LocalStorage.set("fm", U.MS.jsonToStr({ value: r, uid: _UIF.UserId }))); if (typeof _UTE == "string") { U.F.N.DL(_UTE); } else { U.F.N.ST(_UTE); //用户上下线设置 // if (_UTE[2]) { //聊天室消息 // U.D.BC.ZMXXJS[_UTE[5], r[2][3], _UTE[3]]; // } U.F.N.CKJSXX(r); U.F.N.Distribute(r); } } } //消息盒子分发 U.F.N.Distribute = function (UDE) { if (U.F && U.F.N && U.F.N.UXFN) { for (var i = 0; i < U.F.N.UXFN.length; i++) { //消息盒子发送 if (U.F.N.UXFN[i]) { U.F.N.UXFN[i](UDE); } else { delete U.F.N.UXFN[i]; } } } } //消息查看 U.F.N.CKJSXX = function (UDE) { (UDE[0]) && (U.F.N.CKHFXT(UDE[0])); //好友消息查看 (UDE[1]) && (U.F.N.CKHFXTPB(UDE[1])); //即时消息查看 U.F.N.ZMTS(UDE); //发送消息到浏览器中 } //发送消息到桌面提示 U.F.N.ZMTS = function (UDE) { var i, j, k, _UKE, _USE, _UET = window.external, _UTF = [], _UCE = [[], []]; for (i = 0; i < UDE.length; i++) { if (i) { _USE = UDE[i][4]; for (j = 0; j < _USE.length; j++) { _UTF[0] = true; _UKE = _USE[j]; _UCE[1].push({ "UsImag": _UKE.UserThumbnailImageHead !== undefined ? U.M.GetImgU(_UKE.UserThumbnailImageHead) : US.ms + "img/getface.jpg", "UsSYSUN": "", "UsSYScontent": _UKE["NEWC"] || _UKE["ET"], "UsName": _UKE.UserName, "UsType": _UKE["NEWTYPE"] }); } } else { //属于闪烁消息 for (j = 0; j < UDE[i].length; j++) { _USE = UDE[i][j]; if (_USE && _USE.length) { for (k = 0; k < _USE.length; k++) { _UTF[1] = true; _UKE = _USE[k]; _UCE[0].push({ "UsImag": _UKE.UserThumbnailImageHead != null ? U.M.GetImgU(_UKE.UserThumbnailImageHead) : US.ms + "img/getface.jpg", "UsSYSUN": "", "UsSYScontent": _UKE, "UsName": _UKE.FriendsDescript || _UKE.UserNickName || _UKE.GroupManageName, "UsType": _UKE.MessageIsVerify || 0 }); } } } } } try { //云端浏览器 if (_UET) { if (_UTF[0]) { _UET.news(U.MS.jsonToStr(_UCE[1])); } if (_UTF[1]) { _UET.ftpshow(U.MS.jsonToStr(_UCE[0])); } else { _UET.QXftpshow(); } //属于普通消息 //闪烁消息 _UCE[0] = _UCE[1] = null; CollectGarbage(); return null; } } catch (e) { } //html5消息查看 // if ((_UET = U.MN.Noti({ t: 3000 }))) { // for (i = 0; i < _UCE.length; i++) { // for (j = 0; j < _UCE[i].length; j++) { // _UKE = _UCE[i][j].UsSYScontent; // _USE = $$("div", { "innerHTML": _UKE.MessageContent }); // (_UKE.MessageIsVerify === 0) && (_UET.create("来自" + _UKE.UserNickName, { body: _USE.innerText ? _USE.innerText : "图片分享", icon: U.M.GetImgU(_UKE.UserThumbnailImageHead) }, // { oc: U.M.apply(null, [[U.F.N.ZMTSOC, [_UCE[i][j].UsType, _UKE]]]) })); // } // } // } } //本地应用点击处理 U.F.N.ZMTSOC = function (UTP, UDE) { window.focus(); YDHJH(UTP, UDE); } //点击查看消息 U.F.N.CKHFXT = function (UDE) { var i, j, _UTF, _UT, _UDM, _UKE, _UFE, _UMV, //变量定义 _UCE = U.F.N.MSE; //还有消息数组 for (j = 0; j < UDE.length; j++) { //循环消息数组 0 好友消息, 1群消息 _UFE = UDE[j]; if (_UFE) { //判断是否存在 for (i = 0; i < _UFE.length; i++) { //好友消息或者群消息循环处理 由于好友或者群消息有多种消息 如添加还有消息、好友聊天消息,进入群消息,群聊天消息等, _UDM = _UFE[i]; //消息内容 _UTF = _UDM.UserId == null; _UT = true; _UMV = _UDM.MessageIsVerify || 0; (!_UCE[_UMV]) && (_UCE[_UMV] = []); switch (_UMV) { case 0: case undefined: //好友或者群聊天消息 _UKE = U.F.W.IsCreateForm(_UDM.UserId || _UDM.GroupManageID); //判断好友消息窗口是否打开 if (_UKE[1]) { //显示消息 //U.F.FM.SendChatMessageToDb U.F.FM.SendChatMessageToDb(_UDM.UserId || _UDM.GroupManageID, "", U.M.apply(this, [[U.F.FM.AsynReceiveMessages, [_UTF, [_UDM, _UKE[1][1]]]]]), _UTF); } else { //消息提示区域 _UDM.MessageSendTime = _UDM.MessageSendTime || _UDM.GroupMessageSendTime; } U.F.FM.RecentContacts(_UDM); //生成最近联系人 break; case 1: case 2: case 4: //添加好友获取群友进群消息提示 //确定通过好友申请 (!_UCE[_UMV]) && (_UCE[_UMV] = []); _UCE[_UMV].push(_UDM); break; case 3: //用户给拉入群处理 这里不做处理下面统一处理 break; case 5: //群文档消息 这里不做处理,下面统一处理 break; } _UKE = _$(_UCE[_UMV]).Where({ "$or": { "$e": { GroupManageID: _UFE[i].GroupManageID, UserId: _UFE[i].UserId } }, "$ne": { GroupManageID: null, UserId: null } })[0]; //获取消息是否已经存在 存在直接就添加消息数字 if (_UMV != 3 && _UMV != 5 && _UKE) { //消息存在数量添加 if (_UFE[i].GroupManageID) { _UKE.UCN = _UFE[i].UCN; } else { _UKE.UCN += _UFE[i].UCN; } } else { //互动消息设置 _UCE[_UMV].push(_UFE[i]); } } } } U.F.N.CKAGQYH(_UCE); //添加好友消息提醒 } //消息移除处理 U.F.N.XXYCCL = function (UDE, UIE) { var _USE, i = UIE || U.Ut.isObject(UDE) ? (UIE = (UDE.MessageIsVerify || 0)) : 0, _UL = U.Ut.isNumber(UIE) ? UIE + 1 : UIE, _UAE = U.F.N.MSE; for (; i < _UL; i++) { //删除消息 _$(_UAE[i]).Delete({ GroupManageID: UDE.GroupManageID, UserId: UDE.UserId }); } } //用户给拉入群处理 U.F.N.CKHFXTQX = function (UDE) { var _UTF = _$(US.Friend[2]).Select({ "GroupManageID": UDE.MessageContent })[0]; if (!_UTF) { //添加进入群同时加载 U.Alert("您给" + UDE.UserNickName + "加入讨论组"); U.F.N.LYHJQCL(UDE); } else { //删除群消息 U.A.Request(US.CD, [US.DB, "UseStudio_Friends", "DeleteMessageById", US.userInfo.userid, UDE.MessageID], U.M.apply(), [""]); } } //#region 追随者消息 //添加好友或者进入群消息提示 U.F.N.CKAGQYH = function (UDE) { for (var i = 0; i < 6; i++) { //消息处理 U.F.N.ZSHFXT(UDE[i], i); //弹出消息框 } } //追随者消息提醒 U.F.N.ZSHFXT = function (UDE, UTF) { var i, _UFN, _UDND, _UDTD, _UDCD, _UDPD, _UDMD, _UDAD, _UN, _PDW, _UDSD = $$("frag"); if ($("#UD_SYSSRXAFT")[0] != undefined) { if ($("#U_Boom_NCT")[0] == null) { _UDND = U.UI.From({ id: "U_Boom_NCT", style: { width: "300px", height: "209px", background: "#ffffff", padding: "0", border: "0", "display": "none", maxWidth: "300px" }, content: $("#UD_SYSSRXAFT")[0], min: false, draw: false, title: "系统消息", hst: { style: { "padding": "0 0 0 10px" } } }) } var _UDOD = $("#UD_SYSSRXOA")[0]; //清空消息内容 if (UTF == 0) { _UDOD.innerText = ""; } if (_UDOD && UDE && UDE.length) { _UDPD = $(_UDOD).Parent(); _UDMD = $(_UDPD).Parent(); _UDAD = $(_UDPD).Child(); for (i = 0; i < UDE.length; i++) { //消息内容设置 $(".UD_SYSSRXT")[0].innerHTML = UDE[i].UCN _UN = UDE[i].FriendsDescript || UDE[i].UserNickName || UDE[i].GroupManageName; switch (UTF) { case 0: //聊天消息处理 _UFN = null; _PDW = "您有" + UDE[i].UCN + "消息未读"; break; case 1: _UFN = [_UN + "添加您为好友", [U.F.N.TJZSHFXT, [UDE, UDE[i], _UDTD]]]; _PDW = "添加您为好友"; break; case 2: _UFN = [_UN + "请求加入该群", [U.F.N.CGAddGroup, [UDE, UDE[i], _UDTD]]] _PDW = "请求加入该群"; break; case 3: _UFN = [_UN + "邀请您加入讨论组", [U.F.N.LYHJQCL, [UDE[i]]]]; _PDW = "邀请您加入讨论组"; break; case 4: _UFN = [_UN + "同意添加你为好友", [U.F.N.AsynTJZSHFXT, [UDE, UDE[i], _UDTD]]]; _PDW = "同意添加你为好友"; break; case 5: var _group = _$(US.Friend[2]).Select({ GroupManageID: UDE[i].MessageContent.split(",")[0] }); _UFN = [[[U.F.W.PopupFriendsForm, [_group[0]]], [U.F.N.QZSHFXT, [UDE[i].MessageID || UDE[i].GroupMessageID, UDE, "this"]], [U.F.N.AsynQW, [UDE[i]]]]]; _PDW = "在群上上传文件"; break; } if (_UFN == null) { _UDTD = $$("div", { "className": "UD_SYSSRXOO", "title": "消息" }, _UDSD); _UDTD.onclick = U.M.apply(_UDTD, [[U.F.W.PopupFriendsForm, [UDE[i]]], [U.F.N.QZSHFXT, [UDE[i].MessageID || UDE[i].GroupMessageID, UDE, _UDTD]]]); } else if (_UFN.length == 1) { _UDTD = $$("div", { "className": "UD_SYSSRXOO", "title": "消息" }, _UDSD); _UDTD.onclick = U.M.apply(_UDTD, _UFN[0]); } else { _UDTD = $$("div", { "className": "UD_SYSSRXOO", "title": UTF ? "好友消息" : "群消息" }, _UDSD); _UDTD.onclick = U.M.apply(_UDTD, [[U.UI.Confirm, _UFN], [U.F.N.QZSHFXT, [UDE[i].MessageID, UDE, _UDTD]]]); //添加好友 } _UDCD = $$("div", { "className": "UD_SYSSRXOOI" }, _UDTD); //群头像 if (UDE[i].GroupManageID) { var _UDNDS = $$("div", { "className": "UD_SYHRCOONTw" }, _UDTD); U.F.PrintGroupHeadImage(UDE[i], _UDNDS, 4, [35, 35]); } else { $$("img", { "onerror": U.M.ImgError, "alt": UDE[i].FriendsDescript || UDE[i].UserNickName || UDE[i].GroupManageName, "src": U.M.GetImgU(UDE[i].UserThumbnailImageHead) }, _UDCD); } $$("div", { "className": "UD_SYSSRXOON UTDF", "innerHTML": _UN }, _UDTD); $$("div", { "className": "UD_SYSSRXOONT UTDF", "innerHTML": _PDW }, _UDTD); $$("div", { "className": "UD_SYSSRXOOC", "style": { "cssText": "float:right" }, "innerHTML": "查看", "onclick": [[U.M.StopBubble], [U.U.I.ViewOtherUserInfo, [UDE[i].UserId]], /*[U.F.N.QZSHFXT, [UDE[i].MessageID, UDE, _UDTD]]*/] }, _UDTD); //查看消息 } _UDMD.onclick = null; _UDOD.appendChild(_UDSD); U.F.N.NCTFU(); } } return _UDOD; } /** * 判断字符串是否为Guid * * @param {object} 群的数据 * @return {element} 需要显示框的内容 */ U.F.N.AsynQW = function (UDE) { var _groupid = UDE.MessageContent.split(",")[0]; //获取群id var _group = _$(US.Friend[2]).Select({ GroupManageID: _groupid }); //根据前段数组US.Friend[2]里所有的用户群里获取当前群id等于指定id的群数据 var _news = { //聊天消息的数据 FriendsDescript: "由" + UDE.MessageContent.split(",")[1] + "发起的互联办公群组。", IsLogin: 0, MessageSendTime: "" + UDE.MessageContent.split(",")[2] + "", UserId: "" + UDE.MessageContent.split(",")[0] + "", UserImageHead: null, UserIndividualitysignature: "", UserName: "" + UDE.MessageContent.split(",")[1] + "", UserNickName: "" + UDE.MessageContent.split(",")[1] + "", UserThumbnailImageHead: null, tf: 1 }; var _files = { // 需要弹出uw文件的文件信息 P: 1, UseFilesServerThumbnailName: null, UserDirectoryEncrypt: _groupid, UserDirectoryID: _groupid, UserFilesDescript: null, UserFilesExtendName: "" + UDE.MessageContent.split(",")[4].split(".")[1] + "", UserFilesID: "" + UDE.MessageContent.split(",")[3] + "", UserFilesModifyTime: "" + UDE.MessageSendTime + "", UserFilesName: "" + UDE.MessageContent.split(",")[1] + "", UserFilesServerName: "", UserId: "" + UDE.UserId + "" }; if (_group[0]) { var _UKE = U.F.W.IsCreateForm(_group[0].GroupManageID); //判断群是否给打开 if (_UKE[1]) { //如果群给打开直接写入一个文件聊天消息 var First = $$("div", { "className": "UD_QWJCSS" }, $("div.UD_SYFC", _UKE[1][1])[0]); // $(".UD_SYFCA")[1] $$("div", { "className": "UD_QWJCSS_O", "innerHTML": UDE.MessageContent.split(",")[2] }, First); var kInner = $$("div", { "className": "UD_QWJCSS_T" }, First); $$("div", { "className": "UD_QWJCSS_T_O", "innerHTML": "" + UDE.MessageDescript + "邀请您参与编辑文档,快去看看吧" }, kInner); var BS = $$("div", { "className": "UD_QWJCSS_T_T", "onclick": [[U.D.Office.Word, [US.userInfo, _files]]] }, kInner); $$("div", { "className": "UD_QWJCSS_T_T_O" }, BS); $$("div", { "className": "UD_QWJCSS_T_T_T", "innerHTML": UDE.MessageContent.split(",")[4] }, BS); $$("div", { "className": "UD_QWJCSS_T_T_S", "innerHTML": "....." }, BS); } U.F.FM.RecentContacts(_news); //生成最近联系人 } } U.F.N.NCTFU = function () { if ($("#U_Boom_NCT")[0].style.display == "none") { $("#U_Boom_NCT")[0].style.top = document.body.offsetHeight - 210 + "px"; $("#U_Boom_NCT")[0].style.left = document.body.offsetWidth - 360 + "px"; } $("#U_Boom_NCT")[0].style.display = "block"; // $(".UD_SYSSRXT")[0].style.display = "block" } U.F.N.NCTBlock = function () { $("#U_Boom_NCT")[0].style.display = "block" } //成功添加用户进入群 U.F.N.CGAddGroup = function (UGE, UDE, UDOD) { var _UFID = Guid.newGuid(), _UFE = _$(US.Friend[3]).Select({ "GroupManageID": UDE.MessageContent, "UserId": UDE.UserId }, null, 1)[0]; if (_UFE) { U.Alert("添加成功"); } else { U.A.Request(US.Auth, ["AddUsrsToGroup", US.userInfo.userid, UDE.MessageID, UDE.UserId, UDE.MessageContent.toUpperCase(), _UFID, UDE.MessageDescript]), U.F.N.AsynCGAddGroup, ["", UDE, _UFID]; } U.F.N.QZSHFXT(UDE.MessageID, UGE, UDOD, true); //清除 } //添加群进入 U.F.N.AsynCGAddGroup = function (r) { var context = r.context, _UDE = context[1], _UFID = context[2]; US.Friend[3].push(U.F.T.GroupUserEntity(_UDE.UserId, _UDE.UserImageHead, _UDE.UserNickName, _UDE.UserNickName, _UDE.UserThumbnailImageHead, _UDE.MessageContent.toUpperCase(), _UDE.MessageID, 1)); } //确定添加好友处理 U.F.N.TJZSHFXT = function (UGE, UDE, UDOD) { var _UFE = _$(US.Friend[1]).Select({ "UserId": UDE.UserId }, null, 1)[0]; //判断用户是否在好友分组里 if (!_UFE) { //好友不存在自己的列表 U.F.M.AddFriend(UDE, null, "0"); //添加他人进入群 return false; } else { //判断是否需要添加用户 U.F.W.PopupFriendsForm(_UFE); } U.F.N.QZSHFXT(UDE.MessageID, UGE, UDOD); //清除 } /** * 异步处理确定添加好友 * * @param {object} 确定添加对方为好友 */ U.F.N.AsynTJZSHFXT = function (UGE, UDE, UDOD) { var _UFID = Guid.newGuid(), _UFE = _$(US.Friend[1]).Select({ "UserId": UDE.UserId })[0]; if (!_UFE) { //如果好友没有添加处理 U.A.Request(US.Auth, ["AddFriend", UIF.UserId, _UFID, UDE.MessageContent, UDE.MessageDescript], U.F.N.AsynAddFriend, [null, UDE, UDE.MessageContent, _UFID]); //添加好友到默认分组 } else { U.F.W.PopupFriendsForm(_UFE); } U.F.N.QZSHFXT(UDE.MessageID, UGE, UDOD); //清除消息 } /** * 异步处理确定添加好友 * * @param {object} 确定添加对方为好友 */ U.F.N.AsynAddFriend = function (r) { var context = r.context, _UDE = context[1], _UGID = context[2], _UFID = context[3]; r = r.value; U.F.M.DisplayAddFriend(r[0][0], _UFID, _UGID, r); //确定添加好友到好友分组里 } //清除所有的的添加好友信息 U.F.N.QZSHFXT = function (UMID, UDE, UDOD, UTF) { var _UDPD = $(UDOD).Parent(); U.F.N.XXYCCL(UDE); if (UMID) { _$(UDE).Delete({ "MessageID": UMID }); if (_UDPD) { $(UDOD).remove(); //_UDPD = $(_UDPD).Parent(); //$(_UDPD).parentg().childg(0, 0).html(UDE.length); //$(_UDPD).Child()[2].innerText = "有" + UDE.length + "个新追随者"; } } //单个消息移除 //消息清空 隐藏消息 (!UTF) && (U.A.Request(US.CD, [US.DB, "UseStudio_Friends", "DeleteMessageById", UMID || _$(UDE).pluck("MessageID").join(",")]), U.M.apply(), []); //清除所有追随者添加的信息 // (!UTF) && (U.A.Request(US.Auth,"UseStudioManage.canceluseraddtogrouprequest", [US.userInfo.userid, UMID || _$(UDE).pluck("MessageID").join(",") ]), U.M.apply(), [""]); //清除所有追随者添加的信息 } //#endregion //好友和群消息 U.F.N.XXHFXT = function (UDE) { var i, _UDSD, _UDND, _UDTDr, _UDOD = $("#UD_SYHRC")[0], _UDTD = $("div", _UDOD)[0], _UDFD = $$("frag"); _UDTD.innerText = ""; //_UDFDF = $$("fragg"); _UDODT = $("#UD_SYSSRXOA")[0]; if (UDE && UDE.length) { for (i = 0; i < UDE.length; i++) { (_UDTDr = $$("div", { "className": "UD_SYSSRXOO", "title": "消息", "onclick": [[U.M.StopBubble], [U.F.W.PopupFriendsForm, [UDE[i]]], [U.F.N.QZSHFXT, [UDE[i].MessageID || UDE[i].GroupMessageID, UDE, _UDTDr]]] }))//.onclick = U.M.apply(_UDTDr, [[U.UI.Confirm, _UFN], [U.F.N.QZSHFXT, [UDE[i].MessageID, UDE, _UDTD]]]); //添加好友 _UDCD = $$("div", { "className": "UD_SYSSRXOOI" }, _UDTDr); if (UDE[i].GroupManageID) { _UDNDS = $$("div", { "className": "UD_SYHRCOONTw" }, _UDTDr); U.F.PrintGroupHeadImage(UDE[i], _UDNDS, 4, [35, 35]); } //群头像 else { $$("img", { "onerror": U.M.ImgError, "alt": UDE[i].FriendsDescript || UDE[i].UserNickName || UDE[i].GroupManageName, "src": U.M.GetImgU(UDE[i].UserThumbnailImageHead) }, _UDCD); } $$("div", { "className": "UD_SYSSRXOON UTDF", "innerHTML": UDE[i].FriendsDescript || UDE[i].UserNickName || UDE[i].GroupManageName }, _UDTDr); $$("div", { "className": "UD_SYSSRXOONT UTDF", "innerHTML": "您有" + UDE[i].UCN + "消息未读" }, _UDTDr); $$("div", { "className": "UD_SYSSRXOOC", "style": { "cssText": "float:right" }, "innerHTML": "查看" }, _UDTDr); //查看消息 _UDODT.appendChild(_UDTDr); } //_UDTD.appendChild(_UDFD); } } /** * 提供好友和群统一接口实现信息回调 * * @param {bool} 接收的消息类型 * true 群消息 * false 好友消息 * @param {string} 好友或者群消息 * @param {object} 获取查看的好友消息 */ U.F.FM.AsynReceiveMessages = function (isgroup, chatform, r) { //如果是群消息查看 if (isgroup) { U.F.W.PrintGroupChatMessage($("div.UD_SYFC", chatform)[0], r); //打印群消息 } //好友消息的查看 else { U.F.W.PrintFriendChatMessage($("div.UD_SYFC", chatform)[0], r); //打印好友消息 } } //拉用户进入群处理 U.F.N.LYHJQCL = function (UDE) { U.A.Request(US.Auth, ["GetJoinGroupNews", US.userInfo.userid, UDE.MessageID, UDE.MessageContent], U.F.N.AsynLYHJQCL, ["", UDE]); //拉用户进入群组 } //拉用户进入群组异步 U.F.N.AsynLYHJQCL = function (r) { if (r.value != "") { var i, _UFE, _UAE, _userid = US.userInfo.userid, context = r.context, UDE = context[1], _UGE = US.Disk.Disks[_userid]; r = r.value; _UFE = r[0]; US.Friend[2].unshift((_UAE = new U.F.T.GroupEntity(UDE.MessageContent.toLocaleLowerCase(), UDE.MessageDescript, U.MT.toTimeStamp(new Date()), UDE.UserId, "", null))); //创建群 U.Dk.M.Entity.Add(r[1], _UGE); U.Dk.M.Entity.Add([new U.Dk.M.Entity([_UAE.GroupManageID, 0, _userid, _UAE.GroupManageName, _UAE.GroupManageName, "folder", null, new Date(), U.UP.FFT("folder")[1], 1, null, null, 0, "", _UAE.GroupManageID])], _UGE, true); for (i = 0; i < _UFE.length; i++) { if (!_$(US.Friend[3]).Select({ "GroupManageID": _UFE[i].GroupManageID || _UFE[i].MessageContent, "UserId": _UFE[i].UserId || _UFE[i].UserId })[0]) { US.Friend[3].push(new U.F.T.GroupUserEntity((_UFE[i].UserId || _UFE[i].MessageSendUserID, U.M.GetImgU(_UFE[i].UserImageHead), _UFE[i].UserNickName || _UFE[i].UserName, _UFE[i].UserName, U.M.GetImgU(_UFE[i].UserThumbnailImageHead), _UFE[i].GroupUsersDescript || _UFE[i].UserNickName, _UFE[i].GroupManageID || _UFE[i].MessageContent, 1))); } } //添加群友 $($("#UD_SYHZLTA").Child()[2]).Child()[0].onclick(); return US.Friend[2][0]; //直接切换到群 } } //#endregion //#region //查看即时消息 U.F.N.CKHFXTPB = function (UDE) { var i, j, _ULE, _UTF, _UPE, _UCE, _UKE, _UME, _UNE, _UDOD, _userid = US.userInfo.userid; if ((UDE = UDE[4])) { for (i = 0; i < UDE.length; i++) { _UCE = UDE[i]; if (_UCE.UserId != _userid) { switch (_UCE["NEWTYPE"]) { case "UPBR": //学习系统回复信息或者blog回复信息 eval("0,_UKE =" + _UCE["ET"]); _UNE = US.PB.News[0]; _UME = (_UCE["ET"] = _$(_UNE).Select({ "ArticleID": _UKE["ArticleID"], "ReplyAddUserID": _UCE["UserId"] })[0]); if (_UME) { _UME.UCN++; } else { _UTF = _UKE.NewsType == 2; _UNE.push((_UCE["ET"] = { "PublishedDirectoryID": _UTF ? null : _UKE["PublishedDirectoryID"], "ReplyAddUserID": _UTF ? _UKE["ReplyAddUserID"] : _UCE["UserId"], "NF": _UTF ? US.NU : (_UKE["PublishedDirectoryID"] == US.PID ? null : US.PID), "ArticleContentBrief": _UTF ? _UKE["UserDirectoryName"] : _UKE["ArticleContentBrief"], "ReplyContent": _UCE["NEWC"], "UserName": _UCE["UserName"], "ArticleID": _UKE["ArticleID"], "UserThumbnailImageHead": _UCE["UserThumbnailImageHead"], "ArticleTitle": _UTF ? _UKE.ReplyContentBrief : _UKE.ArticleTitle, "UCN": _UCE["NEWT"] || 0 })); } //添加学习系统消息 U.D.Blog.N.PNXX(); //打印学习系统和blog消息 break; case "UD_DiskCon": case "DDisk": //Disk添加删除文件 _UKE = U.Dk.DiskOperatingSwitch(US.userInfo.userid); _UPE = []; _ULE = _UKE[4][_UKE[1][1]].Child.length; if (_UKE) { _UDOD = $("#UD_SYWRZ", _UKE.pdiv)[0]; // US.Disk.UserDisk if (_UCE["NEWTYPE"] == "UD_DiskCon") {//添加文件处理 eval("0,_UNE =" + _UCE["NEWC"]); _UCE["NEWC"] = (_UNE = _UNE.length == null ? [_UNE] : _UNE); _UME = _UNE[0].UserDirectoryParentID || _UNE[0].UserDirectoryID for (j = 0; j < _UNE.length; j++) { _UTF = U.Dk.M.RUS(new U.Dk.M.Entity(_UNE[j].UserFilesID || _UNE[j].UserDirectoryID, _UNE[j].UserFilesSize || 0, _UNE[j].UserDirectoryParentID || _UNE[j].UserDirectoryID, _UNE[j].UserDirectoryName || _UNE[j].UserFilesName, _UNE[j].UserDirectoryName || _UNE[j].UserFilesName, _UNE[j].UserDirectoryExtendType || _UNE[j].UserFilesExtendName, _UNE[j].UserFilesServerName, new Date(), _UNE[j].UseFilesServerThumbnailName || _UNE[j].UserDirectoryExtendType || _UNE[j].UserFilesExtendName, _UNE[j].UserDirectoryDeep || "9999.00", null, null, _UNE[j].UserDirectoryExtendType ? 0 : 1, _UNE[j].UserDirectoryDescript || _UNE[j].UserFilesDescript, _UNE[j].GroupID || _UNE[j].UserDirectoryEncrypt, "", _UCE.UserId, _UCE.UserName, _UCE.UserName, _UCE.UserThumbnailImageHead)); _UPE.push(_UTF); (_UKE[4][_UME]) && (_UKE[4][_UME].Child = _UKE[4][_UME].Child || [], _UKE[4][_UME].Child.push(_UTF)); _UKE[0].push(_UTF); } (!_ULE) && (_UDOD.innerText = ""); (_userid == _UKE[1][2] && _UME == _UKE[1][1]) && (U.Dk.VW.XWPDY(_UPE, _UDOD)); //添加文件 } else {//删除文件处理 _UNE = _UCE["NEWC"].split(","); _UME = _UCE["NEWT"]; for (j = 0; j < _UNE.length; j++) { _UTF = _$(_UKE[0]).Delete({ "UserDirectoryID": _UNE[j] })[0]; (_UTF) && (_UPE.push(_UTF)); } //删除文件 (_userid == _UKE[1][2] && _UPE[0].UserDirectoryParentID == _UKE[1][1]) && (U.Dk.RE.AsynWPSCWJ(_UPE, US.userInfo.userid)); //删除文件提示 } } break; //Disk更新目录 } } } } } //下线通知区域 U.F.N.DL = function (UTF) { //其它地方登录 if (UTF == "upline") { U.UI.Confirm("警告", { "width": "300px", "height": "140px" }, null, null, $$("div", { "style": { "textAlign": "center", "marginTop": "25px", "padding": "10px 0", "fontSize": "14px", "color": "red" }, "innerHTML": "您好, 您的账号在别处有登录!" })); U.U.L.TCUL(); } //超时重新连接 else { //, US.userInfo.LoginId, US.SystemId U.A.Request(US.Auth, ["UserStateLogin", US.userInfo.username, US.userInfo.UserPassword], U.M.apply(), []); } } //上线 U.F.N.ST = function (UDE, UTF) { var i, j, _UAID, _UDTD, _UDOD = $("#UD_SYHZLZ")[0], _userid = US.userInfo.userid, _UFE = US.Friend; for (i = 0; i < UDE.length; i++) { if (UDE[i].length) { _UAID = UDE[i].join(","); for (j = 0; j < 3; j++) { _$(_$(_UFE[(j ? j + 2 : 1)]).Like({ "UserId": _UAID })).Change({ "IsLogin": i }); } //设置用户在线状态 for (j = 0; j < UDE[i].length; j++) { _UAID = $("@TID='" + UDE[i][j] + "'", _UDOD); (_UAID[0]) && (_UDTD = $(_UAID.Parent())).append(_UAID, null, i ? _UDTD[0].firstChild : null); } } } for (j = 0; j < 3; j++) { _$(US.Friend[(j ? j + 2 : 1)]).Reset({ "IsLogin": 1 }); } //排序 } //#endregion