现在的位置: 首页 > 综合 > 正文

WEBQQ2.0协议分析-eqq.all.js

2017年11月13日 ⁄ 综合 ⁄ 共 219516字 ⁄ 字号 评论关闭
(function() {
    WebqCore.register("EQQ.Global",
    function() {
        this.initGlobal = function() {
            EQQ.vfwebqq = alloy.portal.getVfWebQQ()
        }
    })
})(); (function() {
    WebqCore.register("EQQ.Adapter",
    function(d) {
        this.proxysend = function(g, f) {
            alloy.rpcService.send(g, {
                context: null,
                method: f.method || "GET",
                data: {
                    r: d.json.stringify(f.param)
                },
                onSuccess: f.onSuccess,
                onError: f.onError,
                onTimeout: f.onTimeout
            })
        };
        EQQ.BASE_CONST = alloy.CONST
    })
})(); (function() {
    WebqCore.register("EQQ.Extend",
    function() {
        this.cgi_module = function(d, g) {
            return function(f) {
                g.onError = g.errback ||
                function() { };
                g.onTimeout = g.timeback ||
                function() { };
                f = f ||
                function() { };
                g.onSuccess = function(d) {
                    g.callback(d, f)
                };
                EQQ.Adapter.proxysend(d, g)
            }
        };
        this.cgi_module_d = function(d, g) {
            return function(f) {
                g.onError = g.errback ||
                function() { };
                g.onTimeout = g.timeback ||
                function() { };
                f = f ||
                function() { };
                g.onSuccess = function(d) {
                    g.callback(d, f)
                };
                EQQ.RPCService.send(d, g)
            }
        };
        this.require = function(d, g) {
            for (var f = d.length,
            j = d.length,
            t = function() {
                f--;
                f == 0 && g()
            },
            b = 0; b < j; b++) d[b](t)
        }
    })
})(); (function() {
    WebqCore.register("EQQ",
    function(d) {
        var g = this,
        f = d.dom,
        j = d.event,
        t = d.cookie,
        b = !1,
        a = {},
        c, p = 0,
        m, z, q, o = !1,
        i = !1,
        r, k;
        k = window.location.host;
        d.out(">>dName: " + k);
        this.showLogin = function() {
            alloy.portal.getLoginLevel();
            t.get("ptwebqq") ? EQQ.init2({
                panel: {
                    mainPanel: alloy.app.eqq.getWindow().body,
                    taskBar: alloy.layout.getPanel("taskBar").body
                }
            }) : alloy.layout.showLoginWindow("eqq", !0)
        };
        var D = {
            onExit: function() {
                alloy.layout.confirm("\u60a8\u786e\u8ba4\u8981\u5173\u95ed WebQQ \u5417\uff1f",
                function() {
                    g.executeExit()
                },
                {
                    modal: !0
                })
            },
            onNeedLogin: function() {
                alloy.layout.showLoginWindow("eqq")
            }
        };
        this.CONST = {
            MAIN_DOMAIN: "qq.com",
            EQQ_SERVER_URL: "http://" + k + "/",
            CONN_SERVER_DOMAIN: "http://d.web2.qq.com/",
            CONN_SERVER_DOMAINS: ["http://d.web2.qq.com/"],
            CONN_PROXY_URLS: ["http://d.web2.qq.com/proxy.html?v=20110331002"],
            CONN_SERVER_DOMAIN2: "http://" + k + "/",
            CONN_PROXY_URL: "http://d.web2.qq.com/proxy.html?v=20110331002",
            CHAT_PIC_SERVER: "http://" + k + "/",
            AVATAR_SERVER_DOMAIN: "http://qun.qq.com/",
            AVATAR_SERVER_DOMAINS: ["http://face1.qun.qq.com/", "http://face2.qun.qq.com/", "http://face3.qun.qq.com/", "http://face4.qun.qq.com/", "http://face5.qun.qq.com/", "http://face6.qun.qq.com/", "http://face7.qun.qq.com/", "http://face8.qun.qq.com/", "http://face9.qun.qq.com/", "http://face10.qun.qq.com/", "http://face11.qun.qq.com/"],
            SYSTEM_FACE_URL: "http://0.web.qstatic.com/webqqpic/style/face/",
            LOGIN_PROTECT_FINISH_URL: "./login_protect.html",
            UPLOAD_CUSTOM_FACE_SERVER: "http://up.web2.qq.com/cgi-bin/cface_upload",
            DOWNLOAD_CHAT_LOG_SERVER: "http://sns.qq.com/buddy_state/feed/save_chat.php",
            FILE_SERVER: "http://file1.web.qq.com/",
            OFFLINE_FILE_SERVER: "http://weboffline.ftn.qq.com:80/ftn_access/",
            QZONE_SERVER_DOMAIN: "http://qzone.qq.com/",
            QZONE_USER_SERVER_DOMAIN: "http://user.qzone.qq.com/",
            QQ_GROUP_URL: "http://qun.qq.com/air/",
            MAX_LOGIN_AMOUNT: 1,
            MAX_FAIL_AMOUNT: 2,
            Z_INDEX_BASE: 3E3,
            LOAD_AVATAR_AMOUNT: 50,
            TRANSFER_TABLE: [14, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 0, 50, 51, 96, 53, 54, 73, 74, 75, 76, 77, 78, 55, 56, 57, 58, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 32, 113, 114, 115, 63, 64, 59, 33, 34, 116, 36, 37, 38, 91, 92, 93, 29, 117, 72, 45, 42, 39, 62, 46, 47, 71, 95, 118, 119, 120, 121, 122, 123, 124, 27, 21, 23, 25, 26, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 52, 24, 22, 20, 60, 61, 89, 90, 31, 94, 65, 35, 66, 67, 68, 69, 70, 15, 16, 17, 18, 19, 28, 30, 40, 41, 43, 44, 48, 49],
            T_TRANSFER_TABLE: {
                14: 0,
                1: 1,
                2: 2,
                3: 3,
                4: 4,
                5: 5,
                6: 6,
                7: 7,
                8: 8,
                9: 9,
                10: 10,
                11: 11,
                12: 12,
                13: 13,
                0: 14,
                50: 15,
                51: 16,
                96: 17,
                53: 18,
                54: 19,
                73: 20,
                74: 21,
                75: 22,
                76: 23,
                77: 24,
                78: 25,
                55: 26,
                56: 27,
                57: 28,
                58: 29,
                79: 30,
                80: 31,
                81: 32,
                82: 33,
                83: 34,
                84: 35,
                85: 36,
                86: 37,
                87: 38,
                88: 39,
                97: 40,
                98: 41,
                99: 42,
                100: 43,
                101: 44,
                102: 45,
                103: 46,
                104: 47,
                105: 48,
                106: 49,
                107: 50,
                108: 51,
                109: 52,
                110: 53,
                111: 54,
                112: 55,
                32: 56,
                113: 57,
                114: 58,
                115: 59,
                63: 60,
                64: 61,
                59: 62,
                33: 63,
                34: 64,
                116: 65,
                36: 66,
                37: 67,
                38: 68,
                91: 69,
                92: 70,
                93: 71,
                29: 72,
                117: 73,
                72: 74,
                45: 75,
                42: 76,
                39: 77,
                62: 78,
                46: 79,
                47: 80,
                71: 81,
                95: 82,
                118: 83,
                119: 84,
                120: 85,
                121: 86,
                122: 87,
                123: 88,
                124: 89,
                27: 90,
                21: 91,
                23: 92,
                25: 93,
                26: 94,
                125: 95,
                126: 96,
                127: 97,
                128: 98,
                129: 99,
                130: 100,
                131: 101,
                132: 102,
                133: 103,
                134: 104,
                52: 105,
                24: 106,
                22: 107,
                20: 108,
                60: 109,
                61: 110,
                89: 111,
                90: 112,
                31: 113,
                94: 114,
                65: 115,
                35: 116,
                66: 117,
                67: 118,
                68: 119,
                69: 120,
                70: 121,
                15: 122,
                16: 123,
                17: 124,
                18: 125,
                19: 126,
                28: 127,
                30: 128,
                40: 129,
                41: 130,
                43: 131,
                44: 132,
                48: 133,
                49: 134
            },
            WEBQQMSGTIPS: "\n\u3010\u63d0\u793a\uff1a\u6b64\u7528\u6237\u6b63\u5728\u4f7f\u7528WebQQ\uff1ahttp://" + alloy.CONST.DOMAIN + "/\u3011"
        };
        this.hash = {
            onlineStatus: {
                callme: "callme",
                online: "online",
                away: "away",
                busy: "busy",
                silent: "silent",
                hidden: "hidden",
                offline: "offline"
            },
            onlineStatusText: {
                callme: "Q\u6211\u5427",
                online: "\u5728\u7ebf",
                away: "\u79bb\u5f00",
                busy: "\u5fd9\u788c",
                silent: "\u9759\u97f3",
                hidden: "\u9690\u8eab",
                offline: "\u79bb\u7ebf"
            },
            clientType: {
                1: "PC",
                2: "PC",
                3: "PC",
                4: "PC",
                5: "PC",
                6: "PC",
                10: "PC",
                21: "Phone",
                22: "Phone",
                23: "Phone",
                24: "Phone",
                41: "WebQQ",
                42: "PC",
                1E4: "PC"
            },
            clientTypeText: {
                1: "PC",
                2: "PC",
                3: "PC",
                4: "PC",
                5: "PC",
                6: "PC",
                10: "PC",
                21: "\u624b\u673aQQ",
                22: "\u624b\u673aQQ",
                23: "\u624b\u673aQQ",
                24: "\u624b\u673aQQ",
                41: "WebQQ",
                42: "PC",
                1E4: "PC"
            },
            userClassType: {
                online: "online",
                stranger: "stranger",
                blacklist: "blacklist"
            }
        };
        document.domain = this.CONST.MAIN_DOMAIN;
        j.on(document, "keydown",
        function(l) {
            l.keyCode === 27 && l.preventDefault()
        });
        this.init2 = function(e) {
            b = !1;
            a = {};
            z = m = null;
            i = !1;
            this.panel = e.panel || {};
            N = 0;
            S = !1;
            Y = 0;
            j.addObserver(alloy.portal, "exit", C);
            j.addObserver(alloy.portal, "DesktopSwitch", F);
            j.addObserver(EQQ, "LoginSuccess", J);
            j.addObserver(g, "LoginFailure", M);
            j.addObserver(g, "VerifyLoginProtectSuccess", x);
            j.addObserver(g, "exit", D.onExit);
            j.addObserver(g, "needLogin", D.onNeedLogin);
            j.addObserver(EQQ.RPCService, "NotLogin", Q);
            j.addObserver(EQQ.RPCService, "NotReLogin", O);
            j.addObserver(EQQ, "ReLinkStop", H);
            j.addObserver(EQQ.RPCService, "FailCountOverMax", I);
            j.addObserver(EQQ, "ReLinkSuccess", A);
            j.addObserver(EQQ, "ReLinkFailure", I);
            j.addObserver(EQQ, "UinNotInWhitelist", u);
            j.addObserver(EQQ, "UinInBlacklist", s);
            j.addObserver(EQQ, "Overload", K);
            j.addObserver(EQQ, "PtwebqqFail", G);
            j.addObserver(EQQ, "EQQLoginSuccess", R);
            j.addObserver(EQQ.RPCService, "LogoutSuccess", l);
            j.addObserver(EQQ.RPCService, "PollComplete", P);
            j.addObserver(EQQ.RPCService, "CheckProtectSuccess", w);
            j.addObserver(alloy.portal, "UACReady", E);
            g.createContainer();
            EQQ.RPCService.init();
            EQQ.Presenter.MainPanel.init();
            try {
                EQQ.Presenter.ChatBox.init(),
                EQQ.Presenter.TaskBar.init()
            } catch (h) { }
            EQQ.Model.BuddyList.init();
            EQQ.Model.ChatMsg.init();
            EQQ.Presenter.MainPanel.getCookieTips();
            EQQ.Presenter.MainPanel.show();
            e = alloy.portal.getTryLoginState() || "";
            g.login(e)
        };
        this.loginEQQ = function() {
            this.showLogin()
        };
        this.getDefaultState = function() {
            return EQQ.hash.onlineStatus[d.string.mapQuery(window.location.search).login_state || "offline"]
        };
        this.getUserDefaultAvatar = function(l) {
            l = l || 40;
            return alloy.CONST.CDN_URL + "style/images/avatar_default_" + l + "_" + l + ".gif"
        };
        this.getFaceServer = function(l) {
            return EQQ.CONST.AVATAR_SERVER_DOMAINS[l % 10]
        };
        this.getUserAvatar = function(l, e, a) {
            e = "&vfwebqq=" + alloy.portal.getVfWebQQ();
            a && (e = "");
            return EQQ.getFaceServer(l) + "cgi/svr/face/getface?cache=0&type=1&fid=0&uin=" + l + e
        };
        this.getGroupAvatar = function(l) {
            return EQQ.getFaceServer(l) + "cgi/svr/face/getface?cache=0&type=4&fid=0&uin=" + l + "&vfwebqq=" + alloy.portal.getVfWebQQ()
        };
        this.getQzoneUrl = function(l) {
            return EQQ.CONST.QZONE_USER_SERVER_DOMAIN + l
        };
        this.getSendMailUrl = function(l) {
            return "http://mail.qq.com/cgi-bin/login?Fun=clientwrite&vm=pt&email=" + l + "@qq.com"
        };
        this.createContainer = function() {
            this.document = f.getDoc();
            this.container = f.node("div", {
                id: "EQQ_Container",
                "class": "EQQ_Container"
            });
            this.container.innerHTML = '\t\t\t<div id="EQQ_MsgBox" class="EQQ_msgBox">\t\t\t\t<div class="EQQ_titleInMsgBox">\t\t\t\t\t<div class="EQQ_titleTextInMsgBox">\u6d88\u606f\u76d2\u5b50</div>\t\t\t\t\t<div id="EQQ_ViewMainPanelButtonInMsgBox" class="EQQ_viewMainPanelButtonInMsgBox" title="\u70b9\u51fb\u67e5\u770b\u597d\u53cb\u5217\u8868">\u597d\u53cb\u5217\u8868</div>\t\t\t\t</div>\t\t\t\t<div id="EQQ_MessageList" class="EQQ_messageList">\t\t\t\t</div>\t\t\t\t<div id="EQQ_IgnoreAllMsgButtonInMsgBox" class="EQQ_ignoreAllMsgButtonInMsgBox" title="\u70b9\u51fb\u5ffd\u7565\u5168\u90e8\u6d88\u606f">\u5ffd\u7565\u5168\u90e8</div>\t\t\t</div>\t\t\t<div id="EQQ_LoginBox" class="EQQ_LoginBox">\t\t\t\t<div class="EQQ_LoginBox_Title">\t\t\t\t\t<div id="EQQ_LoginBox_CloseButton" class="EQQ_LoginBox_CloseButton" title="\u5173\u95ed">X</div>\t\t\t\t\t<div class="EQQ_LoginBox_TitleText">WebQQ\u767b\u5f55\u4fdd\u62a4</div>\t\t\t\t</div>\t\t\t\t<iframe id="EQQ_LoginBox_Iframe" class="EQQ_LoginBox_Iframe" src="' + alloy.CONST.MAIN_URL + 'domain.html" frameborder="no" scrolling="no"></iframe>\t\t\t</div>\t\t';
            this.document.body.appendChild(this.container)
        };
        this.getCookieSkey = function() {
            return d.cookie.get("skey", EQQ.CONST.MAIN_DOMAIN)
        };
        this.getCookiePtWebQQ = function() {
            return d.cookie.get("ptwebqq", EQQ.CONST.MAIN_DOMAIN)
        };
        this.getVfWebQQ = function() {
            return m
        };
        this.setVfWebQQ = function(l) {
            m = l;
            alloy.portal.setVfWebQQ(l)
        };
        this.getPsessionid = function() {
            return z
        };
        this.getClientKey = function() {
            return q
        };
        this.dna_result_key = "";
        this.login = function(l) {
            EQQ.Presenter.MainPanel.showLogin();
            this.loginStart = (new Date).getTime();
            l = {
                status: l || "online",
                ptwebqq: alloy.portal.getPtwebqq(),
                passwd_sig: this.dna_result_key
            };
            EQQ.RPCService.sendLogin(l)
        };
        var B = function() {
            var l = alloy.config.configList.chatboxMode,
            e = alloy.config.configList.isNotNeedCtrlKey;
            EQQ.initChatboxMode(l);
            EQQ.initSendMsgKey(e);
            alloy.portal.getLoginLevel() > 2 && j.notifyObservers(EQQ, "eqqUacChange", {
                chatboxMode: l,
                isNotNeedCtrlKey: e
            })
        },
        E = function() {
            B()
        },
        w = function(l) {
            l.type == "nop" && EQQ.Presenter.MainPanel.toggleShow()
        },
        x = function(l) {
            if (l) g.dna_result_key = l,
            EQQ.Presenter.MainPanel.toggleShow()
        },
        C = function() {
            EQQ && EQQ.executeExit()
        },
        F = function(l) {
            j.notifyObservers(EQQ, "DesktopSwitch", l)
        };
        this.executeExit = function() {
            try {
                EQQ.View.ChatBox.onExitHotkey()
            } catch (l) { }
            d.cookie.remove("ptwebqq", alloy.CONST.MAIN_DOMAIN);
            j.notifyObservers(EQQ, "CloseWebQQ");
            j.removeObserver(alloy.portal, "DesktopSwitch", F);
            j.removeObserver(alloy.portal, "UACReady", E);
            r = {};
            j.removeObserver(alloy.messageCenter, "MessageHandled", h);
            alloy.messageCenter.removeNotificationsBySource(50);
            EQQ.stopPoll();
            EQQ.logout();
            alloy.portal.removeExitConfirm()
        };
        this.logout = function() {
            d.out("EQQLOGOUT", null, 2);
            EQQ.setIsLogin(!1);
            EQQ.RPCService.sendLogout()
        };
        this.reLogin = function(l) {
            var e = EQQ.Model.BuddyList.getSelf(),
            a = "offline",
            h = "online";
            if (e) a = e.state,
            h = e.oldState || "online";
            a == "offline" && (a = h == "offline" ? "online" : h);
            this.login(l || a)
        };
        var u = function() {
            window.location = alloy.CONST.MAIN_URL + "overload.html"
        },
        s = function() { },
        K = function() {
            window.location = alloy.CONST.MAIN_URL + "overload.html"
        },
        G = function() {
            d.out("onPtwebqqFail");
            M({
                text: "\u767b\u5f55\u5931\u8d25"
            });
            alloy.layout.showLoginWindow("eqq", !0, null, "\u9a8c\u8bc1\u4fe1\u606f\u8fc7\u671f\uff0c\u8bf7\u91cd\u65b0\u767b\u5f55\uff01")
        },
        e = function() {
            var l = {
                status: EQQ.Model.BuddyList.getSelf().state,
                ptwebqq: alloy.portal.getPtwebqq(),
                passwd_sig: g.dna_result_key
            };
            try {
                d.cookie.set("uin", alloy.portal.getOriginalUin(), alloy.CONST.MAIN_DOMAIN),
                d.cookie.set("skey", alloy.portal.getSkey(), alloy.CONST.MAIN_DOMAIN),
                d.cookie.set("ptwebqq", alloy.portal.getPtwebqq(), alloy.CONST.MAIN_DOMAIN)
            } catch (e) { }
            EQQ.RPCService.sendReLink(l)
        },
        n = g.showEQQtips = function(l) {
            if (!g.eqqTips) {
                var e = g.eqqTips = new d.ui.Bubble({
                    closeOnHide: !0
                });
                e.setTitle(l.title);
                e.setContent(l.content);
                e.showButton("ok", "\u767b\u5f55", !0);
                e.showButton("next", "\u53d6\u6d88");
                j.addObserver(e, "onBubbleOkBtnClick",
                function() {
                    l.callback && l.callback();
                    g.eqqTips = null
                });
                j.addObserver(e, "onBubbleClose",
                function() {
                    g.eqqTips = null
                });
                j.addObserver(e, "onBubbleNextBtnClick",
                function() {
                    y();
                    l.cancle && l.cancle()
                });
                e.show({
                    pointerPosition: "bottom right",
                    pointerOffset: 15,
                    pointerSize: [18, 12],
                    target: alloy.taskBar.quickPanel.getQuickButton(50).getElement()
                })
            }
        },
        y = g.hideEQQtips = function() {
            if (g.eqqTips) g.eqqTips.close(),
            g.eqqTips = null
        },
        A = function(l) {
            p = 0;
            g.setVfWebQQ(l.vfwebqq);
            z = l.psessionid;
            y();
            this.startPoll();
            B();
            l = EQQ.Model.BuddyList.getSelf().state;
            j.notifyObservers(EQQ.Model.BuddyList, "SelfStateChange", l)
        },
        H = function() {
            g.stopPoll();
            y();
            j.notifyObservers(g, "SelfOffline", {
                message: "\u8eab\u4efd\u9a8c\u8bc1\u5931\u6548\uff0c\u8bf7\u91cd\u65b0\u767b\u5f55",
                action: "relogin"
            })
        },
        I = function(l) {
            g.stopPoll();
            d.out("reLinkRetryCount: " + p);
            p >= 2 && (n({
                title: "\u8fde\u63a5\u4e2d\u65ad",
                content: "\u56e0\u7f51\u7edc\u6216\u5176\u4ed6\u539f\u56e0\u4e0e\u670d\u52a1\u5668\u5931\u53bb\u8054\u7cfb\uff0c\u6b63\u5728\u5c1d\u8bd5\u91cd\u65b0\u767b\u5f55...",
                callback: function() {
                    c && clearTimeout(c);
                    e()
                },
                cancle: function() {
                    c && clearTimeout(c);
                    EQQ.View.MainPanel.setSelfState("offline")
                }
            }), j.notifyObservers(EQQ.Model.BuddyList, "SelfStateChange", "offline"));
            l && l.hasOwnProperty("t") ? c = setTimeout(function() {
                e()
            },
            (parseInt(l.t) || 0) * 1E3) : l || (c = setTimeout(function() {
                e()
            },
            1E4));
            p++
        },
        Q = function() {
            j.notifyObservers(g, "SelfOffline", {
                message: "\u4f60\u7684\u767b\u5f55\u5df2\u5931\u6548\uff0c\u8bf7\u91cd\u65b0\u767b\u5f55\u3002",
                action: "relogin"
            })
        },
        O = function() {
            j.notifyObservers(g, "SelfOffline", {
                message: "\u56e0\u7f51\u7edc\u6216\u5176\u4ed6\u539f\u56e0\u4e0e\u670d\u52a1\u5668\u5931\u53bb\u8054\u7cfb\uff0c\u8bf7\u91cd\u65b0\u767b\u5f55\u3002",
                action: "relogin"
            })
        },
        l = function() {
            j.notifyObservers(EQQ, "exitSuccess")
        },
        P = function() {
            EQQ.getIsLogin() && typeof EQQ !== "undefined" && EQQ.keepPoll()
        },
        R = function() {
            var l = alloy.app.eqq.getRunOption();
            if (l && l.directChat) {
                var e = l.directChatType,
                a = l.directChat;
                setTimeout(function() {
                    EQQ.handleNotification(a, e) || WebqCore.api.call(["chat", [e, a]])
                },
                500);
                delete l.directChat;
                delete l.directChatType
            }
        },
        J = function(l) {
            d.out("\u767b\u5f55\u7b2c\u4e00\u6b65\u6210\u529f");
            p = 0;
            g.setVfWebQQ(l.vfwebqq);
            z = l.psessionid;
            q = l.clientkey;
            EQQ.setIsLogin(!0);
            j.notifyObservers(alloy.portal, "GetLoginInfoSuccess");
            g.start(l);
            B();
            y();
            d.debug(">>>EQQ.js - onLoginSuccess")
        };
        this.start = function() {
            this.mode = "master";
            d.out("start: " + EQQ);
            EQQ.Global.initGlobal();
            EQQ.Model.BuddyList.reset();
            EQQ.Presenter.MainPanel.View.showPullData();
            alloy.util.report2h("eqqGetData", "start");
            alloy.portal.speedTest.sRTS(14, "start", new Date);
            alloy.portal.speedTest.sRTS(15, "start", new Date);
            EQQ.Extend.require([EQQ.Model.BuddyList.sendGetBuddyList({
                h: "hello"
            }), EQQ.Model.BuddyList.sendGetGroupList()],
            function() {
                hasGetRecentList = !1;
                WebqCore.api.ifDataReady.set(!0);
                r = {};
                j.addObserver(EQQ, "MessageReceive", T);
                j.addObserver(alloy.messageCenter, "MessageHandled", h);
                EQQ.startPoll();
                EQQ.Model.BuddyList.sendGetDiscuList(function() {
                    j.notifyObservers(alloy.portal, "BeforeGetRecentList");
                    EQQ.Model.BuddyList.sendGetRecentList({})()
                });
                alloy.rpcService.sendGetSignature(alloy.portal.getUin());
                alloy.portal.setLoginLevel(alloy.CONST.LOGIN_LEVEL_ALL);
                setTimeout(function() {
                    WebqCore.api.makeCall()
                },
                13);
                alloy.util.report2h("eqqGetData", "end_eqqGetData", "ok");
                alloy.portal.speedTest.sRTS(11, "end", new Date, !0);
                j.notifyObservers(EQQ, "EQQLoginSuccess");
                j.notifyObservers(alloy.portal, "EQQLoginSuccess");
                setTimeout(function() {
                    WebqCore.api.call(["chat", []])
                },
                12E4)
            });
            if (!b) b = !0,
            this.timer = window.setInterval(U, 6E4)
        };
        this.handleNotification = function(l, e) {
            var a = l + e;
            return (a = r[a] && r[a].msgId || 0) ? alloy.messageCenter.handleNotification(a) : !1
        };
        var T = function(l) {
            var e, a = l.uin || l.gid || l.did,
            h;
            for (h in l.msgList) {
                e = l.msgList[h];
                if (!a) a = e.from_uin;
                var P = a + e.type,
                f = !1;
                /(single)|(group)|(discu)/.test(e.type) && (f = !0, r[P] || (r[P] = {
                    count: 1
                }));
                var c = a,
                n = void 0,
                b = void 0,
                b = {
                    uin: c,
                    title: c,
                    content: "",
                    count: 1,
                    t: new Date,
                    type: e.type,
                    time: e.time || d.date.format(new Date, "YYYY-MM-DD hh:mm:ss"),
                    extra: null
                },
                w = alloy.config.configList.notifySetting || alloy.notifier.ENABLE_FLAGS.ENABLE_ALL,
                g = alloy.notifier.translateFlag(["badge", "msg", "sound"]);
                g &= w;
                n = {
                    from: 50,
                    to: g,
                    type: "Unkown",
                    body: b
                };
                switch (e.type) {
                    case "single":
                        var x = WebqCore.api.__api.getChatBox(c);
                        if (x) g = alloy.notifier.translateFlag(["sound", "title", "marquee"]),
                    n.to = g & w;
                        n.type = "SingleChat";
                        b.title = e.sender ? e.sender.htmlShowName || c : c;
                        b.content = EQQ.util.trimChatMsg(e);
                        b.extra = {
                            isChatBoxOpen: x
                        };
                        break;
                    case "group":
                        x = WebqCore.api.__api.getChatBox(c);
                        g = EQQ.Model.BuddyList.isGroupPrompt(c);
                        if (x) if (g) g = alloy.notifier.translateFlag(["title", "marquee", "sound"]),
                    n.to = g & w;
                        else {
                            n = null;
                            break
                        } else if (!g) {
                            n = null;
                            break
                        }
                        n.type = "GroupChat";
                        w = EQQ.Model.BuddyList.getGroupByGid(c);
                        b.code = w.code;
                        b.title = w ? w.htmlShowName || c : c;
                        b.content = EQQ.util.trimChatMsg(e);
                        b.extra = {
                            isChatBoxOpen: x
                        };
                        break;
                    case "discu":
                        x = WebqCore.api.__api.getChatBox(c);
                        g = EQQ.Model.BuddyList.isDiscuPrompt(c);
                        if (x) if (g) g = alloy.notifier.translateFlag(["title", "marquee", "sound"]),
                    n.to = g & w;
                        else {
                            n = null;
                            break
                        } else if (!g) {
                            n = null;
                            break
                        }
                        n.type = "DiscuChat";
                        w = EQQ.Model.BuddyList.getDiscuById(c);
                        b.title = w ? w.htmlName || c : c;
                        b.content = EQQ.util.trimChatMsg(e);
                        b.extra = {
                            isChatBoxOpen: x
                        };
                        break;
                    case "add_buddy":
                        n.type = "BuddyAdd";
                        b.content = e.content;
                        b.title = e.title;
                        b.extra = e.opt;
                        break;
                    case "join_group":
                        n.type = "GroupJoin";
                        b.content = e.content;
                        b.title = e.title;
                        b.extra = e.opt;
                        break;
                    default:
                        n = null
                }
                if (e = n) {
                    if (f) e.body.count = r[P].count++;
                    e = alloy.messageCenter.notify(e);
                    if (f) r[P].msgId = e
                } else f && (r[P] = null)
            }
        },
        h = function(l) {
            var e = l.body;
            r[e.uin + e.type] = null;
            switch (l.type) {
                case "SingleChat":
                    WebqCore.api.call(["chat", ["single", e.uin]]);
                    break;
                case "GroupChat":
                    d.profile("EQQ.onNotifyHasHandled - group.code: " + e.code);
                    WebqCore.api.call(["chat", ["group", e.code]]);
                    break;
                case "DiscuChat":
                    d.profile("EQQ.onNotifyHasHandled - group.code: " + e.uin);
                    WebqCore.api.call(["chat", ["discu", e.uin]]);
                    break;
                case "BuddyAdd":
                    alloy.portal.runApp("buddyAdder", e.extra);
                    break;
                case "GroupJoin":
                    alloy.portal.runApp("groupSystemMsg", e.extra)
            }
        },
        M = function(l) {
            EQQ.setIsLogin(!1);
            d.out("\u5bf9\u4e0d\u8d77\uff0c\u767b\u5f55\u5931\u8d25\uff01");
            alloy.portal.setLoginLevel(alloy.CONST.LOGIN_LEVEL_NOCHAT);
            EQQ.Presenter.MainPanel.showReLoginPanel(l.text)
        },
        L = 0,
        U = function() {
            L > 240 && (L = 0);
            j.notifyObservers(EQQ, "NotifyBeat_1");
            L % 2 == 0 && j.notifyObservers(EQQ, "NotifyBeat_2");
            L % 5 == 0 && (j.notifyObservers(EQQ, "NotifyBeat_5"), L % 10 == 0 && (j.notifyObservers(EQQ, "NotifyBeat_10"), L % 30 == 0 && (j.notifyObservers(EQQ, "NotifyBeat_30"), L % 60 == 0 && (j.notifyObservers(EQQ, "NotifyBeat_60"), L % 120 == 0 && (j.notifyObservers(EQQ, "NotifyBeat_120"), L % 240 == 0 && j.notifyObservers(EQQ, "NotifyBeat_240"))))));
            L++
        },
        V,
        N = 0,
        S = !1,
        Y = 0;
        this.startBeat2 = function() {
            S = !0;
            N = 0;
            V = window.setInterval(ja, 250);
            d.out(">>>>>>>>>: startBeat2")
        };
        this.stopBeat = function() {
            this.stopBeat2();
            window.clearInterval(this.timer);
            this.timer = null
        };
        this.stopBeat2 = function() {
            S = !1;
            window.clearInterval(V);
            N = 0;
            V = null;
            d.out(">>>>>>>>>: stopBeat2")
        };
        this.isStartBeat2 = function() {
            return S
        };
        this.addNeedBeat2 = function(l) {
            a[l] || (a[l] = !0, Y++);
            EQQ.isStartBeat2() || EQQ.startBeat2()
        };
        this.removeNeedBeat2 = function(l) {
            a[l] && (Y > 0 && Y--, delete a[l]);
            Y === 0 && EQQ.stopBeat2()
        };
        var ja = function() {
            N > 5E3 && (N = 0);
            j.notifyObservers(EQQ, "NotifyBeat_250");
            N % 2 == 0 && (j.notifyObservers(EQQ, "NotifyBeat_500"), N % 6 == 0 && j.notifyObservers(EQQ, "NotifyBeat_1000"), N % 10 == 0 && (j.notifyObservers(EQQ, "NotifyBeat_3000"), N % 20 == 0 && j.notifyObservers(EQQ, "NotifyBeat_5000")));
            N++
        };
        this.startPoll = function() {
            this.setNeedPollFlag(!0);
            this.keepPoll();
            EQQ.RPCService.pollWatcher.startWatch()
        };
        this.keepPoll = function() {
            this.getNeedPollFlag() && EQQ.RPCService.sendPoll()
        };
        this.setNeedPollFlag = function(l) {
            return i = l
        };
        this.getNeedPollFlag = function() {
            return i
        };
        this.stopPoll = function() {
            this.setNeedPollFlag(!1);
            EQQ.RPCService.pollWatcher.stopWatch()
        };
        this.setIsLogin = function(l) {
            o = l
        };
        this.getIsLogin = function() {
            return o
        };
        this.getChatboxMode = function() {
            return g.chatboxMode ? g.chatboxMode : "free"
        };
        this.getSendMsgKey = function() {
            return g.isNotNeedCtrlKey
        };
        this.setSendMsgKey = function(l) {
            g.isNotNeedCtrlKey = l;
            alloy.rpcService.sendSetConfig({
                context: this,
                data: {
                    retype: 1,
                    r: {
                        appid: qqweb.config.__eqqid,
                        value: {
                            isNotNeedCtrlKey: l
                        }
                    }
                }
            });
            alloy.hotkeyManager.setSendHotKey(l)
        };
        this.initSendMsgKey = function(l) {
            g.isNotNeedCtrlKey = l
        };
        this.initChatboxMode = function(l) {
            g.chatboxMode = l
        };
        this.setChatboxMode = function(l) {
            g.chatboxMode = l;
            alloy.rpcService.sendSetConfig({
                context: this,
                data: {
                    retype: 1,
                    r: {
                        appid: qqweb.config.__eqqid,
                        value: {
                            chatboxMode: l
                        }
                    }
                }
            })
        };
        this.getLoadLoginScript = function() {
            return this.isLoadEqqScript
        };
        this.setLoadLoginScript = function(l) {
            this.isLoadEqqScript = l
        };
        this.videoNotify = function(l) {
            d.profile("videoNotify", "video");
            var e = l.type,
            a = l.uin;
            if (e && a) switch (e) {
                case "msg":
                    EQQ.Presenter.ChatBox.appendVideoMsg(l.uin, l.context);
                    break;
                case "setVideoId":
                    d.profile("setVideoId" + l.context, "video");
                    EQQ.Presenter.ChatBox.setVideoId(a, l.context);
                    break;
                case "pop":
                    EQQ.Presenter.ChatBox.popVideoWindow(a);
                    break;
                case "inner":
                    EQQ.Presenter.ChatBox.innerVideoWindow(a);
                    break;
                case "close":
                    l.context && EQQ.Presenter.ChatBox.appendVideoMsg(l.uin, l.context),
                EQQ.Presenter.ChatBox.closeVideo(l.uin)
            }
        };
        this.sendMsg = function(l, e) {
            EQQ.Model.ChatMsg.sendMsg({
                type: "single",
                to: l,
                content: [e],
                isIgnoreHistory: !0
            })
        }
    })
})(); (function() {
    WebqCore.register("EQQ.util",
    function(d) {
        var g = d.dom,
        f = d.string,
        j = {},
        t = 1,
        b = function(b, g) {
            var o = null;
            if (b.from_uin && b.msg_id && b.raw_time && (o = String(b.from_uin) + String(b.msg_id) + String(b.raw_time), j[o])) return j[o];
            var i = "";
            if (g) for (var r = 0; r < b.content.length; r++) {
                var k = b.content[r];
                if (k[0] === "face") i += a(k[1]);
                else if (k[0] === "cface") i += b.type == "group" || b.type == "discu" ? p(k[2]) : p(k[1]);
                else if (k[0] === "cface_idx") i += b.type == "group" || b.type == "discu" ? p(k[2]) : p(k[1]);
                else if (k[0] !== "pic_id" && k[0] !== "image") if (k[0] === "offpic") {
                    var D = EQQ.Model.ChatMsg.getSendPicUrlByFilePath(k[1]);
                    D != "" && (i += '<img src="' + D + '" id="cface_' + t++ + '" title="\u56fe\u7247\u6216\u81ea\u5b9a\u4e49\u8868\u60c5" />')
                } else k[0] === "rffile" ? i += '<div class="msgFileBox">\u60a8\u62d2\u7edd\u63a5\u6536"' + f.encodeHtmlSimple(k[1]) + '",\u6587\u4ef6\u4f20\u8f93\u5931\u8d25.</div>' : k[0] === "agfile" ? i += '<div class="msgFileBox">\u60a8\u540c\u610f\u4e86\u63a5\u6536\u6587\u4ef6"' + f.encodeHtmlSimple(k[1]) + '".</div>' : k[0] === "sendfile" ? i += '<div class="msgFileBox">\u60a8\u53d1\u9001\u6587\u4ef6"' + f.encodeHtmlSimple(k[1]) + '"\u7ed9\u5bf9\u65b9.</div>' : k[0] === "transtimeout" ? i += '<div class="msgFileBox">\u63a5\u6536\u6587\u4ef6"' + f.encodeHtmlSimple(k[1]) + '"\u8d85\u65f6,\u6587\u4ef6\u4f20\u8f93\u5931\u8d25.</div>' : k[0] === "refusedbyclient" ? i += '<div class="msgFileBox">\u5bf9\u65b9\u53d6\u6d88\u4e86\u63a5\u6536\u6587\u4ef6"' + f.encodeHtmlSimple(k[1]) + '",\u6587\u4ef6\u4f20\u8f93\u5931\u8d25.</div>' : k[0] === "transok" ? i += '<div class="msgFileBox">\u6587\u4ef6"' + f.encodeHtmlSimple(k[1]) + '"\u4f20\u8f93\u6210\u529f.</div>' : k[0] === "transerror" ? i += '<div class="msgFileBox">\u5bf9\u65b9\u53d6\u6d88\u4e86\u63a5\u6536\u6587\u4ef6"' + f.encodeHtmlSimple(k[1]) + '"\u6216\u4f20\u8f93\u9519\u8bef,\u6587\u4ef6\u4f20\u8f93\u5931\u8d25.</div>' : d.isArray(k) || (i += m(f.encodeHtmlSimple(m(k, 1)), 2))
            } else {
                var r = b.sender_uin || b.from_uin,
                D = b.from_uin || 0,
                B = [],
                E,
                w,
                x;
                for (x = b.content[0][0] !== "font" ? 0 : 1; x < b.content.length; x++) if (k = b.content[x], d.isString(k) && k.substr(0, 4) === "\u3000  \u3000") b.content[0] = [],
                k = "",
                d.platform.iPad && (k = "\u4f46\u60a8\u4f7f\u7528\u7684\u8bbe\u5907\u4e0d\u652f\u6301\u89c6\u9891\u901a\u8bdd\u529f\u80fd\u3002"),
                i += '<div class="msgFileBox">\u5bf9\u65b9\u5411\u60a8\u53d1\u8d77\u89c6\u9891\u9080\u8bf7\u3002' + k + "</div>";
                else if (k[0] === "video") i += '<div class="msgFileBox">' + k[1] + "</div>";
                else if (k[0] === "face") i += a(k[1]);
                else if (k[0] === "cface") if (B.push(k), b.type == "group" || b.type == "discu") {
                    var C = b.group_code || EQQ.Model.BuddyList.decodeDid(b.did),
                    k = k[1],
                    F = b.sender_uin,
                    u = b.raw_time,
                    s = b.group_code ? 0 : 1,
                    K = k.server.toString().split(":"),
                    k = '<img src="' + EQQ.CONST.CHAT_PIC_SERVER + "cgi-bin/get_group_pic?type=" + s + "&gid=" + C + "&uin=" + F + "&rip=" + K[0] + "&rport=" + K[1] + "&fid=" + k.file_id + "&pic=" + k.name + "&vfwebqq=" + alloy.portal.getVfWebQQ() + "&t=" + u + '" id="_cface_' + t++ + '" title="\u56fe\u7247\u6216\u81ea\u5b9a\u4e49\u8868\u60c5" />';
                    i += k
                } else i += c(b.msg_id, k[1], r),
                alloy.util.report2m(133157),
                alloy.util.report2m(133158);
                else if (k[0] === "cface_idx") b.type == "group" || b.type == "discu" ? (C = b.group_code || EQQ.Model.BuddyList.decodeDid(b.did), k = B[k[1]][1], F = Math.round((new Date).getTime() / 1E3), k = '<img src="' + EQQ.CONST.AVATAR_SERVER_DOMAIN + "cgi/svr/chatimg/get?pic=" + k.name + "&gid=" + C + "&time=" + F + '" id="_cface_' + t++ + '" title="\u56fe\u7247\u6216\u81ea\u5b9a\u4e49\u8868\u60c5" />', i += k) : i += c(b.msg_id, B[k[1]][1], r);
                else if (k[0] === "pic_id") C = EQQ.Model.BuddyList.getUserByUin(r),
                !C.type || C.type == "groupBuddy" ? w = !0 : E = k[1];
                else if (k[0] === "image") w ? i += "\u3010\u56fe\u7247\u3011\uff08\u5bf9\u65b9\u53d1\u9001\u4e86\u4e00\u5f20\u56fe\u7247\uff0cWebQQ\u4e34\u65f6\u4f1a\u8bdd\u6682\u4e0d\u652f\u6301\u63a5\u6536\uff09" : (i += '<img rdata="image" src="' + EQQ.CONST.CONN_SERVER_DOMAIN + "channel/get_image2?lcid=" + b.msg_id + "&guid={" + E + "}" + k[2] + "." + k[1] + "&to=" + r + "&count=1&time=1&psessionid=" + EQQ.getPsessionid() + "&clientid=" + EQQ.Model.ChatMsg.getClientidFromRpc() + '" id="_cface_' + t++ + '" title="\u56fe\u7247\u6216\u81ea\u5b9a\u4e49\u8868\u60c5" />', alloy.util.report2m(133153), alloy.util.report2m(133154));
                else if (k[0] === "offpic") i += k[1].success == 1 ? '<img rdata="offpic" src="' + EQQ.CONST.CONN_SERVER_DOMAIN + "channel/get_offpic2?file_path=" + k[1].file_path + "&f_uin=" + D + "&clientid=" + EQQ.Model.ChatMsg.getClientidFromRpc() + "&psessionid=" + EQQ.getPsessionid() + '" id="_cface_' + t++ + '" title="\u56fe\u7247\u6216\u81ea\u5b9a\u4e49\u8868\u60c5" />' : '<img src="style/images/img_error.gif" title="\u56fe\u7247\u6216\u81ea\u5b9a\u4e49\u8868\u60c5\u63a5\u6536\u9519\u8bef\u6216\u4e0d\u5b58\u5728" />',
                alloy.util.report2m(133167);
                else if (k[0] === "rfile") {
                    C = b.from_uin + "_" + k[2];
                    F = EQQ.Model.ChatMsg.getFilesList();
                    i += '<div class="msgFileBox">\u5bf9\u65b9\u7ed9\u60a8\u53d1\u9001\u6587\u4ef6:<br />';
                    u = k[1];
                    if (typeof u == "undefined" || u == "") u = void 0;
                    else switch (u = u.split("."), u = u[u.length - 1].toLowerCase(), u) {
                        case "excel":
                        case "xls":
                        case "xlsx":
                            u = "excel";
                            break;
                        case "doc":
                        case "docx":
                            u = "word";
                            break;
                        case "ppt":
                        case "pptx":
                            u = "ppt";
                            break;
                        case "bmp":
                        case "png":
                        case "gif":
                        case "jpeg":
                        case "jpg":
                        case "ico":
                            u = "pic";
                            break;
                        case "tga":
                        case "tif":
                        case "psd":
                        case "tiff":
                            u = "pic";
                            break;
                        case "mov":
                        case "avi":
                        case "mpeg":
                        case "mpg":
                        case "ra":
                        case "rm":
                        case "rmvb":
                        case "qt":
                        case "asf":
                        case "wmv":
                        case "swf":
                        case "flv":
                        case "mp4":
                            u = "media";
                            break;
                        case "mp3":
                        case "wav":
                        case "mid":
                            u = "music";
                            break;
                        case "arj":
                        case "rar":
                        case "zip":
                        case "jar":
                        case "7z":
                        case "tar":
                        case "uc2":
                        case "gz":
                        case "lha":
                        case "ace":
                        case "tgz":
                            u = "rar-zip";
                            break;
                        case "txt":
                        case "text":
                            u = "share-txt";
                            break;
                        case "pdf":
                            u = "pdf16";
                            break;
                        case "com":
                            u = "exe16";
                            break;
                        default:
                            u = "others"
                    }
                    i += '<span class="icon_' + u + '"> </span>' + f.encodeHtmlSimple(k[1]);
                    i += '<span class="fileAct">';
                    F[C].isread ? i += " [\u540c\u610f][\u62d2\u7edd]" : (i += ' <a id="agree_' + C + '" href="#">[\u540c\u610f]</a>', i += ' <a id="refuse_' + C + '" href="#">[\u62d2\u7edd]</a>');
                    i += "</span>";
                    i += "</div>"
                } else k[0] === "rffile" ? i += '<div class="msgFileBox">\u5bf9\u65b9\u53d6\u6d88\u4e86\u63a5\u6536\u6587\u4ef6"' + f.encodeHtmlSimple(k[1]) + '",\u6587\u4ef6\u4f20\u8f93\u5931\u8d25.</div>' : k[0] === "rtfile" ? i += '<div class="msgFileBox">\u63a5\u6536\u6587\u4ef6"' + f.encodeHtmlSimple(k[1]) + '"\u8d85\u65f6,\u6587\u4ef6\u4f20\u8f93\u5931\u8d25.</div>' : k[0] === "wrfile" ? i += '<div class="msgFileBox">\u5bf9\u65b9\u5df2\u540c\u610f\u63a5\u6536"' + f.encodeHtmlSimple(k[1]) + '",\u5f00\u59cb\u4f20\u8f93\u6587\u4ef6.</div>' : k[0] === "wrffile" ? i += '<div class="msgFileBox">\u5bf9\u65b9\u62d2\u7edd\u4e86\u63a5\u6536\u6587\u4ef6"' + f.encodeHtmlSimple(k[1]) + '",\u6587\u4ef6\u4f20\u8f93\u5931\u8d25.</div>' : k[0] === "cvideo" ? (i += f.encodeHtmlSimple(k[1]), i += ' <a id="video_' + b.attach.from_uin + "_" + b.attach.msg_id + '" fromuin="' + b.attach.from_uin + '" href="###">\u53d1\u8d77\u89c6\u9891</a>') : i += k[0] === "video" ? f.encodeHtmlSimple(k[1]) : m(f.encodeHtmlSimple(m(k, 1)), 2)
            }
            i = i.replace(/\r\n|\r|\n/ig, "<br />");
            o && (j[o] = i);
            return i
        },
        a = function(a) {
            return '<img class="EQQ_faceImg" src="' + EQQ.CONST.SYSTEM_FACE_URL + EQQ.CONST.T_TRANSFER_TABLE[a] + '.gif" />'
        },
        c = function(a, d, b, c) {
            return '<img rdata="cface" src="' + EQQ.CONST.CONN_SERVER_DOMAIN + "channel/get_cface2?lcid=" + a + "&guid=" + d + "&to=" + b + "&count=" + (c || 5) + "&time=1&clientid=" + EQQ.RPCService.getClientId() + "&psessionid=" + EQQ.getPsessionid() + '" id="_cface_' + t++ + '" title="\u56fe\u7247\u6216\u81ea\u5b9a\u4e49\u8868\u60c5" />'
        },
        p = function(a) {
            return '<img src="' + EQQ.CONST.CONN_SERVER_DOMAIN2 + "cgi-bin/webqq_app/?cmd=2&bd=" + a + '" id="_cface_' + t++ + '" title="\u56fe\u7247\u6216\u81ea\u5b9a\u4e49\u8868\u60c5" />'
        },
        m = function(a, d) {
            if (d === 2) var b = /\[url\][\s\S]+?\[(\/|/)url\]/g,
            a = a.replace(b,
            function(a) {
                a = a.replace(/(\[url\]|\[(\/|/)url\])/g, "");
                return '<a href="' + a.replace(/^www\./,
                function(a) {
                    return "http://" + a
                }) + '" class="chatLink" target="_blank"><span class="msgLink">' + a + "</span></a>"
            });
            else b = /((([a-zA-Z0-9]{3,10})?:\/\/)|(www\.)){1}[\w\.\/\?=%&@:#;\*\$\[\]\(\){}'"\-]+([0-9a-zA-Z\/#])+?/g,
            a = a.replace(b,
            function(a) {
                return "[url]" + a + "[/url]"
            });
            return a
        };
        this.transUrl = m;
        this.translateFontStyle = function(a) {
            if (a[0] === "font") {
                var b = a[1].style,
                c = d.string.encodeHtmlAttributeSimple(a[1].name + ""),
                c = (c = c.match(/\u5b8b\u4f53|\u9ed1\u4f53|\u96b6\u4e66|\u5fae\u8f6f\u96c5\u9ed1|\u6977\u4f53_GB2312|\u5e7c\u5706|Arial Black|Arial|Verdana|Times New Roman/)) ? c[0] : "\u5b8b\u4f53",
                f = a[1].color.match(/([0-9a-f]{6})/),
                f = f ? f[0] : "000";
                return "color:#" + f + ";font-family:" + c + ";font-size:" + Number(a[1].size) + "pt;font-weight:" + (b[0] ? "bold" : "normal") + ";font-style:" + (b[1] ? "italic" : "normal") + ";text-decoration:" + (b[2] ? "underline" : "none") + ";"
            } else return ""
        };
        this.translateChatMsg = b;
        this.trimChatMsg = function(a) {
            var a = b(a),
            a = a.replace(/^(<br \/>| )+/ig, ""),
            a = a.replace(/(<a([^>]+)>|<\/a>)/ig, ""),
            a = a.replace(/<div class="msgFileBox">([\s\S]+?)<\/div>/ig,
            function(a) {
                a = a.replace(/(<span([\s\S]+?)<\/span>)+?/ig, "");
                a = a.replace(/(:<br \/>)+?/ig, ":");
                return a.replace(/(<div([^>]+?)>|<\/div>)+/ig, "")
            }),
            d = a.indexOf("<br />");
            d != -1 && (a = a.substr(0, d));
            a = a.replace(/( )+$/ig, "");
            return a = a.replace(/<img.*?\/?>/ig,
            function(a) {
                return /class="EQQ_faceImg"/.test(a) ? a : '<img src="' + alloy.CONST.CDN_URL + 'style/images/image_icon.png?t=1" />'
            })
        };
        this.transResendMsg = function(a) {
            for (var a = d.json.parse(a.content), b = "", c = 0; c < a.length; c++) {
                var g = a[c];
                if (d.isArray(g)) if (g[0] == "face") b += "[\u56fe\u7247]";
                else {
                    if (g[0] == "cface" || g[0] == "offpic") b += "[\u56fe\u7247]"
                } else g == "\n" || g == " " || (b += g)
            }
            b = b.replace(EQQ.CONST.WEBQQMSGTIPS, "");
            b.length > 20 && (b = f.cutByBytes(b.toString(), 20) + "...");
            return f.encodeHtmlSimple(b)
        };
        this.Marquee = new d.Class({
            init: function(a) {
                var b = this;
                this.speed = a.speed || 40;
                this.stopTime = a.stopTime || 3E3;
                this.lineHeight = a.lineHeight || 20;
                this.target = a.target;
                this.intervaler = this.lineTimer = this.timer = null;
                this.scrollHeight = this.lineHeight;
                this.isStop = !1;
                this._onTimeRun = function() {
                    b.scrollOneLine()
                }
            },
            scrollOneLine: function() {
                if (this.scrollHeight > 0) {
                    this.scrollHeight--;
                    var a = this.target.style.top.match(/-?\d+/),
                    a = !a ? 0 : parseInt(a[0]);
                    this.target.style.top = --a + "px";
                    this.lineTimer = setTimeout(this._onTimeRun, this.speed)
                } else this.isStop || this.update()
            },
            stop: function() {
                this.timer && clearTimeout(this.timer)
            },
            stopAll: function() {
                this.stop();
                this.lineTimer && clearTimeout(this.lineTimer)
            },
            reset: function() {
                this.target.style.top = "0px"
            },
            update: function() {
                if (!this.isStop) {
                    this.timer && clearTimeout(this.timer);
                    this.scrollHeight = this.lineHeight;
                    var a = this.target.style.top.match(/\d+/),
                    b = g.getScrollHeight(this.target);
                    if (a && b && (a = parseInt(a[0]), a >= b)) {
                        this.target.style.top = this.lineHeight + "px";
                        this.scrollOneLine();
                        return
                    }
                    this.timer = setTimeout(this._onTimeRun, this.stopTime)
                }
            },
            walkOnLastLine: function() {
                this._onTimeRun()
            }
        })
    })
})(); (function() {
    WebqCore.register("EQQ.RPCService",
    function(d) {
        function g() {
            var a = this;
            this.pollRequst = void 0;
            this.POLLTICK = 0;
            this._check = function() {
                a.check()
            }
        }
        var f = this,
        j = this,
        t = d.dom,
        b = d.event; (new Date).getTime();
        var a = 0,
        c = String(d.random(0, 99)) + String((new Date).getTime() % 1E6),
        p = 0,
        m = !1,
        z = 0,
        q = EQQ.CONST.CONN_SERVER_DOMAINS[0],
        o,
        i = function() {
            return function(a, b) {
                try {
                    if (arguments.length == 2) return !b || arguments.callee(a);
                    else {
                        var d = alloy.portal.getUin();
                        if (a.status) var c = [d, a.status, a.responseText.replace(/[\r\t\n\s]/g, "") + ":", decodeURIComponent(a.data), a.uri].join("{1}quot;);
                        else a = a.o,
                        c = [d, a.status, a.responseText.replace(/[\r\t\n\s]/g, "") + ":", decodeURIComponent(a.data), a.uri].join("{1}quot;);
                        alloy.rpcService.formSend("http://tj.qstatic.com/log", {
                            method: "POST",
                            data: {
                                r: c.replace(/,"/g, ":").replace(/[{"}]/g, "")
                            }
                        })
                    }
                } catch (f) { }
            }
        },
        i = i(),
        r = function() {
            a++;
            d.out("onFail: " + a);
            a > 4 && (a = 0, b.notifyObservers(f, "FailCountOverMax"))
        },
        k = !1,
        D = [],
        B;
        this.onAjaxFrameLoad = function() {
            d.out(B.readyState, null, 1);
            if (o = window.frames.EQQ_ProxySendIframe.ajax) {
                m = !1;
                for (var a = 0; a < D.length; ++a) {
                    var b = 0 % EQQ.CONST.CONN_PROXY_URLS.length,
                    c = D[a].url;
                    if (c.indexOf(EQQ.CONST.CONN_SERVER_DOMAINS[b]) == -1) c = c.replace(/http:\/\/.*.com\//, ""),
                    D[a].url = EQQ.CONST.CONN_SERVER_DOMAINS[b] + c;
                    c = D[a].url;
                    b = D[a].option;
                    try {
                        return E(c, b)
                    } catch (f) {
                        d.out("eqq ajax\u4ee3\u7406\u51fa\u9519\uff1a" + c + " " + EQQ.CONST.CONN_PROXY_URL);
                        if (!b.onError) break;
                        c = {};
                        c.arguments = b.arguments || {};
                        b.onError.call(b.context, c)
                    }
                }
            } else a = EQQ.CONST.CONN_PROXY_URLS[0],
            a += (/\?/.test(a) ? "&" : "?") + "callback=2",
            B.setAttribute("src", a)
        };
        var E = function(a, b) {
            b = b || {};
            b.cacheTime = b.cacheTime || 0;
            b.onSuccess = b.onSuccess ||
            function() { };
            b.onError = b.onError ||
            function() { };
            b.onTimeout = b.onTimeout ||
            function() { };
            b.onComplete = b.onComplete ||
            function() { };
            var f = {
                method: b.method || "GET",
                enctype: b.enctype || "",
                data: b.data || {},
                arguments: b.arguments || {},
                context: b.context || null,
                timeout: b.timeout,
                onSuccess: function(a) {
                    var c = {},
                    f = !1;
                    a.responseText = a.responseText || "-";
                    try {
                        c = d.json.parse(a.responseText)
                    } catch (e) {
                        a.responseText += ":BJF:",
                        f = !0,
                        d.out("JSON\u683c\u5f0f\u51fa\u9519:" + e)
                    } finally {
                        c.arguments = b.arguments || {},
                        c.o = a,
                        b.onSuccess.call(b.context, c, f)
                    }
                },
                onError: function(a) {
                    b.onError.call(b.context, a)
                },
                onTimeout: function() {
                    var a = {};
                    a.arguments = b.arguments || {};
                    b.onTimeout.call(b.context, a)
                },
                onComplete: function() {
                    var a = {};
                    a.arguments = b.arguments || {};
                    b.onComplete.call(b.context, a)
                }
            };
            f.data.clientid = c;
            f.data.psessionid = EQQ.getPsessionid();
            if (m) f.onError();
            else {
                alloy.portal.recoverCookie();
                f.data = d.string.toQueryString(f.data);
                if (f.method == "GET") {
                    var g = f.data;
                    b.cacheTime === 0 && (g += g ? "&t=" + (new Date).getTime() : "t=" + (new Date).getTime());
                    if (g) {
                        var k = alloy.portal.getVfWebQQ();
                        k && !/channel/ig.test(a) && (g += "&vfwebqq=" + k);
                        a = a + "?" + g
                    }
                    f.data = null
                } else f.contentType = "application/x-www-form-urlencoded",
                a.indexOf("?");
                return o(a, f)
            }
        };
        this._proxy = o;
        g.prototype = {
            pollStop: function() {
                d.out("a poll Over...");
                this.pollRequst = null;
                this.POLLTICK = 0;
                this.timer = null
            },
            check: function() {
                d.out("check...");
                this.pollRequst == null && (d.out("Oooops, somethingWrong..."), this.POLLTICK++, this.POLLTICK == 1 && setTimeout(this._check, 5E3));
                if (this.POLLTICK == 2) d.out("Oooops, send..."),
                alloy.rpcService.formSend("http://tj.qstatic.com/log", {
                    method: "POST",
                    data: {
                        j: "unwanted-poll-stop"
                    }
                }),
                this.POLLTICK = 0
            },
            startWatch: function() {
                d.out("start...");
                try {
                    b.addObserver(EQQ, "NotifyBeat_2", this._check)
                } catch (a) { }
                this.POLLTICK = 0
            },
            stopWatch: function() {
                d.out("stop...");
                try {
                    b.removeObserver(EQQ, "NotifyBeat_2", this._check)
                } catch (a) { }
                this.POLLTICK = 0
            }
        };
        this.pollWatcher = new g;
        this.init = function() { };
        this.getClientId = function() {
            return c
        };
        this.send = function(a, b) {
            if (o) return E(a, b);
            else if (D.push({
                url: a,
                option: b
            }), !k) {
                k = !0;
                var d = document.body,
                c = t.node("div");
                c.innerHTML = '<iframe id="EQQ_ProxySendIframe" class="hiddenIframe" name="EQQ_ProxySendIframe" width="1" height="1" src="' + alloy.CONST.MAIN_URL + 'domain.html"></iframe>';
                d.appendChild(c);
                B = t.id("EQQ_ProxySendIframe");
                d = EQQ.CONST.CONN_PROXY_URLS[0];
                d += (/\?/.test(d) ? "&" : "?") + "callback=2";
                B.setAttribute("src", d)
            }
        };
        this.sendLogin = function(a) {
            if (window.webTop) a.v = Number(webTop.version) + 1E4;
            a.clientid = c;
            a.psessionid = EQQ.getPsessionid();
            this.send(q + "channel/login2", {
                context: this,
                method: "POST",
                data: {
                    r: d.json.stringify(a)
                },
                onSuccess: this.sendLoginSuccess,
                onError: this.sendLoginError,
                onTimeout: this.sendLoginTimeout
            });
            alloy.util.report2h("eqqLoginCgi", "start");
            alloy.portal.speedTest.sRTS(16, "start", new Date)
        };
        this.sendLoginSuccess = function(a, c) {
            switch (a.retcode) {
                case 0:
                    z = 1;
                    b.notifyObservers(EQQ, "LoginSuccess", a.result);
                    alloy.portal.speedTest.sRTS(4, "start", new Date);
                    alloy.portal.speedTest.sRTS(5, "start", new Date);
                    break;
                case 103:
                    b.notifyObservers(this, "NotLogin", a.result);
                    break;
                case 106:
                    b.notifyObservers(EQQ, "UinNotInWhitelist", a.result);
                    break;
                case 111:
                    b.notifyObservers(EQQ, "UinInBlacklist", a.result);
                    break;
                case 112:
                    b.notifyObservers(EQQ, "Overload", a.result);
                    break;
                case 1E5:
                case 100001:
                case 100002:
                    b.notifyObservers(EQQ, "PtwebqqFail", a.result);
                    break;
                default:
                    d.out("\u672a\u77e5\u767b\u5f55\u5931\u8d25"),
                b.notifyObservers(EQQ, "LoginFailure", {
                    text: "\u8fde\u63a5\u5931\u8d25"
                }),
                d.out("[sendLogin] error: " + a.retcode),
                i(a, !c)
            }
            alloy.util.report2h("eqqLoginCgi", "end_eqqLoginCgi", ["ok"][a.retcode] || a.retcode);
            i(a, c);
            alloy.portal.speedTest.sRTS(16, "end", new Date, !0)
        };
        this.sendLoginError = function(a) {
            d.out("sendLoginError");
            b.notifyObservers(EQQ, "LoginFailure", {
                text: "\u8fde\u63a5\u5931\u8d25"
            });
            alloy.util.report2h("eqqLoginCgi", "end_eqqLoginCgi", "error");
            i(a)
        };
        this.sendLoginTimeout = function(a) {
            d.out("sendLoginError");
            b.notifyObservers(EQQ, "LoginFailure", {
                text: "\u8fde\u63a5\u5931\u8d25"
            });
            alloy.util.report2h("eqqLoginCgi", "end_eqqLoginCgi", "timeout");
            i(a)
        };
        this.sendLogout = function(a) {
            this.send(q + "channel/logout2", {
                context: this,
                data: a,
                onSuccess: function(a) {
                    a.retcode === 0 || a.retcode === 100 ? (z = 0, b.notifyObservers(this, "LogoutSuccess", a.result), d.out(":LogoutSuccess...")) : d.out("[SendLogout] error: " + a.retcode)
                }
            })
        };
        this.sendReLink = function(a) {
            if (window.webTop) a.v = Number(webTop.version) + 1E4;
            a.clientid = c;
            a.psessionid = EQQ.getPsessionid();
            if (f._state) a.status = f._state;
            this.send(q + "channel/login2", {
                context: this,
                method: "POST",
                data: {
                    r: d.json.stringify(a)
                },
                onSuccess: this.sendReLinkSuccess,
                onError: this.sendReLinkError,
                onTimeout: this.sendReLinkTimeout
            })
        };
        this.sendReLinkSuccess = function(a, d) {
            switch (a.retcode) {
                case 0:
                    z = 1;
                    b.notifyObservers(EQQ, "ReLinkSuccess", a.result);
                    break;
                case 103:
                    b.notifyObservers(this, "NotReLogin", a.result);
                    break;
                case 113:
                case 115:
                case 112:
                    b.notifyObservers(EQQ, "ReLinkFailure", a);
                    break;
                default:
                    b.notifyObservers(EQQ, "ReLinkStop"),
                i(a, !d)
            }
            i(a, d)
        };
        this.sendReLinkError = function(a) {
            d.out("sendReLinkError");
            b.notifyObservers(EQQ, "ReLinkFailure");
            i(a)
        };
        this.sendReLinkTimeout = function(a) {
            d.out("sendReLinkTimeout");
            b.notifyObservers(EQQ, "ReLinkFailure");
            i(a)
        };
        this.sendGetOnlineBuddies = function() {
            this.send(q + "channel/get_online_buddies2", {
                context: this,
                data: {},
                onSuccess: function(a, d) {
                    a.retcode === 0 ? b.notifyObservers(this, "GetOnlineBuddiesSuccess", a.result) : i(a, !d);
                    i(a, d)
                },
                onError: function(a) {
                    i(a)
                }
            })
        };
        this.sendMsg = function(a) {
            a.clientid = c;
            a.psessionid = EQQ.getPsessionid();
            this.send(q + "channel/send_buddy_msg2", {
                context: this,
                cacheTime: 0,
                method: "POST",
                data: {
                    r: d.json.stringify(a)
                },
                onSuccess: function(c, f) {
                    c.retcode === 0 ? b.notifyObservers(this, "SendMsgSuccess", c.result) : (d.out("[sendMsg] error: " + c.retcode + "-" + c.errmsg), b.notifyObservers(this, "SendMsgError", {
                        uin: a.to,
                        retcode: c.retcode,
                        errmsg: c.errmsg,
                        callback: EQQ.RPCService.sendMsg,
                        cbParam: a
                    }), i(c, !f));
                    i(c, f)
                },
                onError: function(a) {
                    i(a)
                }
            })
        };
        this.sendGroupMsg = function(a) {
            a.clientid = c;
            a.psessionid = EQQ.getPsessionid();
            this.send(q + "channel/send_qun_msg2", {
                context: this,
                method: "POST",
                data: {
                    r: d.json.stringify(a)
                },
                onSuccess: function(c, f) {
                    c.retcode === 0 ? b.notifyObservers(this, "SendGroupMsgSuccess", c.result) : (d.out("[sendGroupMsg] error: " + c.retcode + "-" + c.errmsg), b.notifyObservers(this, "SendMsgError", {
                        uin: a.group_uin,
                        retcode: c.retcode,
                        errmsg: c.errmsg,
                        callback: EQQ.RPCService.sendGroupMsg,
                        cbParam: a
                    }), i(c, !f));
                    i(c, f)
                },
                onError: function(a) {
                    i(a)
                }
            })
        };
        this.sendPoll = function(a) {
            a = a || {};
            a = a.data || {};
            a.clientid = c;
            a.psessionid = EQQ.getPsessionid();
            a.key = alloy.portal.getSecretKey();
            if (p < z) p++,
            f.pollWatcher.pollRequst = this.send(q + "channel/poll2", {
                context: this,
                cacheTime: 0,
                data: a,
                timeout: 9E4,
                onSuccess: this.sendPollSuccess,
                onError: this.sendPollError,
                onTimeout: this.sendPollTimeout
            })
        };
        this.sendPollSuccess = function(c, g) {
            f.pollWatcher.pollStop(); (new Date).getTime();
            p--;
            if (c.retcode === 0 || c.retcode === 102) {
                a = 0;
                try {
                    b.notifyObservers(this, "PollSuccess", c.result)
                } catch (m) {
                    d.out("PollSuccess, but [PollSuccess notify] error!!!!!!!!!!!!!!!!!!!!!!!!", 1)
                }
                try {
                    b.notifyObservers(this, "PollComplete")
                } catch (k) {
                    d.out("PollComplete, but [PollComplete notify] error!!!!!!!!!!!!!!!!!!!!!!!!", 1)
                }
            } else if (c.retcode === 100) b.notifyObservers(this, "NotReLogin");
            else if (c.retcode === 120) b.notifyObservers(EQQ, "ReLinkFailure", c);
            else if (c.retcode === 121) b.notifyObservers(EQQ, "ReLinkFailure", c);
            else if (c.retcode === 116) alloy.portal.setPtwebqq(c.p),
            b.notifyObservers(this, "PollComplete");
            else {
                try {
                    b.notifyObservers(j, "PollComplete")
                } catch (t) {
                    d.out("PollComplete, but [PollComplete notify] error!!!!!!!!!!!!!!!!!!!!!!!!", 1)
                }
                c.retcode != 109 && c.retcode != 110 && r()
            }
            i(c, g)
        };
        this.sendPollTimeout = function() {
            f.pollWatcher.pollStop();
            p--;
            try {
                b.notifyObservers(this, "PollComplete")
            } catch (a) {
                d.out("PollComplete, but [PollComplete notify] error!!!!!!!!!!!!!!!!!!!!!!!!", 1)
            }
            r()
        };
        this.sendPollError = function(a) {
            this.sendPollTimeout(a);
            i(a)
        };
        this.sendChangeStatus = function(a) {
            a = a || {
                newstatus: "hidden"
            };
            this.send(q + "channel/change_status2", {
                context: this,
                data: a,
                arguments: a,
                onSuccess: function(a, c) {
                    if (a.retcode === 0) b.notifyObservers(this, "ChangeStatusSuccess", a.arguments.newstatus),
                    f._state = a.arguments.newstatus;
                    a.retcode === 108 ? b.notifyObservers(this, "NotReLogin", a.result) : i(a, !c);
                    i(a, c)
                },
                onError: function(a) {
                    i(a)
                }
            })
        };
        this.sendGetSessionSignature = function(a) {
            a.clientid = c;
            a.psessionid = EQQ.getPsessionid();
            this.send(q + "channel/get_c2cmsg_sig2", {
                context: this,
                data: a,
                arguments: a,
                onSuccess: function(c, d) {
                    if (c.retcode === 0) {
                        var f = c.result;
                        f.id = a.service_type === 0 ? a.id : EQQ.Model.BuddyList.encodeDid(a.id);
                        f.uin = a.to_uin;
                        b.notifyObservers(this, "GetSessionSignatureSuccess", f)
                    } else i(c, !d);
                    i(c, d)
                },
                onError: function(a) {
                    i(a)
                }
            })
        };
        this.sendGroupBuddyMsg = function(a) {
            a.clientid = c;
            a.psessionid = EQQ.getPsessionid();
            this.send(q + "channel/send_sess_msg2", {
                context: this,
                method: "POST",
                data: {
                    r: d.json.stringify(a)
                },
                onSuccess: function(c, d) {
                    c.retcode === 0 ? b.notifyObservers(this, "SendMsgSuccess", c.result) : (b.notifyObservers(this, "SendMsgError", {
                        uin: a.to,
                        retcode: c.retcode,
                        errmsg: c.errmsg,
                        callback: EQQ.RPCService.sendGroupBuddyMsg,
                        cbParam: a
                    }), i(c, !d));
                    i(c, d)
                },
                onError: function(a) {
                    i(a)
                }
            })
        };
        this.sendGetCustomFaceList = function() {
            alloy.portal.recoverCookie();
            d.http.loadScript(EQQ.CONST.CONN_SERVER_DOMAIN2 + "cgi-bin/webqq_app/", {
                query: "cmd=1?t=" + (new Date).getTime() + "&vfwebqq=" + alloy.portal.getVfWebQQ(),
                onSuccess: function() {
                    typeof custom_face !== "undefined" ? b.notifyObservers(f, "SendGetCustomFaceListSuccess", custom_face) : f.sendGetCustomFaceList()
                }
            })
        };
        this.sendDeleteCustomFace = function(a) {
            alloy.portal.recoverCookie();
            d.http.loadScript(EQQ.CONST.CONN_SERVER_DOMAIN2 + "cgi-bin/webqq_app/", {
                query: "cmd=12&bd=" + a.img + "&vfwebqq=" + alloy.portal.getVfWebQQ(),
                onSuccess: function() {
                    typeof cface_delete_result !== "undefined" && b.notifyObservers(f, "SendDeleteCustomFaceSuccess", a.callback ||
                    function() { })
                }
            })
        };
        this.sendGetGroupCustomFaceKey = function(a) {
            this.send(q + "channel/get_gface_sig2", {
                context: this,
                arguments: a.arguments,
                onSuccess: function(c, d) {
                    c.retcode === 0 ? b.notifyObservers(this, "SendGetGroupCustomFaceKeySuccess", c) : (b.notifyObservers(this, "SendGetGroupCustomFaceKeyError", {
                        uin: a.to,
                        retcode: c.retcode,
                        errmsg: c.errmsg
                    }), i(c, !d));
                    i(c, d)
                },
                onError: function(a) {
                    i(a)
                }
            })
        };
        this.sendGetGroupCustomFaceInfo = function(a) {
            a.clientid = c;
            a.psessionid = EQQ.getPsessionid();
            this.send(q + "channel/send_qun_msg2", {
                context: this,
                method: "POST",
                data: {
                    r: d.json.stringify(a)
                },
                onSuccess: function(c, d) {
                    c.retcode === 0 ? b.notifyObservers(this, "SendGetGroupCustomFaceInfoSuccess", c) : (b.notifyObservers(this, "SendMsgError", {
                        uin: a.group_uin,
                        retcode: c.retcode,
                        errmsg: c.errmsg,
                        callback: EQQ.RPCService.sendGetGroupCustomFaceInfo,
                        cbParam: a
                    }), i(c, !d));
                    i(c, d)
                },
                onError: function(a) {
                    i(a)
                }
            })
        };
        this.sendGetOfflinePicUrl = function(a) {
            this.send(q + "channel/apply_offline_pic_dl2", {
                context: this,
                data: a,
                onSuccess: function(a, c) {
                    a.retcode === 0 ? (b.notifyObservers(this, "sendGetOfflinePicUrlSuccess", a), alloy.util.report2m(133173)) : (b.notifyObservers(this, "getSendPicUrlError", a), d.out("[sendGetOfflinePicUrlError] error: "), i(a, !c), alloy.util.report2m(133174));
                    i(a, c)
                },
                onError: function(a) {
                    i(a);
                    alloy.util.report2m(133174)
                }
            })
        };
        this.sendRefuseFile = function(a) {
            this.send(q + "channel/refuse_file2", {
                context: this,
                data: a,
                onSuccess: function() { }
            })
        };
        this.sendGetMyAvatarFlag = function(a) {
            a = a || {};
            a.type = 1;
            a.psessionid = EQQ.getPsessionid();
            a.clientid = EQQ.RPCService.getClientId();
            this.send(EQQ.CONST.CONN_SERVER_DOMAIN + "channel/query_user_flag", {
                context: this,
                method: "GET",
                data: a,
                arguments: {},
                onSuccess: function(a) {
                    a.retcode === 0 ? b.notifyObservers(this, "GetMyAvatarFlagSuccess", a) : b.notifyObservers(this, "GetMyAvatarFlagError", a)
                },
                onError: function(a) {
                    b.notifyObservers(this, "GetMyAvatarFlagError", a)
                }
            })
        };
        this.sendDeleteMyAvatarFlag = function(a) {
            a = a || {};
            a.vfwebqq = alloy.portal.getVfWebQQ();
            a.type = 1;
            a.img_id = 0;
            a.psessionid = EQQ.getPsessionid();
            a.clientid = EQQ.RPCService.getClientId();
            this.send(EQQ.CONST.CONN_SERVER_DOMAIN + "channel/del_chead", {
                context: this,
                method: "POST",
                data: {
                    r: d.json.stringify(a)
                },
                arguments: {},
                onSuccess: function(a) {
                    a.retcode === 0 ? b.notifyObservers(this, "DeleteMyAvatarFlagSuccess", a) : b.notifyObservers(this, "DeleteMyAvatarFlagError", a)
                },
                onError: function(a) {
                    b.notifyObservers(this, "DeleteMyAvatarFlagError", a)
                }
            })
        };
        this.sendGroupRequestJoin = function(a, c, b, d) {
            a = a || {};
            this.send(q + "channel/op_group_join_req", {
                context: this,
                data: a,
                arguments: c || {},
                onSuccess: b ||
                function() { },
                onError: d ||
                function() { }
            })
        };
        this.sendGetDiscuList = function(a) {
            a = {};
            a.clientid = EQQ.RPCService.getClientId();
            a.psessionid = EQQ.getPsessionid();
            a.vfwebqq = alloy.portal.getVfWebQQ();
            this.send(EQQ.CONST.CONN_SERVER_DOMAIN + "channel/get_discu_list", {
                context: f,
                data: a,
                arguments: a,
                onSuccess: function(a) {
                    a.retcode === 0 ? (func(), getDiscuListSuccess()) : d.out("\u83b7\u53d6\u7fa4\u6700\u65b0\u4fe1\u606f\u5931\u8d25")
                },
                onError: function() {
                    d.out("\u83b7\u53d6\u7fa4\u6700\u65b0\u4fe1\u606f\u5931\u8d25")
                }
            })
        };
        this.sendDiscuMsg = function(a) {
            a.clientid = c;
            a.psessionid = EQQ.getPsessionid();
            this.send(q + "channel/send_discu_msg2", {
                context: this,
                method: "POST",
                data: {
                    r: d.json.stringify(a)
                },
                onSuccess: function(c, f) {
                    c.retcode === 0 ? c.result.error == 3 ? b.notifyObservers(this, "DiscuNotExist", a) : b.notifyObservers(this, "SendDiscuMsgSuccess", c.result) : (d.out("[sendDiscuMsg] error: " + c.retcode + "-" + c.errmsg), b.notifyObservers(this, "SendMsgError", {
                        uin: EQQ.Model.BuddyList.encodeDid(a.did),
                        retcode: c.retcode,
                        errmsg: c.errmsg,
                        callback: EQQ.RPCService.sendDiscuMsg,
                        cbParam: a
                    }), i(c, !f));
                    i(c, f)
                },
                onError: function(a) {
                    i(a)
                }
            })
        };
        this.sendGetDiscuSessionSignature = function(a) {
            this.send(q + "channel/get_session_sig3", {
                context: this,
                data: {
                    did: a.group_uin,
                    to_uin: a.to_uin
                },
                arguments: {
                    group_uin: a.group_uin,
                    to_uin: a.to_uin
                },
                onSuccess: function(a, c) {
                    a.retcode === 0 ? b.notifyObservers(this, "GetDiscuSessionSignatureSuccess", a) : i(a, !c);
                    i(a, c)
                },
                onError: function(a) {
                    i(a)
                }
            })
        };
        this.sendDiscuBuddyMsg = function(a) {
            a.clientid = c;
            a.psessionid = EQQ.getPsessionid();
            a.service_type = 1;
            this.send(q + "channel/send_sess_msg2", {
                context: this,
                method: "POST",
                data: {
                    r: d.json.stringify(a)
                },
                onSuccess: function(c, d) {
                    c.retcode === 0 ? b.notifyObservers(this, "SendMsgSuccess", c.result) : (b.notifyObservers(this, "SendMsgError", {
                        uin: a.to,
                        retcode: c.retcode,
                        errmsg: c.errmsg,
                        callback: EQQ.RPCService.sendDiscuBuddyMsg,
                        cbParam: a
                    }), i(c, !d));
                    i(c, d)
                },
                onError: function(a) {
                    i(a)
                }
            })
        }
    })
})(); (function() {
    WebqCore.register("EQQ.Model.BuddyList",
    function(d) {
        var g = this,
        f = d.event,
        j, t, b, a, c, p, m, z, q, o, i, r, k, D, B, E, w, x = [],
        C = [];
        discuListReloadCount = 0;
        discuListReloadMax = 1;
        var F = new d.Class({
            init: function(a) {
                this.uin = a.uin;
                this.ruin = a.ruin;
                this.allow = a.allow;
                this.face = a.face;
                this.age = a.age;
                this.gender = a.gender;
                this.vip = a.vip || !1;
                this.clientType = a.clientType || "10000";
                this.setAvatar(EQQ.getUserAvatar(this.uin));
                this.setNick(a.nick || a.ruin || a.uin);
                this.setState(a.state || EQQ.hash.onlineStatus.offline);
                this.did = a.did || "";
                this.chatSession = {};
                this.setClassId(a.classId || 0)
            },
            setClientType: function(a) {
                this.clientType = a || "10000"
            },
            setAvatar: function(a) {
                this.avatarUrl = a;
                f.notifyObservers(EQQ.Model.BuddyList, "AvatarChange", this)
            },
            getAvatar: function() {
                return EQQ.getUserAvatar(this.uin)
            },
            setNick: function(a) {
                if (!a && this.ruin) a = this.ruin;
                this.nick = d.string.toSingleLine(a);
                this.htmlNick = d.string.encodeHtmlSimple(this.nick);
                this.titleNick = this.nick;
                this.updateNames()
            },
            setMarkName: function(a) {
                this.markName = d.string.toSingleLine(a.toString());
                this.htmlMarkName = d.string.encodeHtmlSimple(this.markName.toString());
                this.titleMarkName = d.string.encodeHtmlAttributeSimple(this.markName.toString());
                this.updateNames()
            },
            updateNames: function() {
                this.updateShowName();
                this.updateAllName();
                f.notifyObservers(EQQ.Model.BuddyList, "UserNameChange", this)
            },
            updateShowName: function() {
                this.showName = (this.markName || this.nick || this.ruin || this.uin) + "";
                this.htmlShowName = d.string.encodeHtmlSimple(this.showName.toString());
                this.titleShowName = d.string.encodeHtmlAttributeSimple(this.showName.toString())
            },
            updateAllName: function() {
                var a = this.allName = "";
                this.markName ? (a = this.markName + "(" + this.nick + ")", this.allName = this.markName + "(" + this.nick + ")") : this.allName = a = this.nick;
                this.htmlAllName = d.string.encodeHtmlSimple(this.allName);
                this.titleAllName = d.string.encodeHtmlAttributeSimple(a)
            },
            setClassId: function(a) {
                this.classId = a
            },
            setSignature: function(a) {
                if (a != void 0) this.signature = a,
                this.htmlSignature = d.string.encodeHtmlSimple(a),
                this.titleSignature = d.string.encodeHtmlAttributeSimple(a);
                f.notifyObservers(EQQ.Model.BuddyList, "UserSignatureChange", this)
            },
            getSignature: function() {
                this.signature != void 0 ? this.setSignature() : alloy.rpcService.sendGetSignature(this.uin)
            },
            setQQLevel: function(a) {
                if (a != void 0) this.level = a;
                f.notifyObservers(EQQ.Model.BuddyList, "UserQQLevelChange", this)
            },
            getQQLevel: function() {
                this.level != void 0 ? this.setQQLevel() : alloy.rpcService.sendGetQQLevel(this.uin)
            },
            setState: function(a) {
                this.state = a
            },
            getState: function() {
                return this.state
            },
            setFace: function(a) {
                this.face = a
            },
            setGender: function(a) {
                this.gender = a
            },
            setAllow: function(a) {
                this.allow = a
            },
            setUsercard: function(a, e) {
                this.usercard = this.usercard || {};
                this.usercard[a] = {
                    title: e,
                    htmlAttribute: d.string.encodeHtmlAttributeSimple(e),
                    html: d.string.encodeHtmlSimple(e)
                };
                f.notifyObservers(EQQ.Model.BuddyList, "UserCardChange", this.usercard)
            },
            getUsercard: function(a) {
                this.usercard = this.usercard || {};
                return this.usercard[a]
            }
        }),
        u = new d.Class({
            init: function(a) {
                this.gid = a.gid;
                this.code = a.code;
                this.mask = String(a.mask);
                this.preMask = String(this.mask);
                this.setName(a.name);
                this.setMarkName(a.markName);
                this.setType(a.type);
                this.hasManageAuthority = this.isLoadInfo = !1;
                this.uin2members = {};
                this.level = 0
            },
            setMask: function(a) {
                this.preMask = String(this.mask);
                this.mask = String(a);
                f.notifyObservers(EQQ.Model.BuddyList, "SingleGroupMaskChange", this)
            },
            setName: function(a) {
                this.name = d.string.toSingleLine(a);
                this.htmlName = d.string.encodeHtmlSimple(a);
                this.titleName = d.string.encodeHtmlAttributeSimple(a);
                this.updateNames()
            },
            setMarkName: function(a) {
                if (typeof a == "undefined" || a == "") return !1;
                this.markName = d.string.toSingleLine(a);
                this.htmlMarkName = d.string.encodeHtmlSimple(a);
                this.titleMarkName = d.string.encodeHtmlAttributeSimple(a);
                this.updateNames()
            },
            updateNames: function() {
                this.updateShowName();
                this.updateAllName();
                f.notifyObservers(EQQ.Model.BuddyList, "GroupNameChange", this)
            },
            updateShowName: function() {
                this.showName = this.markName || this.name || String(this.code);
                this.htmlShowName = d.string.encodeHtmlSimple(this.showName);
                this.titleShowName = d.string.encodeHtmlAttributeSimple(this.showName)
            },
            updateAllName: function() {
                var a = "";
                this.allName = "";
                this.markName ? (a = this.markName + "(" + this.name + ")", this.allName = this.markName + "(" + this.name + ")") : (a = this.name, this.allName = this.name + "<" + this.code + ">");
                this.htmlAllName = d.string.encodeHtmlSimple(this.allName);
                this.titleAllName = d.string.encodeHtmlAttributeSimple(a)
            },
            type2text: {
                commonGroup: "\u666e\u901a\u7fa4",
                seniorGroup: "\u9ad8\u7ea7\u7fa4",
                superGroup: "\u8d85\u7ea7\u7fa4",
                expireSuperGroup: "\u8fc7\u671f\u7684\u8d85\u7ea7\u7fa4",
                enterpriseGroup: "\u4f01\u4e1a\u7fa4",
                forbiddenGroup: "\u7981\u7528"
            },
            setType: function(a) {
                this.type = a;
                this.typeText = this.type2text[a] || "\u5176\u4ed6\u7c7b\u578b\u7fa4";
                this.htmlTypeText = d.string.encodeHtmlSimple(this.typeText);
                this.titleTypeText = d.string.encodeHtmlAttributeSimple(this.typeText)
            },
            setLevel: function(a) {
                this.level = a || 0
            },
            setAnnouncement: function(a) {
                if (typeof a != "undefined") this.announcement = a,
                this.htmlAnnouncement = d.string.encodeHtmlSimple(a),
                this.titleAnnouncement = d.string.encodeHtmlAttributeSimple(a),
                f.notifyObservers(g, "GroupAnnouncementChange", this)
            },
            upAnnouncement: function(a) {
                if (typeof a != "undefined") this.announcement = a,
                this.htmlAnnouncement = d.string.encodeHtmlSimple(a),
                this.titleAnnouncement = d.string.encodeHtmlAttributeSimple(a),
                f.notifyObservers(g, "GroupAnnouncementChange", this)
            },
            updateMembers: function(a, e) {
                if (a) this.members = a,
                this.onlineMemberCount = e,
                this.uin2members[a.uin] = a;
                f.notifyObservers(g, "GroupMembersChange", this)
            },
            updateMemberState: function(a) {
                for (var e = a.stats,
                a = this.members,
                c = 0,
                b = {},
                d = [], c = 0; c < e.length; c++) b[e[c].uin] = e[c].stat;
                e = a.length;
                for (c = 0; c < e; c++) {
                    var h = a[c].info,
                    n = h.uin;
                    b[n] = b[n] || 20;
                    if (h.gstate != b[n] && n != j) d.push({
                        uin: n,
                        stat: b[n],
                        oldStat: h.gstate
                    }),
                    h.gstate = b[n]
                }
                f.notifyObservers(g, "GroupMemberStateChange", {
                    t: this,
                    arg: d
                })
            },
            updateMemberCard: function(a) {
                var e = this.members,
                c = !1,
                b;
                for (b in e) {
                    var n = e[b];
                    if (n.uin == a.uin) {
                        a.card == "" ? (this.members[b].usercard = d.string.encodeHtmlSimple(n.nick), this.members[b].info.setUsercard(this.code, n.nick)) : (this.members[b].usercard = d.string.encodeHtmlSimple(a.card), this.members[b].info.setUsercard(this.code, a.card));
                        c = !0;
                        break
                    }
                }
                c && f.notifyObservers(g, "GroupMemberCardChange", {
                    gid: this.gid,
                    gcode: this.code,
                    uin: a.uin
                })
            },
            getMenberByUin: function(a) {
                return this.uin2members[a]
            }
        }),
        s = {
            onSelfInfoReady: function(a) {
                if (g.getSelf()) {
                    var e = g.getSelf();
                    e.setNick(a.nick);
                    e.setFace(a.face);
                    e.setGender(a.gender);
                    e.setAllow(a.allow);
                    e.vip = a.vip;
                    e.age = a.age
                } else g.setSelf(a)
            },
            onSelfInfoChanged: function(a) {
                var e = g.getSelf();
                e.setNick(a.nick);
                e.setGender(a.gender)
            },
            onGetUserInfoSuccess: function(a) {
                var e = a.result;
                if (e) {
                    var c = g.getUserByUin(a.arguments.uin);
                    c ? (c.setNick(e.nick), c.setFace(e.face), c.setGender(e.gender), c.setAllow(e.allow)) : (c = g.createUser({
                        uin: a.arguments.uin,
                        allow: e.allow,
                        nick: e.nick,
                        face: e.face,
                        ruin: e.ruin,
                        gender: e.gender
                    }), g.addStranger(c));
                    f.notifyObservers(g, "GetUserInfoSuccess", c)
                }
            },
            onGetUserInfoError: function() { },
            onGetBuddySignatureSuccess: function(a) {
                var e = a.result,
                c;
                c = e.length == 0 ? "" : e[0].lnick;
                e.length != 0 && e[0].uin == alloy.portal.getUin() && g.setSelfSignature(e[0].lnick); (a = g.getUserByUin(a.arguments.uin)) && a.setSignature(c);
                f.notifyObservers(g, "GetBuddySignatureSuccess", a)
            },
            onGetMultiBuddySignatureSuccess: function(a) {
                var a = a.result,
                e;
                for (e in a) {
                    var c = g.getUserByUin(a[e].tuin);
                    c && c.setSignature(a[e].lnick)
                }
            },
            onChangeGroupMaskSuccess: function(a) {
                a.uin == g.getSelfUin() ? (w = a.mask, f.notifyObservers(g, "GroupMaskChange", w)) : g.getGroupByGid(a.uin).setMask(a.mask)
            },
            onGetQQLevelSuccess: function(a) {
                var e = g.getUserByUin(a.arguments.uin);
                e && e.setQQLevel(a.result)
            },
            onGetGroupMaskConfigSuccess: function(a) {
                for (var e in a) {
                    var c = parseInt(a[e]);
                    e === "global" && (w = c, f.notifyObservers(g, "GroupMaskChange", w))
                }
            },
            onGetOnlineBuddiesSuccess: function(a) {
                g.setAllBuddyState(a)
            },
            onGetSessionSignatureSuccess: function(a) {
                g.setGroupBuddySessionSignature(a)
            },
            onBuddyStatusChange: function(a) {
                g.setState(a.uin, a.status, a.client_type)
            },
            onBuddyListChange: function(a) {
                if (a.removed_friends && a.removed_friends.length > 0) for (var e in a.removed_friends) {
                    var c = a.removed_friends[e];
                    g.setState(c.uin, EQQ.hash.onlineStatus.offline, null);
                    if (c = g.removeBuddy(c.uin)) {
                        var b = EQQ.hash.onlineStatus.offline,
                        n = g.getClassById(c.classId);
                        d.array.remove(n.list[b], c);
                        n.count -= 1;
                        n.onlineCount = n.count - n.list[b].length;
                        f.notifyObservers(g, "RemoveBuddy", c)
                    }
                }
            },
            onGetSelfSignatureSuccess: function(a) {
                g.setSelfSignature(a)
            },
            onGetBuddyListSuccess: function(a) {
                for (var e = a.categories || [], c = !1, b = 0; b < e.length; b++) e[b].index == 0 && (c = !0);
                c || e.unshift({
                    index: 0,
                    name: "\u6211\u7684\u597d\u53cb"
                });
                g.isBuddyList = !0;
                g.setBuddyClass(a);
                g.setBuddyList(a);
                EQQ.RPCService.sendGetOnlineBuddies()
            },
            GetBuddyListError: function() {
                f.notifyObservers(EQQ, "LoginFailure", {
                    text: "\u62c9\u53d6\u5931\u8d25"
                })
            },
            onGetGroupListSuccess: function(a) {
                g.isGroupList = !0;
                for (var e = a.gmasklist || [], c = 0, b = 0; b < e.length; b++) {
                    var d = e[b];
                    if (d.gid === 1E3) c = d.mask;
                    else for (var h = 0; h < a.gnamelist.length; h++) if (a.gnamelist[h].gid === d.gid) {
                        a.gnamelist[h].mask = d.mask;
                        break
                    }
                }
                g.setGroupList(a);
                g.setGroupMask(c)
            },
            GetGroupListError: function() {
                f.notifyObservers(EQQ, "LoginFailure", {
                    text: "\u62c9\u53d6\u5931\u8d25"
                })
            },
            onGetGroupInfoSuccess: function(a) {
                g.setGroupInfo(a)
            },
            onGetRecentListSuccess: function(a) {
                g.setRecentList(a)
            },
            onPollSuccess: function(a) {
                if (a) for (var e = 0; e < a.length; e++) {
                    var c = a[e];
                    switch (c.poll_type) {
                        case "buddies_status_change":
                            s.onBuddyStatusChange(c.value);
                            break;
                        case "buddylist_change":
                            s.onBuddyListChange(c.value)
                    }
                }
            },
            onLoginSuccess: function(a) {
                var e = g.getSelfUin();
                g.setState(e, a.status, "QQWeb");
                EQQ.index = a.index;
                EQQ.port = a.port
            },
            onAddANewBuddy: function(a) {
                var e = a.gid,
                c = a.newstate,
                b = a.markname;
                alloy.rpcService.sendGetUserInfo(a.tuin, null, null,
                function(a) {
                    if (a.retcode === 0) {
                        var l = a.result,
                        a = a.arguments.uin,
                        d = g.getUserByUin(a);
                        d ? (d.setNick(l.nick), d.setFace(l.face), d.setGender(l.gender), d.setClassId(e), g.addBuddy(d)) : (d = g.createUser({
                            uin: a,
                            allow: l.allow,
                            nick: l.nick,
                            face: l.face,
                            gender: l.gender,
                            ruin: l.ruin,
                            classId: e
                        }), g.addBuddy(d), EQQ.Model.BuddyList.getClassById(e).count += 1, f.notifyObservers(EQQ.Model.BuddyList, "AddBuddy", {
                            user: d,
                            newstate: c,
                            markname: b
                        }))
                    }
                })
            },
            onAddNewGroupToModel: function(a) {
                var e = g.getGroupByCode(a);
                if (!d.isUndefined(e) && e) return !0;
                alloy.rpcService.sendGetGroupPublicInfo(a, a, EQQ.Model.BuddyList.onGetGroupPublicSuccess,
                function() { })
            }
        };
        this.init = function() {
            t = [];
            b = {};
            a = [];
            c = {};
            p = [];
            m = {};
            z = [];
            q = {};
            o = [];
            i = {};
            m = {};
            r = [];
            k = [];
            B = {};
            E = {};
            x = [];
            C = [];
            discuListReloadCount = 0;
            f.addObserver(alloy.portal, "SelfInfoChanged", s.onSelfInfoChanged);
            f.addObserver(alloy.rpcService, "GetUserInfoSuccess", s.onGetUserInfoSuccess);
            f.addObserver(alloy.rpcService, "GetUserInfoError", s.onGetUserInfoError);
            f.addObserver(alloy.rpcService, "GetGroupInfoSuccess", s.onGetGroupInfoSuccess);
            f.addObserver(alloy.rpcService, "GetQQLevelSuccess", s.onGetQQLevelSuccess);
            f.addObserver(alloy.rpcService, "GetBuddySignatureSuccess", s.onGetBuddySignatureSuccess);
            f.addObserver(alloy.rpcService, "GetMultiBuddySignatureSuccess", s.onGetMultiBuddySignatureSuccess);
            f.addObserver(EQQ, "LoginSuccess", s.onLoginSuccess);
            f.addObserver(EQQ.RPCService, "GetOnlineBuddiesSuccess", s.onGetOnlineBuddiesSuccess);
            f.addObserver(EQQ.RPCService, "GetSelfSignatureSuccess", s.onGetSelfSignatureSuccess);
            f.addObserver(EQQ.RPCService, "GetSessionSignatureSuccess", s.onGetSessionSignatureSuccess);
            f.addObserver(EQQ.RPCService, "PollSuccess", s.onPollSuccess);
            f.addObserver(g, "AddANewBuddy", s.onAddANewBuddy);
            f.addObserver(g, "BuddyStatusChange", s.onBuddyStatusChange);
            f.addObserver(alloy.portal, "selfInfoReady", s.onSelfInfoReady);
            f.addObserver(g, "AddNewGroupToModel", s.onAddNewGroupToModel);
            f.addObserver(g, "ReloadGroupInfo", this.onReloadGroupInfo);
            f.addObserver(EQQ.RPCService, "GetDiscuSessionSignatureSuccess", Q);
            f.addObserver(EQQ.RPCService, "DiscuNotExist", O)
        };
        this.reset = function() {
            j = 0;
            t = [];
            b = {};
            a = [];
            c = {};
            p = [];
            m = {};
            z = [];
            q = {};
            o = [];
            i = {};
            m = {};
            r = [];
            k = [];
            B = {};
            E = {};
            x = [];
            C = [];
            discuListReloadCount = 0;
            this.setSelf({
                uin: alloy.portal.getUin()
            })
        };
        this.sendGetBuddyList = function(a) {
            a = a || {};
            a.vfwebqq = EQQ.vfwebqq;
            return EQQ.Extend.cgi_module(EQQ.BASE_CONST.API_SERVER_URL + "get_user_friends2", {
                context: this,
                method: "POST",
                param: a,
                callback: function(a, e) {
                    a.retcode === 0 ? (s.onGetBuddyListSuccess(a.result), e(a)) : s.GetBuddyListError(a);
                    alloy.util.report2h("eqqGetData", "end_BuddyList", ["ok"][a.retcode] || a.retcode);
                    alloy.portal.speedTest.sRTS(14, "end", new Date, !0)
                },
                errback: function(a) {
                    s.GetBuddyListError(a);
                    alloy.util.report2h("eqqGetData", "end_BuddyList", "error")
                },
                timeback: function(a) {
                    s.GetBuddyListError(a);
                    qqweb.util.report2h("eqqGetData", "end_BuddyList", "timeout")
                }
            })
        };
        this.sendGetGroupList = function(a) {
            a = a || {};
            a.vfwebqq = EQQ.vfwebqq;
            return EQQ.Extend.cgi_module(EQQ.BASE_CONST.API_SERVER_URL + "get_group_name_list_mask2", {
                context: this,
                method: "POST",
                param: a,
                callback: function(a, e) {
                    a.retcode === 0 ? (s.onGetGroupListSuccess(a.result), e(a)) : s.GetGroupListError(a);
                    alloy.util.report2h("eqqGetData", "end_GroupList", ["ok"][a.retcode] || a.retcode);
                    alloy.portal.speedTest.sRTS(15, "end", new Date, !0)
                },
                errback: function(a) {
                    s.GetGroupListError(a);
                    alloy.util.report2h("eqqGetData", "end_GroupList", "error")
                },
                timeback: function(a) {
                    s.GetGroupListError(a);
                    qqweb.util.report2h("eqqGetData", "end_GroupList", "timeout")
                }
            })
        };
        this.sendGetRecentList = function(a) {
            a = a || {};
            a.vfwebqq = EQQ.vfwebqq;
            a.clientid = EQQ.RPCService.getClientId();
            a.psessionid = EQQ.getPsessionid();
            return EQQ.Extend.cgi_module_d(EQQ.BASE_CONST.CONN_SERVER_DOMAIN2 + "channel/get_recent_list2", {
                context: this,
                method: "POST",
                data: {
                    r: d.json.stringify(a)
                },
                callback: function(a) {
                    if (a.retcode === 0) s.onGetRecentListSuccess(a.result)
                },
                errback: function() { }
            })
        };
        this.getUserSignature = function(a) {
            (a = this.getUserByUin(a)) && a.getSignature()
        };
        this.getMultiUserSignture = function(a) {
            var e = [],
            c;
            for (c in a) {
                var b = this.getUserByUin(a[c]);
                typeof b.signature === "undefined" ? e.push(a[c]) : b.setSignature()
            }
            e.length && alloy.rpcService.sendGetMultiSignature("[" + e.toString() + "]")
        };
        this.sendGetQQLevel = function(a) {
            (a = this.getUserByUin(a)) && a.getQQLevel()
        };
        this.setSelf = function(a) {
            this.createUser({
                uin: a.uin || null,
                allow: a.allow || null,
                nick: a.nick || null,
                face: a.face || 0,
                age: a.age || null,
                gender: a.gender || null,
                vip: a.vip || null
            });
            this.setSelfUin(a.uin);
            var e = EQQ.getDefaultState();
            this.setState(a.uin, e, "QQWeb");
            f.notifyObservers(this, "SelfInfoChange", this.getSelf())
        };
        this.getSelf = function() {
            return this.getUserByUin(this.getSelfUin())
        };
        this.getSelfState = function() {
            var a = this.getSelf();
            if (a) return a.state
        };
        this.setSelfUin = function(a) {
            j = a || 0
        };
        this.getSelfUin = function() {
            return j
        };
        this.setSelfSignature = function(a) {
            this.getUserByUin(this.getSelfUin()).setSignature(a);
            f.notifyObservers(this, "SelfSignatureChange", this.getSelf())
        };
        this.sendChangeStatus = function(a) {
            EQQ.RPCService.sendChangeStatus({
                newstatus: a
            })
        };
        this.sendChangeGroupMask = function(a) {
            var e = {
                cAll: a.type === "global" ? a.mask : w,
                idx: EQQ.index,
                port: EQQ.port
            },
            c;
            for (c in k) {
                var b = k[c];
                e[b.gid] = a.type === "single" && a.uin === b.gid ? a.mask : b.mask
            }
            qqweb.rpcService.sendMessageFilterConfig({
                onSuccess: function() {
                    s.onChangeGroupMaskSuccess({
                        uin: a.uin,
                        mask: a.mask
                    })
                },
                context: this,
                data: {
                    retype: 1,
                    app: "EQQ",
                    itemlist: '{"groupmask":' + d.json.stringify(e) + "}"
                }
            })
        };
        this.setBuddyClass = function(a) {
            t = a.categories;
            for (a = 0; a < t.length; a++) {
                var e = t[a];
                e.caculateName = e.name;
                e.htmlName = d.string.encodeHtmlSimple(e.name);
                e.titleName = d.string.encodeHtmlAttributeSimple(e.name);
                e.count = 0;
                e.onlineCount = 0;
                e.list = {
                    callme: [],
                    online: [],
                    away: [],
                    busy: [],
                    silent: [],
                    offline: []
                };
                b[e.index] = e
            }
            f.notifyObservers(this, "BuddyClassChange", this.getClassList())
        };
        this.getClassList = function() {
            return t
        };
        this.setAllBuddyState = function(a) {
            r = [];
            for (var e = 0; e < a.length; e++) {
                var c = a[e];
                this.setState(c.uin, c.status, c.client_type)
            }
            f.notifyObservers(this, "AllOnlineBuddyReady", this.getOnlineBuddy());
            f.notifyObservers(this, "AllClassOnlineBuddyReady", this.getClassList())
        };
        this.setState = function(a, e, c) {
            var b = this.getUserByUin(a);
            if (b) {
                var d = b.state;
                b.setState(e);
                b.clientType = c;
                if (a == this.getSelfUin()) f.notifyObservers(this, "SelfStateChange", this.getSelfState());
                else if (b.classId !== EQQ.hash.userClassType.stranger && b.classId !== EQQ.hash.userClassType.balck) {
                    var h = this.getClassByUin(b.uin);
                    h.list[b.state].unshift(b);
                    for (var b = h.list[d], n = 0; n < b.length; n++) b[n].uin == a && b.splice(n, 1);
                    b = EQQ.hash.onlineStatus.offline;
                    if (d == b || e == b) {
                        h.onlineCount = h.count - h.list[b].length;
                        if (e == b) for (e = 0; e < r.length; e++) r[e].uin == a && r.splice(e, 1);
                        else r.push({
                            uin: a,
                            state: e,
                            clientType: c
                        });
                        f.notifyObservers(this, "OnlineBuddyChange", a)
                    }
                    f.notifyObservers(this, "BuddyStateChange", a)
                }
            }
        };
        this.getState = function(a) {
            return (a = this.getUserByUin(a)) ? a.getState() : null
        };
        this.getOnlineBuddy = function() {
            return r
        };
        this.addUser = function(e) {
            c[e.uin] || (c[e.uin] = e, a.push(e));
            return e
        };
        this.addBuddy = function(a) {
            if (!m[a.uin]) a.type = "buddy",
            m[a.uin] = a,
            p.push(a);
            return a
        };
        this.removeBuddy = function(a) {
            var e = null;
            m[a] && (e = m[a], m[a] = null, delete m[a], d.array.remove(p, e));
            return e
        };
        this.createUser = function(a) {
            a = new F(a);
            this.addUser(a);
            return a
        };
        this.addStranger = function(a) {
            q[a.uin] || (q[a.uin] = a, z.push(a));
            return a
        };
        this.addBlack = function(a) {
            if (!i[a.uin]) a.type = "black",
            i[a.uin] = a,
            o.push(a);
            return a
        };
        this.getStrangerList = function() {
            return z
        };
        this.setBuddyList = function(a) {
            p = [];
            for (var e = a.friends,
            c = this.getSelfUin(), b = 0; b < e.length; b++) if (e[b].uin != c) {
                var d = a.info[b],
                d = this.createUser({
                    uin: d.uin,
                    allow: d.allow,
                    nick: d.nick,
                    face: d.face,
                    age: d.age,
                    gender: d.gender,
                    vip: d.vip,
                    ruin: d.ruin,
                    classId: this.getClassById(e[b].categories) ? e[b].categories : 0
                });
                this.addBuddy(d)
            }
            if (a = a.marknames) for (b = 0; b < a.length; b++) (d = this.getUserByUin(a[b].uin)) && d.setMarkName(a[b].markname);
            for (b = 0; b < p.length; b++) p[b].uin != this.getSelfUin() && (a = this.getClassById(p[b].classId), a.list[p[b].state] || (a.list[p[b].state] = []), a.list[p[b].state].push(p[b]), a.count++);
            f.notifyObservers(this, "BuddyListChange", this.getBuddyList())
        };
        this.getBuddyList = function() {
            return p
        };
        this.addNewBuddy = function() { };
        this.searchBuddy = function(a, e) {
            var a = String(a).toLowerCase(),
            c = [],
            b = [];
            if (a.length > 0) for (var d = 0; d < p.length; d++) {
                var h = p[d];
                if (String(h.nick).toLowerCase().indexOf(a) > -1 && String(h.nick) != "undefined" || String(h.markName).toLowerCase().indexOf(a) > -1 && String(h.markName) != "undefined") String(h.nick).toLowerCase() == a || String(h.markName).toLowerCase() == a ? b.push(h) : c.push(h);
                if (c.length + b.length >= e) break
            }
            Array.prototype.push.apply(b, c);
            return b
        };
        this.isUser = function(a) {
            return Boolean(c[a])
        };
        this.isBuddy = function(a) {
            return m[a]
        };
        this.getBuddyByUin = function(a) {
            return m[a]
        };
        this.isStranger = function(a) {
            return q[a]
        };
        this.isBlack = function(a) {
            return i[a]
        };
        this.getUserByUin = function(a) {
            if (c) return c[a]
        };
        this.getClassIdByUin = function(a) {
            return c[a].classId
        };
        this.getClassByUin = function(a) {
            return this.getClassById(this.getClassIdByUin(a))
        };
        this.getClassById = function(a) {
            return b[a]
        };
        this.addGroup = function(a) {
            E[a.code] || (E[a.code] = B[a.gid] = a, k.push(a));
            return a
        };
        this.removeGroup = function(a) {
            if (!d.isUndefined(E[a])) {
                var e = E[a].gid;
                delete E[a];
                delete B[e];
                for (var c in k) k[c].code == a && delete k[c]
            }
        };
        this.onGetGroupPublicSuccess = function(a) {
            a.retcode != 0 && d.error("onGetGroupPublic error:" + a.retcode);
            var a = a.result.ginfo,
            e = "commonGroup";
            a.flag & 16 ? e = "seniorGroup" : a.flag & 33554432 ? e = "superGroup" : a.flag & 2 ? e = "forbiddenGroup" : a.flag & 256 ? e = "enterpriseGroup" : a.flag & 67108864 && (e = "expireSuperGroup");
            a = new u({
                gid: a.gid,
                code: a.code,
                type: e,
                name: a.name,
                markName: a.name,
                mask: "0"
            });
            g.addGroup(a);
            f.notifyObservers(g, "AddNewGroupToList", a)
        };
        this.setGroupList = function(a) {
            var e = a.gnamelist,
            a = a.gmarklist || [];
            k = [];
            for (var c = 0; c < e.length; c++) {
                var b = e[c],
                d = "commonGroup";
                b.flag & 16 ? d = "seniorGroup" : b.flag & 33554432 ? d = "superGroup" : b.flag & 2 ? d = "forbiddenGroup" : b.flag & 256 ? d = "enterpriseGroup" : b.flag & 67108864 && (d = "expireSuperGroup");
                var h;
                a:
                {
                    h = void 0;
                    for (h in a) if (a[h].uin == b.gid) {
                        h = a[h].markname;
                        break a
                    }
                    h = ""
                }
                this.addGroup(new u({
                    gid: b.gid,
                    code: b.code,
                    type: d,
                    name: b.name,
                    markName: h,
                    mask: b.mask || "0"
                }))
            }
            f.notifyObservers(this, "GroupListChange", this.getGroupList())
        };
        this.setGroupMask = function(a) {
            w = a;
            f.notifyObservers(this, "GroupMaskChange", w)
        };
        this.getGroupMask = function() {
            return w
        };
        this.getGroupList = function() {
            return k
        };
        this.setRecentList = function(a) {
            for (var e in a) if (a[e].type == 2) a[e].uin = this.encodeDid(a[e].uin);
            D = a;
            f.notifyObservers(this, "RecentListChange", this.getRecentList())
        };
        this.getRecentList = function() {
            return D
        };
        this.setGroupInfo = function(a) {
            for (var e = a.ginfo,
            c = a.minfo,
            b = a.stats,
            n = {},
            h = b.length; h--; ) n[b[h].uin] = b[h];
            a = a.cards || [];
            b = this.getGroupByCode(e.code);
            b.setLevel(e.level);
            h = this.getSelfUin();
            b.setAnnouncement(e.memo || " ");
            for (var g = e.members,
            y = [], m = !1, k = 0, i = 0; i < g.length; i++) {
                var t = "common";
                g[i].mflag & 1 ? (t = "manager", g[i].muin === h && (m = !0)) : g[i].mflag & 2 && (t = "manager2", g[i].muin === h && (m = !0));
                g[i].muin == e.owner && (t = "master", g[i].muin === h && (m = !0));
                var j = g[i].muin,
                A = (c[i].nick || c[i].ruin || "") + "",
                p = c[i].nick;
                p == "" && (p = (c[i].ruin || j) + "");
                var H = n[j] && n[j].stat || 20,
                I = n[j] && n[j].client_type || 1E4; (H != 20 || j === h) && k++;
                for (var q = A,
                z = A,
                o = 0; o < a.length; o++) if (a[o].muin == j) {
                    p = a[o].card;
                    break
                }
                if (o = this.getUserByUin(g[i].muin)) {
                    var r = alloy.util.code2state(H);
                    if (o.uin != h) o.setState(r),
                    o.gstate = H;
                    o.type === "groupBuddy" || o.uin === h ? (H = p ? p : o.showName, o.setUsercard(e.code, H)) : p = p === A ? o.showName : p;
                    o.setClientType(I)
                } else o = this.createUser({
                    uin: j,
                    nick: A,
                    clientType: I,
                    state: alloy.util.code2state(H)
                }),
                o.type = "groupBuddy",
                o.setClassId(EQQ.hash.userClassType.stranger),
                o.group = b,
                o.gstate = H;
                H = p ? p : o.showName;
                o.setUsercard(e.code, H);
                y[i] = {
                    uin: j,
                    flag: t,
                    gcode: e.code,
                    nick: A,
                    htmlNick: d.string.encodeHtmlSimple(A),
                    titleNick: A,
                    showName: q,
                    htmlShowName: d.string.encodeHtmlSimple(q),
                    titleShowName: d.string.encodeHtmlAttributeSimple(q),
                    allName: z,
                    htmlAllName: d.string.encodeHtmlSimple(z),
                    titleAllName: z,
                    usercard: d.string.encodeHtmlSimple(p)
                };
                y[i].info = o;
                b.uin2members[j] = y[i]
            }
            b.isLoadInfo = !0;
            b.hasManageAuthority = m;
            b.updateMembers(y, k);
            f.notifyObservers(this, "GroupInfoChange", b)
        };
        this.setMemberState = function(a) {
            this.getGroupByCode(a.gcode).updateMemberState(a)
        };
        this.sendGetGroupInfo = function(a) {
            a.vfwebqq = alloy.portal.getVfWebQQ();
            alloy.rpcService.send(alloy.CONST.API_SERVER_URL + "get_group_info_ext2", {
                context: g,
                data: a,
                arguments: a,
                onSuccess: function(a) {
                    a.retcode === 0 ? g.setGroupInfo(a.result) : d.out("\u83b7\u53d6\u7fa4\u6700\u65b0\u4fe1\u606f\u5931\u8d25")
                },
                onError: function() {
                    d.out("\u83b7\u53d6\u7fa4\u6700\u65b0\u4fe1\u606f\u5931\u8d25")
                }
            })
        };
        this.sendGetMultiGroupInfo = function(a, e) {
            a.vfwebqq = alloy.portal.getVfWebQQ();
            alloy.rpcService.send(alloy.CONST.API_SERVER_URL + "get_group_info", {
                context: g,
                data: a,
                arguments: a,
                onSuccess: function(a) {
                    a.retcode === 0 ? e ? e(a) : f.notifyObservers(g, "GetMultiGroupInfoSuccess", a) : d.out("\u83b7\u53d6\u7fa4\u4fe1\u606f\u5931\u8d25")
                },
                onError: function() {
                    d.out("\u83b7\u53d6\u7fa4\u4fe1\u606f\u5931\u8d25")
                }
            })
        };
        this.sendGetGroupNewestState = function(a) {
            a.vfwebqq = alloy.portal.getVfWebQQ();
            alloy.rpcService.send(alloy.CONST.API_SERVER_URL + "get_group_member_stat2", {
                context: g,
                data: a,
                arguments: a,
                onSuccess: function(a) {
                    if (a.retcode === 0) g.onGetGroupNewestStateSuc(a.result);
                    else d.out("\u83b7\u53d6\u7fa4\u6700\u65b0\u4fe1\u606f\u5931\u8d25")
                },
                onError: function() {
                    d.out("\u83b7\u53d6\u7fa4\u6700\u65b0\u4fe1\u606f\u5931\u8d25")
                }
            })
        };
        this.onGetGroupNewestStateSuc = function(a) {
            this.setMemberState(a)
        };
        this.getGroupByCode = function(a) {
            return E[a]
        };
        this.getGroupByGid = function(a) {
            return B[a]
        };
        this.getGroupInfo = function(a) {
            var e = this.getGroupByCode(a);
            if (e.isLoadInfo) return e.updateMembers(),
            e.upAnnouncement(e.announcement),
            f.notifyObservers(this, "GroupInfoChange", e),
            e;
            else this.sendGetGroupInfo({
                gcode: a
            })
        };
        var K = function(a) {
            var e = a.arguments.gcode;
            if (d.isArray(e)) b = g.getGroupByCode(e),
            f = a.result ? a.result.memo || " " : " ",
            b.setAnnouncement(f);
            else for (var c in e) {
                var b = e[c],
                b = g.getGroupByCode(b),
                f = a.result ? a.result.memo || " " : " ";
                b.setAnnouncement(f)
            }
        };
        this.getGroupAnnouncement = function(a) {
            var e = g.getGroupByCode(a);
            if (typeof e.announcement == "undefined") this.sendGetMultiGroupInfo({
                gcode: "[" + a + "]",
                retainKey: "memo"
            },
            K);
            else return e
        };
        var G = function(a) {
            if (a.result) for (var e in a.result) {
                var b = a.result[e];
                g.getGroupByCode(b.gcode).setAnnouncement(b.memo || " ")
            }
        };
        this.getMultiGroupAnnounce = function(a) {
            var e = [],
            b;
            for (b in a) typeof g.getGroupByCode(a[b]).announcement == "undefined" && e.push(a[b]);
            e.length && this.sendGetMultiGroupInfo({
                gcode: "[" + e.toString() + "]",
                retainKey: "memo,gcode"
            },
            G)
        };
        this.onReloadGroupInfo = function(a) {
            var e = this.getGroupByCode(a);
            if (d.isUndefined(e) || !e) return !1;
            this.sendGetGroupInfo({
                gcode: a
            })
        };
        this.sendGetSessionSignature = function(a) {
            EQQ.RPCService.sendGetSessionSignature(a)
        };
        this.setGroupBuddySessionSignature = function(a) {
            var e = this.getUserByUin(a.uin),
            b = a.id;
            if (a.type === 0) e.chatSession[b] = a.value,
            f.notifyObservers(this, "GroupBuddySessionSignatureChange", e.uin)
        };
        this.sendGetUserInfo = function(a) {
            alloy.rpcService.sendGetUserInfo_with_code(a)
        };
        this.isGroupPrompt = function(a) {
            a = this.getGroupByGid(a);
            w = parseInt(w);
            switch (w) {
                case 0:
                    switch (parseInt(a.mask)) {
                        case 0:
                            return !0;
                        case 1:
                            return !1;
                        case 2:
                            return !1
                    }
                    break;
                case 1:
                    return !0;
                case 2:
                    return !1;
                case 3:
                    return !1
            }
        };
        var e = new d.Class({
            init: function(a) {
                this.did = a.did;
                this.mask = String(a.mask || 0);
                this.preMask = String(this.mask);
                this.setName(a.name);
                this.isLoadInfo = !1;
                this.members = [];
                this.owner = "";
                this.notSetName = !1;
                this.hadModified = !0
            },
            setName: function(a) {
                this.notSetName = d.isUndefined(a) || a == "" ? !0 : !1;
                this.name = a = a || "\u666e\u901a\u8ba8\u8bba\u7ec4";
                this.htmlName = d.string.encodeHtmlSimple(a.toString());
                this.titleName = d.string.encodeHtmlAttributeSimple(a.toString());
                this.setTopic(a)
            },
            setTopic: function(a) {
                if (d.isUndefined(a)) return !1;
                this.topic = a;
                this.htmlTopic = d.string.encodeHtmlSimple(a);
                this.titleTopic = d.string.encodeHtmlAttributeSimple(a)
            },
            addMember: function(a) {
                this.members.push(a);
                var e = g.getUserByUin(a.uin);
                if (e) {
                    if (e.type == "stranger") e.setNick(a.nick || a.uin.toString()),
                    e.did = this.did
                } else e = g.createUser({
                    uin: a.uin,
                    allow: !0,
                    nick: a.nick || a.uin.toString(),
                    face: "",
                    gender: "",
                    state: a.status,
                    ruin: a.ruin,
                    did: this.did
                }),
                e.type = "groupBuddy",
                g.addStranger(e)
            },
            setMembers: function(a) {
                this.members = a;
                for (var e in a) {
                    var b = a[e],
                    c = g.getUserByUin(b.uin);
                    if (c) {
                        if (c.type == "stranger") c.setNick(b.nick || b.uin.toString()),
                        c.did = this.did
                    } else c = g.createUser({
                        uin: b.uin,
                        allow: !0,
                        nick: b.nick || b.uin.toString(),
                        face: "",
                        gender: "",
                        state: b.status,
                        ruin: b.ruin,
                        did: this.did
                    }),
                    c.type = "groupBuddy",
                    g.addStranger(c)
                }
            },
            getMemberList: function() { },
            modifyMemberStatus: function(a) {
                var e = [],
                b = [],
                c;
                for (c in a) {
                    var f = a[c];
                    b[f.uin] = f
                }
                a = alloy.portal.getPortalSelf("uin");
                for (c in this.members) {
                    var f = this.members[c],
                    h = b[f.uin];
                    if (!d.isUndefined(h) && h.status != f.status) h.old_status = f.status,
                    f.status = a == f.uin && h.status == "offline" ? "hidden" : h.status,
                    e.push(h);
                    if (d.isUndefined(h) && f.status != "offline") h = {
                        uin: f.uin,
                        old_status: f.status,
                        status: a == f.uin ? "hidden" : "offline",
                        client_type: f.client_type
                    },
                    f.status = "offline",
                    e.push(h)
                }
                return e
            },
            setOwner: function(a) {
                this.owner = a
            },
            setIsLoadInfo: function(a) {
                this.isLoadInfo = a || !1
            },
            setMask: function(a) {
                this.preMask = String(this.mask);
                this.mask = String(a);
                f.notifyObservers(EQQ.Model.BuddyList, "SingleDiscuMaskChange", this)
            },
            setHadModified: function(a) {
                this.hadModified = a
            },
            getMemberByUin: function(a) {
                var e = this.members,
                b;
                for (b in e) if (e[b].uin == a) return e[b];
                return null
            }
        });
        this.encodeDid = function(a) {
            return "d" + a
        };
        this.decodeDid = function(a) {
            return a.substring(1)
        };
        this.addDiscu = function(a) {
            C[a.did] || (a = new e(a), C[a.did] = a, x.push(a))
        };
        this.removeDiscu = function(a) {
            if (C[a.did]) {
                delete C[a.did];
                for (var e in x) if (x[e].did == a.did) {
                    x.splice(e, 1);
                    break
                }
            }
        };
        this.getDiscuById = function(a) {
            return C[a]
        };
        this.getDiscuList = function() {
            return x
        };
        this.sendGetDiscuList = function(a) {
            var e = {};
            e.clientid = EQQ.RPCService.getClientId();
            e.psessionid = EQQ.getPsessionid();
            e.vfwebqq = alloy.portal.getVfWebQQ();
            EQQ.RPCService.send(EQQ.CONST.CONN_SERVER_DOMAIN + "channel/get_discu_list_new2", {
                context: g,
                data: e,
                arguments: e,
                onSuccess: function(e) {
                    d.isUndefined(a) || a();
                    if (e.retcode === 0) {
                        var b = e.result,
                        e = b.dnamelist,
                        c = b.dmasklist,
                        b = [],
                        h;
                        for (h in c) {
                            var y = c[h];
                            b[y.did] = y.mask
                        }
                        for (h in e) c = e[h],
                        c.mask = b[c.did] || 0,
                        c.did = g.encodeDid(c.did),
                        g.addDiscu(c);
                        f.notifyObservers(g, "DiscuListChange", g.getDiscuList())
                    } else n()
                },
                onError: function() {
                    n();
                    d.isUndefined(a) || a()
                }
            })
        };
        var n = function() {
            d.error("\u83b7\u53d6\u8ba8\u8bba\u7ec4\u5217\u8868\u5931\u8d25");
            discuListReloadCount < discuListReloadMax ? (discuListReloadCount++, d.error("\u7b2c" + discuListReloadCount + "\u91cd\u62c9\u8ba8\u8bba\u7ec4\u5217\u8868"), g.sendGetDiscuList()) : f.notifyObservers(EQQ, "GetDiscuListFail", {
                text: "\u83b7\u53d6\u8ba8\u8bba\u7ec4\u5217\u8868\u5931\u8d25"
            })
        };
        this.getDiscuInfo = function(a) {
            var e = this.getDiscuById(a); !d.isUndefined(e) && e.isLoadInfo ? f.notifyObservers(this, "DiscuInfoChange", e) : y(a)
        };
        this.refreshDiscuInfo = function(a) {
            y(a)
        };
        var y = function(a) {
            var e = {};
            e.did = g.decodeDid(a);
            e.clientid = EQQ.RPCService.getClientId();
            e.psessionid = EQQ.getPsessionid();
            e.vfwebqq = alloy.portal.getVfWebQQ();
            EQQ.RPCService.send(EQQ.CONST.CONN_SERVER_DOMAIN + "channel/get_discu_info", {
                context: g,
                data: e,
                arguments: e,
                onSuccess: function(a) {
                    a.retcode === 0 ? a.result.error == 3 ? O(e) : g.sendGetDiscuInfoSuccess(a) : d.error("\u83b7\u53d6\u8ba8\u8bba\u7ec4\u4fe1\u606f\u5931\u8d25")
                },
                onError: function() {
                    d.error("\u83b7\u53d6\u8ba8\u8bba\u7ec4\u4fe1\u606f\u5931\u8d25")
                }
            })
        };
        this.sendGetDiscuInfoSuccess = function(a) {
            var e = this.getDiscuById(g.encodeDid(a.arguments.did)),
            b = a.result.mem_info,
            c = a.result.mem_status,
            d = [],
            h;
            for (h in c) {
                var n = c[h];
                d[n.uin] = n.status
            }
            c = alloy.portal.getPortalSelf("uin");
            n = [];
            for (h in b) {
                var y = b[h],
                m = this.getUserByUin(y.uin);
                if (m) y.markName = m.markName,
                y.htmlMarkName = m.htmlMarkName;
                y.status = d[y.uin] || (y.uin == c ? "hidden" : "offline");
                y.name = y.nick;
                y.htmlName = $S.encodeHtmlSimple(y.nick);
                y.titleName = $S.encodeHtmlAttributeSimple(y.nick);
                n.push(y)
            }
            e.setName(a.result.info.discu_name);
            e.setMembers(n);
            e.setOwner(a.result.info.discu_owner);
            e.setIsLoadInfo(!0);
            f.notifyObservers(this, "DiscuInfoChange", e)
        };
        var A, H = function(a, e) {
            A = alloy.layout.messagebox('<div style="width:100%; height:100%; background-color:#FFFFFF; line-height:30px;">\t\t\t\t\t\t<div style ="text-align: left; padding-left: 10px;">\t\t\t\t\t\t\t<div>\u4e3a\u4e86\u60a8\u7684\u8d26\u53f7\u5b89\u5168\uff0c\u8bf7\u6267\u884c\u8eab\u4efd\u9a8c\u8bc1\uff0c\u5728\u8f93\u5165\u6846\u8f93\u5165\u4e0b\u56fe\u4e2d\u7684\u9a8c\u8bc1\u7801</div>\t\t\t\t\t\t\t<div>\u9a8c\u8bc1\u7801:  <input id="eqq_verify_input_code" type="text" style="vertical-align:middle;" /></div>\t\t\t\t\t\t\t<img style="float:left;margin-right:10px" id="eqq_verify_img_code" src="" />\t\t\t\t\t\t\t<a style="display:inline;line-height:60px;" id="eqq_verify_a_code" alt="\u770b\u4e0d\u6e05\u6362\u4e00\u5f20" href="">\u770b\u4e0d\u6e05\u6362\u4e00\u5f20</a>\t\t\t\t\t\t\t<div id="eqq_verify_img_code_wrong" style="display:none;color:red;width:65px;">\u9a8c\u8bc1\u7801\u9519\u8bef</div>\t\t\t\t\t\t</div>\t\t\t\t\t</div>', {
                title: "\u8eab\u4efd\u9a8c\u8bc1",
                resize: !0,
                width: 380,
                height: 123,
                hasOkButton: !0,
                isSetCentered: !0
            });
            var b = $D.id("eqq_verify_img_code"),
            c = $D.id("eqq_verify_a_code"),
            n = $D.id("eqq_verify_input_code"),
            h = null;
            f.on(b, "load",
            function() {
                h = d.cookie.get("verifysession", alloy.CONST.MAIN_DOMAIN)
            });
            f.on(c, "click",
            function(a) {
                a.preventDefault();
                $D.id("eqq_verify_img_code").src = "http://captcha.qq.com/getimage?aid=1003901&" + Math.random()
            });
            f.addObserver(A, "clickOkButton",
            function() {
                var b = n.value;
                if (b && h) return e(a, b, h),
                !1;
                n.focus();
                $D.id("eqq_verify_input_code").innerHTML = "\u8bf7\u5148\u8f93\u5165\u9a8c\u8bc1\u7801\uff01";
                return !1
            });
            n.focus();
            f.on(n, "keydown",
            function(a) {
                a.keyCode == 13 && f.notifyObservers(A, "clickOkButton") && setTimeout(function() {
                    A.close()
                },
                0)
            });
            $D.id("eqq_verify_img_code").src = "http://captcha.qq.com/getimage?aid=1003901&" + Math.random()
        };
        this.createDiscu = function(a) {
            a = a || [];
            if (a.length < 2) return !1;
            var e = [],
            b = [],
            c = [],
            d;
            for (d in a) {
                var f = a[d];
                f.uin = f.uin.toString();
                f.gid && f.gid.length > 3 ? (b.push(f.uin), c.push(f.gid.toString())) : e.push(f.uin)
            }
            I({
                discu_name: "",
                mem_list: e,
                mem_list_u: b,
                mem_list_g: c
            })
        };
        var I = g.sendCreateDiscu = function(a, e, b) {
            a = a || {};
            a.code = e;
            a.verifysession = b;
            a.clientid = EQQ.RPCService.getClientId();
            a.psessionid = EQQ.getPsessionid();
            a.vfwebqq = alloy.portal.getVfWebQQ();
            EQQ.RPCService.send(EQQ.CONST.CONN_SERVER_DOMAIN + "channel/create_discu", {
                context: g,
                method: "POST",
                data: {
                    r: d.json.stringify(a)
                },
                arguments: a,
                onSuccess: function(e) {
                    if (e.retcode === 0) {
                        var b = !1; !d.isUndefined(e.result.result) && e.result.result > 0 && (b = !0);
                        setTimeout(function() {
                            try {
                                A && A.close()
                            } catch (a) { }
                        },
                        0);
                        b ? (alloy.layout.alert("\u521b\u5efa\u8ba8\u8bba\u7ec4\u5931\u8d25\uff0c\u8bf7\u91cd\u8bd5!"), d.error("\u521b\u5efa\u8ba8\u8bba\u7ec4\u5931\u8d25")) : g.sendCreateDiscuSuccess(e)
                    } else e.retcode === 1E3 ? H(a,
                    function(a, e, b) {
                        g.sendCreateDiscu(a, e, b)
                    }) : e.retcode === 1001 ? ($D.id("eqq_verify_img_code_wrong").style.display = "inline", $D.id("eqq_verify_img_code").src = "http://captcha.qq.com/getimage?aid=1003901&" + Math.random(), $D.id("eqq_verify_input_code").value = "", $D.id("eqq_verify_input_code").focus()) : (setTimeout(function() {
                        try {
                            A && A.close()
                        } catch (a) { }
                    },
                    0), alloy.layout.alert("\u521b\u5efa\u8ba8\u8bba\u7ec4\u5931\u8d25\uff0c\u8bf7\u91cd\u8bd5!"), d.error("\u521b\u5efa\u8ba8\u8bba\u7ec4\u5931\u8d25"))
                },
                onError: function() {
                    alloy.layout.alert("\u521b\u5efa\u8ba8\u8bba\u7ec4\u5931\u8d25\uff0c\u8bf7\u91cd\u8bd5!");
                    d.error("\u521b\u5efa\u8ba8\u8bba\u7ec4\u5931\u8d25")
                }
            })
        };
        this.sendCreateDiscuSuccess = function(a) {
            a = g.encodeDid(a.result.did);
            g.addDiscu({
                did: a,
                name: ""
            });
            var e = g.getDiscuById(a);
            e.setHadModified(!1);
            f.notifyObservers(g, "AddNewDiscuToList", e);
            f.notifyObservers(g, "ToStartDiscuChat", a)
        };
        this.sendModifyDiscuTopic = function(a) {
            a.did = g.decodeDid(a.did);
            a = a || {};
            a.dtype = 1;
            a.clientid = EQQ.RPCService.getClientId();
            a.psessionid = EQQ.getPsessionid();
            a.vfwebqq = alloy.portal.getVfWebQQ();
            EQQ.RPCService.send(EQQ.CONST.CONN_SERVER_DOMAIN + "channel/modify_discu_info", {
                context: g,
                method: "POST",
                data: {
                    r: d.json.stringify(a)
                },
                arguments: a,
                onSuccess: function(e) {
                    if (e.retcode === 0) if (!d.isUndefined(e.result.error) && e.result.error == 2) alloy.layout.alert("\u4fee\u6539\u8ba8\u8bba\u7ec4\u4e3b\u9898\u5931\u8d25."),
                    d.error("\u4fee\u6539\u8ba8\u8bba\u7ec4\u4e3b\u9898\u5931\u8d25,\u6709\u810f\u8bcd"),
                    e = g.encodeDid(a.did),
                    e = g.getDiscuById(e),
                    f.notifyObservers(g, "ModifyDiscuTopicSuccess", e);
                    else if (!d.isUndefined(e.result.error) && e.result.error == 1) O(a);
                    else {
                        d.info("\u4fee\u6539\u8ba8\u8bba\u7ec4\u4e3b\u9898\u6210\u529f");
                        var e = a,
                        b = g.encodeDid(e.did),
                        b = g.getDiscuById(b);
                        b.setName(e.discu_name);
                        b.setHadModified(!0);
                        f.notifyObservers(g, "ModifyDiscuTopicSuccess", b)
                    } else alloy.layout.alert("\u4fee\u6539\u8ba8\u8bba\u7ec4\u4e3b\u9898\u5931\u8d25."),
                    d.error("\u4fee\u6539\u8ba8\u8bba\u7ec4\u4e3b\u9898\u5931\u8d25")
                },
                onError: function() {
                    d.error("\u4fee\u6539\u8ba8\u8bba\u7ec4\u4e3b\u9898\u5931\u8d25")
                }
            })
        };
        this.sendQuitDisc = function(a) {
            var a = a || {},
            e = a.did;
            a.did = g.decodeDid(a.did);
            a.clientid = EQQ.RPCService.getClientId();
            a.psessionid = EQQ.getPsessionid();
            a.vfwebqq = alloy.portal.getVfWebQQ();
            EQQ.RPCService.send(EQQ.CONST.CONN_SERVER_DOMAIN + "channel/quit_discu", {
                context: g,
                data: a,
                arguments: a,
                onSuccess: function(a) {
                    a.retcode === 0 ? (a = {
                        did: e
                    },
                    g.removeDiscu(a), f.notifyObservers(g, "QuitDiscuSuccess", a)) : (alloy.layout.alert("\u9000\u51fa\u8ba8\u8bba\u7ec4\u5931\u8d25\uff0c\u8bf7\u91cd\u8bd5!"), d.error("\u9000\u51fa\u8ba8\u8bba\u7ec4\u5931\u8d25"))
                },
                onError: function() {
                    alloy.layout.alert("\u9000\u51fa\u8ba8\u8bba\u7ec4\u5931\u8d25\uff0c\u8bf7\u91cd\u8bd5!");
                    d.error("\u9000\u51fa\u8ba8\u8bba\u7ec4\u5931\u8d25")
                }
            })
        };
        this.modifyDiscuMembers = function(a, e) {
            a = a || [];
            if (a.length < 1) return !1;
            var b = [],
            c = [],
            d = [],
            f;
            for (f in a) {
                var n = a[f];
                n.uin = n.uin.toString();
                n.gid && n.gid.length > 3 ? (c.push(n.uin), d.push(n.gid.toString())) : b.push(n.uin)
            }
            e.mem_list = b;
            e.mem_list_u = c;
            e.mem_list_g = d;
            g.sendModifyMember(e)
        };
        this.sendModifyMember = function(a) {
            var a = a || {},
            e = a.did;
            a.did = g.decodeDid(a.did);
            a.clientid = EQQ.RPCService.getClientId();
            a.psessionid = EQQ.getPsessionid();
            a.vfwebqq = alloy.portal.getVfWebQQ();
            EQQ.RPCService.send(EQQ.CONST.CONN_SERVER_DOMAIN + "channel/change_discu_mem", {
                context: g,
                method: "POST",
                data: {
                    r: d.json.stringify(a)
                },
                arguments: a,
                onSuccess: function(a) {
                    a.retcode === 0 ? (y(e), d.info("\u4fee\u6539\u8ba8\u8bba\u7ec4\u6210\u5458\u6210\u529f")) : (alloy.layout.alert("\u9080\u8bf7\u6210\u5458\u5931\u8d25\uff0c\u8bf7\u91cd\u8bd5!"), d.error("\u4fee\u6539\u8ba8\u8bba\u7ec4\u6210\u5458\u5931\u8d25"))
                },
                onError: function() {
                    alloy.layout.alert("\u9080\u8bf7\u6210\u5458\u5931\u8d25\uff0c\u8bf7\u91cd\u8bd5!");
                    d.error("\u4fee\u6539\u8ba8\u8bba\u7ec4\u6210\u5458\u5931\u8d25")
                }
            })
        };
        this.sendGetDiscuMemberStatus = function(a) {
            a = a || {};
            a.did = g.decodeDid(a.did);
            a.clientid = EQQ.RPCService.getClientId();
            a.psessionid = EQQ.getPsessionid();
            a.vfwebqq = alloy.portal.getVfWebQQ();
            EQQ.RPCService.send(EQQ.CONST.CONN_SERVER_DOMAIN + "channel/get_discu_status_info", {
                context: g,
                data: a,
                arguments: a,
                onSuccess: function(a) {
                    a.retcode === 0 ? g.getDiscuMemberStatusSuccess(a) : d.error("\u83b7\u53d6\u8ba8\u8bba\u7ec4\u6210\u5458\u72b6\u6001\u5931\u8d25")
                },
                onError: function() {
                    d.error("\u83b7\u53d6\u8ba8\u8bba\u7ec4\u6210\u5458\u72b6\u6001\u5931\u8d25")
                }
            })
        };
        this.getDiscuMemberStatusSuccess = function(a) {
            var e = g.encodeDid(a.arguments.did),
            a = g.getDiscuById(e).modifyMemberStatus(a.result.mem_status);
            a.length > 0 && f.notifyObservers(g, "GetDiscuMemberStatusSuccess", {
                did: e,
                list: a
            })
        };
        this.isDiscuPrompt = function(a) {
            a = this.getDiscuById(a);
            switch (parseInt(a.mask)) {
                case 0:
                    return !0;
                case 1:
                    return !1;
                case 2:
                    return !1
            }
        };
        this.sendChangeDiscuMask = function(a) {
            for (var e = {
                idx: EQQ.index,
                port: EQQ.port
            },
            b = 0; b < x.length; b++) {
                var c = x[b],
                f = g.decodeDid(c.did);
                e[f] = a.uin == c.did ? a.mask.toString() : c.mask.toString()
            }
            qqweb.rpcService.sendMessageFilterConfig({
                onSuccess: function() {
                    var e = {
                        uin: a.uin,
                        mask: a.mask
                    };
                    g.getDiscuById(e.uin).setMask(e.mask)
                },
                context: this,
                data: {
                    retype: 1,
                    app: "EQQ",
                    itemlist: '{"discumask":' + d.json.stringify(e) + "}"
                }
            })
        };
        this.getAndAddDiscu = function(a) {
            a = {
                did: a.did,
                name: a.name
            };
            g.addDiscu(a);
            a = g.getDiscuById(a.did);
            f.notifyObservers(g, "AddNewDiscuToList", a);
            f.notifyObservers(g, "AddDiscuByMsgSuccess", a)
        };
        this.sendGetDiscuSessionSignature = function(a) {
            var e = this.decodeDid(this.getUserByUin(a).did);
            EQQ.RPCService.sendGetDiscuSessionSignature({
                group_uin: e,
                to_uin: a
            })
        };
        var Q = function(a) {
            var e = g.getUserByUin(a.arguments.to_uin);
            if (a.result.verify_sig.type === 0 && a.result.group_sig.type === 0) e.chatSession = a.result,
            f.notifyObservers(g, "GroupBuddySessionSignatureChange", e.uin)
        },
        O = function(a) {
            alloy.layout.alert("\u8ba8\u8bba\u7ec4\u88ab\u5220\u9664!");
            a.did = g.encodeDid(a.did);
            g.removeDiscu(a);
            f.notifyObservers(g, "QuitDiscuSuccess", a)
        }
    })
})(); (function() {
    WebqCore.register("EQQ.Model.ChatMsg",
    function(d) {
        var g = this,
        f = d.event,
        j = {},
        t = [],
        b = [],
        a = {},
        c = [],
        p = {},
        m = [],
        z = {},
        q = null,
        o = [],
        i = null,
        r = {},
        k = {},
        D = [],
        B = {},
        E = 0,
        w,
        x = 0,
        C;
        w = (new Date).getTime();
        w = (w - w % 1E3) / 1E3;
        w = w % 1E4 * 1E4;
        var F = function() {
            E++;
            return w + E
        },
        u = function(a) {
            d.isNumber(a) && (a *= 1E3);
            return d.date.format(new Date(a), "YYYY-MM-DD hh:mm:ss")
        },
        s = function(a) {
            if (d.isString(a.content[1]) && a.content[1].substr(0, 4) === "\u3000  \u3000") {
                RegExp(/(\?.*)\s?$/).test(decodeURIComponent(a.content[1]));
                var b = d.string.mapQuery(RegExp.$1).vk;
                if (!g.uinToVideo) g.uinToVideo = [];
                a = a.from_uin;
                g.uinToVideo[a] = {
                    k: b
                };
                f.notifyObservers(g, "AskForVideo", {
                    uin: a,
                    k: b
                })
            }
        };
        this.init = function() {
            j = {};
            b = [];
            a = {};
            c = [];
            p = {};
            i = null;
            r = {};
            k = {};
            D = [];
            B = {};
            x = E = 0;
            C = null;
            f.addObserver(EQQ.RPCService, "SendMsgSuccess", d.bind(this.onSendMsgSuccess, this));
            f.addObserver(EQQ.RPCService, "PollSuccess", d.bind(this.onPollSuccess, this));
            f.addObserver(EQQ.RPCService, "SendMsgError", d.bind(this.onSendMsgError, this));
            f.addObserver(EQQ.RPCService, "SendGetGroupCustomFaceKeySuccess", d.bind(this.onSendGetGroupCustomFaceKeySuccess, this));
            f.addObserver(EQQ.RPCService, "sendGetOfflinePicUrlSuccess", d.bind(this.onGetOfflinePicUrlSuccess, this));
            f.addObserver(EQQ.RPCService, "getSendPicUrlError", d.bind(this.onSetSendPicUrlError, this));
            f.addObserver(EQQ.Model.BuddyList, "AddDiscuByMsgSuccess", d.bind(this.onAddDiscuByMsgSuccess, this))
        };
        this.getMsgId = F;
        this.setGroupCustomFaceKey = function(a) {
            x = d.now();
            C = {
                key: a.gface_key,
                signature: a.gface_sig
            }
        };
        this.getGroupCustomFaceKey = function() {
            return C
        };
        this.isGroupCustomFaceKeyTimeout = function() {
            return d.now() - x > 432E6
        };
        this.sendGetGroupCustomFaceKey = function(a) {
            EQQ.RPCService.sendGetGroupCustomFaceKey({
                arguments: {
                    msg: a
                }
            })
        };
        this.onSendGetGroupCustomFaceKeySuccess = function(a) {
            var b = a.arguments.msg;
            this.setGroupCustomFaceKey(a.result);
            this.sendGetGroupCustomFaceInfo(b)
        };
        this.sendGetGroupCustomFaceInfo = function(a) {
            for (var b = this.getGroupCustomFaceKey(), c = 0; c < a.content.length; c++) {
                var g = a.content[c];
                g[0] === "face" && (g[1] = EQQ.CONST.TRANSFER_TABLE[g[1]])
            }
            if (a.type == "discu") return this.sendDiscuCustomFaceInfo(a),
            !0;
            EQQ.RPCService.sendGetGroupCustomFaceInfo({
                group_uin: a.to,
                group_code: EQQ.Model.BuddyList.getGroupByGid(a.to).code,
                key: b.key,
                sig: b.signature,
                content: d.json.stringify(a.content)
            });
            b = F();
            c = EQQ.Model.BuddyList.getSelf();
            b = {
                type: a.type,
                from_uin: 0,
                sender_uin: c.uin,
                sender: c,
                time: u(new Date),
                content: a.content,
                msg_id: b,
                group_code: EQQ.Model.BuddyList.getGroupByGid(a.to).code
            };
            f.notifyObservers(this, "GroupMessageListChange", {
                gid: a.to,
                msgList: [b]
            })
        };
        this.sendDiscuCustomFaceInfo = function(a) {
            var b = EQQ.Model.BuddyList.getDiscuById(a.to);
            b && G(b, a.content);
            b = this.getGroupCustomFaceKey();
            EQQ.RPCService.sendDiscuMsg({
                did: EQQ.Model.BuddyList.decodeDid(a.to),
                key: b.key,
                sig: b.signature,
                content: d.json.stringify(a.content)
            });
            var b = F(),
            c = EQQ.Model.BuddyList.getSelf(),
            b = {
                type: a.type,
                from_uin: 0,
                sender_uin: c.uin,
                sender: c,
                time: u(new Date),
                content: a.content,
                msg_id: b,
                did: a.to
            };
            f.notifyObservers(this, "DiscuMessageListChange", {
                did: a.to,
                msgList: [b]
            })
        };
        this.callbackSendPic = function(a) {
            if (a.filesize > 1048576) a.retcode = "100",
            a.maxFileSize = "1MB",
            f.notifyObservers(this, "uploadSendPicError", a);
            else if (a.retcode != 0) f.notifyObservers(this, "uploadSendPicError", a);
            else {
                r[a.filepath] = a;
                var b = EQQ.Model.BuddyList.getSelf();
                EQQ.RPCService.sendGetOfflinePicUrl({
                    f_uin: b.uin,
                    file_path: a.filepath,
                    clientid: g.getClientidFromRpc()
                });
                alloy.util.report2m(133171)
            }
        };
        this.onGetOfflinePicUrlSuccess = function(a) {
            r[a.result.file_path].fileurl = a.result.url;
            if (r[a.result.file_path]) a.fileid = r[a.result.file_path].fileid;
            f.notifyObservers(this, "GetSendPicUrlSuccess", a)
        };
        this.onSetSendPicUrlError = function(a) {
            if (r[a.result.file_path]) a.fileid = r[a.result.file_path].fileid;
            f.notifyObservers(this, "getSendPicUrlError", a)
        };
        this.getSendPicUrlByFilePath = function(a) {
            return typeof r[a] == "undefined" ? "" : r[a].fileurl
        };
        this.callbackSendPicGroup = function(a) {
            if (a.ret === 0) {
                var b = /[A-Fa-f0-9]{32}\.[A-Za-z]{3}/,
                c = a.msg;
                c.length > 36 && (c = c.substring(0, 36));
                f.notifyObservers(this, "getSendPicGroupSuccess", c)
            } else a.ret === 4 ? (b = /[A-Fa-f0-9]{32}\.[A-Za-z]{3}/, c = a.msg, c.length > 36 ? (c = c.substring(0, 36), b.test(c) ? f.notifyObservers(this, "getSendPicGroupSuccess", c) : f.notifyObservers(this, "sendPicGroupError", a)) : f.notifyObservers(this, "sendPicGroupError", a)) : f.notifyObservers(this, "sendPicGroupError", a)
        };
        this.sendMsg = function(a) {
            var b = F(),
            c = "",
            c = {},
            a = a || {};
            a.type = a.type || "single";
            for (var g = typeof a.attach != "undefined" && a.attach ? a.attach : "", m = EQQ.Model.BuddyList.getSelf(), c = 0; c < a.content.length; c++) {
                var i = a.content[c];
                i[0] === "face" && (i[1] = EQQ.CONST.TRANSFER_TABLE[i[1]])
            }
            c = d.json.stringify(a.content);
            if (a.type === "group") c = {
                group_uin: a.to,
                content: c,
                msg_id: b
            },
            EQQ.RPCService.sendGroupMsg(c),
            b = {
                type: a.type,
                from_uin: 0,
                sender_uin: m.uin,
                sender: m,
                time: u(new Date),
                content: a.content,
                msg_id: b,
                group_code: EQQ.Model.BuddyList.getGroupByGid(a.to).code
            },
            f.notifyObservers(this, "GroupMessageListChange", {
                gid: a.to,
                msgList: [b]
            });
            else if (a.type === "discu") (g = EQQ.Model.BuddyList.getDiscuById(a.to)) && G(g, a.content),
            c = {
                did: EQQ.Model.BuddyList.decodeDid(a.to),
                content: c,
                msg_id: b
            },
            EQQ.RPCService.sendDiscuMsg(c),
            b = {
                type: a.type,
                from_uin: 0,
                sender_uin: m.uin,
                sender: m,
                time: u(new Date),
                content: a.content,
                msg_id: b,
                did: a.to
            },
            f.notifyObservers(this, "DiscuMessageListChange", {
                did: a.to,
                msgList: [b]
            });
            else {
                i = EQQ.Model.BuddyList.getUserByUin(a.to);
                if (i.type === "groupBuddy") {
                    var k = i.currentId,
                    c = {
                        to: a.to,
                        group_sig: i.chatSession[k],
                        face: a.face,
                        content: c,
                        msg_id: b,
                        service_type: isNaN(k) ? 1 : 0
                    };
                    EQQ.RPCService.sendGroupBuddyMsg(c)
                } else c = {
                    to: a.to,
                    face: a.face,
                    content: c,
                    msg_id: b
                },
                EQQ.RPCService.sendMsg(c);
                b = {
                    type: a.type,
                    from_uin: 0,
                    sender_uin: m.uin,
                    sender: m,
                    time: u(new Date),
                    content: a.content,
                    msg_id: b,
                    attach: g
                };
                a.isIgnoreHistory || f.notifyObservers(this, "MessageListChange", {
                    uin: a.to,
                    msgList: [b]
                })
            }
            a.isIgnoreHistory || (j[a.to] ? j[a.to].msgList.push(b) : j[a.to] = {
                last: 0,
                msgList: [b]
            })
        };
        this.addMsgToList = function(a) {
            var b = EQQ.Model.BuddyList.getSelf(),
            c = F(),
            b = {
                type: a.type,
                from_uin: a.from_uin,
                sender_uin: b.uin,
                sender: b,
                time: u(new Date),
                content: a.content,
                msg_id: c,
                attach: typeof a.attach != "undefined" && a.attach ? a.attach : ""
            };
            f.notifyObservers(this, "MessageListChange", {
                uin: a.to,
                msgList: [b]
            });
            j[a.to] ? j[a.to].msgList.push(b) : j[a.to] = {
                last: 0,
                msgList: [b]
            }
        };
        this.onSendMsgSuccess = function(a) {
            f.notifyObservers(this, "SendMsgError", a)
        };
        this.onSendMsgError = function(a) {
            f.notifyObservers(this, "SendMsgError", a)
        };
        this.getMsgHistory = function(a) {
            j[a] && f.notifyObservers(this, "MessageListChange", {
                uin: a,
                msgList: j[a].msgList
            })
        };
        this.getGroupMsgHistory = function(a) {
            j[a] && f.notifyObservers(this, "GroupMessageListChange", {
                gid: a,
                msgList: j[a].msgList
            })
        };
        this.clearChatLog = function(a) {
            j[a] && (j[a] = {
                last: 0,
                msgList: []
            })
        };
        this.receiveMsg = function(a) {
            var b = a.from_uin,
            c = !1,
            g = 0,
            m = typeof a.attach != "undefined" && a.attach ? a.attach : "",
            m = {
                type: "single",
                from_uin: b,
                sender_uin: b,
                sender: EQQ.Model.BuddyList.getUserByUin(b),
                msg_id: a.msg_id,
                content: a.content,
                time: u(a.time),
                raw_time: a.time,
                attach: m
            };
            if (j[b]) {
                for (var i = j[b].msgList, k = i.length, a = 0; a < k; a++) if (i[a].msg_id == m.msg_id) {
                    c = !0;
                    d.out("\u53d1\u73b0\u91cd\u590d\u4e2a\u4eba\u6d88\u606f\uff0cmsg_id\uff1a" + m.msg_id);
                    break
                }
                c || (i.push(m), g++)
            } else j[b] = {
                last: 0,
                msgList: []
            },
            j[b].msgList.push(m),
            g++;
            B[b] = m.msg_id;
            c = {
                last: 0,
                msgList: []
            };
            if (g > 0) {
                for (a = 0; a < g; a++) c.msgList.push(j[b].msgList[j[b].msgList.length - (g - a)]);
                j[b].last = 0;
                f.notifyObservers(this, "MessageListChange", {
                    uin: b,
                    msgList: c.msgList
                });
                f.notifyObservers(EQQ, "MessageReceive", {
                    uin: b,
                    msgList: c.msgList
                })
            }
        };
        this.receiveSystemMsg = function(a) {
            var b;
            switch (a.type) {
                case "added_buddy_sig":
                case "added_buddy_nosig":
                    b = "\u6dfb\u52a0\u60a8\u4e3a\u597d\u53cb";
                    break;
                case "verify_pass_add":
                    b = "\u63a5\u53d7\u4e86\u60a8\u7684\u8bf7\u6c42\uff0c\u5e76\u6dfb\u52a0\u60a8\u4e3a\u597d\u53cb";
                    var c = {
                        uin: a.from_uin,
                        status: alloy.util.code2state(a.stat),
                        client_type: a.client_type
                    };
                    f.notifyObservers(EQQ.Model.BuddyList, "AddANewBuddy", {
                        tuin: a.from_uin,
                        gid: a.group_id,
                        newstate: c
                    });
                    break;
                case "verify_pass":
                    b = "\u63a5\u53d7\u4e86\u60a8\u7684\u8bf7\u6c42";
                    c = {
                        uin: a.from_uin,
                        status: alloy.util.code2state(a.stat),
                        client_type: a.client_type
                    };
                    f.notifyObservers(EQQ.Model.BuddyList, "AddANewBuddy", {
                        tuin: a.from_uin,
                        gid: 0,
                        newstate: c
                    });
                    break;
                case "verify_required":
                    b = "\u8bf7\u6c42\u6dfb\u52a0\u60a8\u4e3a\u597d\u53cb\uff0c\u9644\u52a0\u4fe1\u606f(" + (a.msg || "\u65e0") + ")";
                    break;
                case "verify_rejected":
                    b = "\u62d2\u7edd\u4e86\u60a8\u7684\u8bf7\u6c42\uff0c\u9644\u52a0\u4fe1\u606f(" + (a.msg || "\u65e0") + ")";
                    break;
                default:
                    b = a.type
            }
            f.notifyObservers(EQQ, "MessageReceive", {
                msgList: [{
                    type: "add_buddy",
                    sender: {
                        htmlShowName: String(a.account)
                    },
                    from_uin: a.from_uin,
                    title: a.account,
                    content: b,
                    msg_id: a.seq,
                    opt: {
                        uin: a.from_uin,
                        account: a.account,
                        nick: a.account,
                        allow: a.allow,
                        type: a.type,
                        msg: a.msg,
                        gid: a.group_id
                    }
}]
                })
            };
            this.receiveSysGroupMsg = function(a) {
                var b, c = alloy.portal.getUin();
                switch (a.type) {
                    case "group_join":
                        b = c == a.new_member ? "\u60a8\u5df2\u7ecf\u52a0\u5165\u7fa4" + a.t_gcode : a.t_new_member + "\u5df2\u52a0\u5165\u7fa4" + a.t_gcode + "\u3002";
                        break;
                    case "group_leave":
                        a.op_type == 1 ? b = c == a.admin_uin ? "\u60a8\u5df2\u7ecf\u6210\u529f\u5730\u89e3\u6563\u4e86\u7fa4" + a.t_gcode : "\u7fa4" + a.t_gcode + "\u5df2\u7ecf\u88ab\u89e3\u6563" : a.op_type == 2 ? c != a.old_member && (b = a.t_old_member + "\u9000\u51fa\u7fa4" + a.t_gcode + "\u3002") : a.op_type == 3 && (b = c == a.old_member ? "\u60a8\u5df2\u7ecf\u88ab\u79fb\u9664\u51fa\u7fa4" + a.t_gcode : a.t_old_member + "\u5df2\u88ab\u7ba1\u7406\u5458\u79fb\u9664\u51fa\u7fa4" + a.t_gcode + "\u3002");
                        a.type = a.type + "_" + a.op_type;
                        break;
                    case "group_request_join":
                        b = a.t_request_uin + "\u7533\u8bf7\u52a0\u5165\u7fa4" + a.t_gcode;
                        break;
                    case "group_request_join_agree":
                        b = "\u7ba1\u7406\u5458\u5df2\u540c\u610f\u60a8\u52a0\u5165\u7fa4" + a.t_gcode;
                        break;
                    case "group_request_join_deny":
                        b = "\u7ba1\u7406\u5458\u5df2\u62d2\u7edd\u60a8\u52a0\u5165\u7fa4" + a.t_gcode;
                        break;
                    case "group_admin_op":
                        if (a.op_type == 0 || a.op_type == 2) b = c == a.uin ? "\u60a8\u5df2\u7ecf\u88ab\u53d6\u6d88\u7fa4" + a.t_gcode + "\u7684\u7ba1\u7406\u5458\u8eab\u4efd\u3002" : a.t_uin + "\u5df2\u7ecf\u88ab\u53d6\u6d88\u7fa4" + a.t_gcode + "\u7684\u7ba1\u7406\u5458\u8eab\u4efd\u3002";
                        else if (a.op_type == 1 || a.op_type == 3) b = c == a.uin ? "\u60a8\u5df2\u6210\u4e3a\u7fa4" + a.t_gcode + "\u7684\u7ba1\u7406\u5458\u3002" : a.t_uin + "\u5df2\u6210\u4e3a\u7fa4" + a.t_gcode + "\u7684\u7ba1\u7406\u5458\u3002";
                        else if (a.op_type == 255) if (c == a.old_uin) b = "\u60a8\u5df2\u7ecf\u6210\u529f\u5c06\u7fa4" + a.t_gcode + "\u7684\u7fa4\u4e3b\u8eab\u4efd\u8f6c\u8ba9\u7ed9" + a.t_new_uin + "\u3002";
                        else if (c == a.new_uin) b = a.t_gcode + "\u7684\u7fa4\u4e3b" + a.t_old_uin + "\u5df2\u7ecf\u5c06\u8be5\u7fa4\u8f6c\u8ba9\u7ed9\u60a8\uff0c\u73b0\u5728\u60a8\u4e3a\u8be5\u7fa4\u7fa4\u4e3b\u3002";
                        else return !1;
                        a.type = a.type + "_" + a.op_type;
                        break;
                    case "group_create":
                        b = "\u60a8\u5df2\u7ecf\u6210\u529f\u521b\u5efa\u7fa4" + a.t_gcode;
                        break;
                    default:
                        return !1
                }
                f.notifyObservers(EQQ, "MessageReceive", {
                    msgList: [{
                        type: "join_group",
                        sender: {
                            htmlShowName: String(a.from_uin)
                        },
                        from_uin: a.from_uin + "_" + a.type,
                        title: "\u7fa4\u7cfb\u7edf\u6d88\u606f",
                        content: b,
                        msg_id: a.msg_id,
                        opt: {
                            uin: a.from_uin || 0,
                            nick: a.from_uin,
                            allow: a.allow,
                            type: a.type,
                            msg: a.msg || "",
                            gid: a.from_uin,
                            value: a
                        }
}]
                    })
                };
                this.receiveGroupMsg = function(a) {
                    var b = a.from_uin,
            c = !1,
            g = 0,
            m = {
                type: "group",
                from_uin: b,
                sender_uin: a.send_uin,
                sender: EQQ.Model.BuddyList.getUserByUin(a.send_uin),
                msg_id: a.msg_id,
                content: a.content,
                group_code: EQQ.Model.BuddyList.getGroupByGid(b).code,
                time: u(a.time),
                raw_time: a.time
            };
                    if (j[b]) {
                        for (var a = j[b].msgList.length, i = 0; i < a; i++) {
                            var k = j[b].msgList[i];
                            if (m.sender_uin == k.sender_uin && k.msg_id == m.msg_id) {
                                c = !0;
                                d.out("\u53d1\u73b0\u91cd\u590d\u7fa4\u6d88\u606f\uff0cmsg_id\uff1a" + m.msg_id);
                                break
                            }
                        }
                        c || (j[b].msgList.push(m), g++)
                    } else j[b] = {
                        last: 0,
                        msgList: []
                    },
            j[b].msgList.push(m),
            g++;
                    B[b] = m.msg_id;
                    c = j[b].msgList;
                    a = c.length;
                    m = [];
                    if (g > 0) {
                        for (i = g; i > 0; i--) m.push(c[a - i]);
                        j[b].last = 0;
                        f.notifyObservers(this, "GroupMessageListChange", {
                            gid: b,
                            msgList: m
                        });
                        f.notifyObservers(EQQ, "MessageReceive", {
                            gid: b,
                            msgList: m
                        })
                    }
                };
                this.addMessageBoxUserList = function(e) {
                    var c = a[e.from_uin];
                    c ? d.array.remove(b, c) : f.notifyObservers(this, "flexStartJump", e.from_uin);
                    a[e.from_uin] = e;
                    b.push(e);
                    f.notifyObservers(this, "MessageBoxUserListChange", this.getMessageBoxUserList())
                };
                this.getMessageBoxUserList = function() {
                    return b
                };
                this.removeMessageBoxUserList = function(e) {
                    var c = a[e];
                    c && d.array.remove(b, c);
                    delete a[e];
                    f.notifyObservers(this, "flexStopJump", e);
                    f.notifyObservers(this, "MessageBoxUserListChange", this.getMessageBoxUserList())
                };
                this.addMessageBoxGroupList = function(a) {
                    var b = p[a.from_uin];
                    b && d.array.remove(c, b);
                    p[a.from_uin] = a;
                    c.push(a);
                    f.notifyObservers(this, "MessageBoxGroupListChange", this.getMessageBoxGroupList())
                };
                this.getMessageBoxGroupList = function() {
                    return c
                };
                this.removeMessageBoxGroupList = function(a) {
                    var b = p[a];
                    b && d.array.remove(c, b);
                    delete p[a];
                    f.notifyObservers(this, "MessageBoxGroupListChange", this.getMessageBoxGroupList())
                };
                this.preloadGroupMessageImages = function(a, b) {
                    var b = b || 0,
            c = a.content,
            f = a.send_uin,
            g = "",
            g = "",
            m = null,
            i = a.group_code || EQQ.Model.BuddyList.decodeDid(a.did),
            k = a.time,
            l = "",
            j = !0;
                    a.did && (j = !1);
                    for (var t = function() {
                        m = null;
                        d.out("preload-image-success!");
                        j && alloy.rpcService.reportQstatic("Monitor|Group|imgperload|Succeed")
                    },
            p = function() {
                m = null;
                d.out("preload-image-error!");
                j && alloy.rpcService.reportQstatic("Monitor|Group|imgperload|Failed")
            },
            o = 0, h = c.length; o < h; o++) if (c[o][0] === "cface") l = c[o][1],
            g = l.server.toString().split(":"),
            g = EQQ.CONST.CHAT_PIC_SERVER + "cgi-bin/get_group_pic?type=" + b + "&gid=" + i + "&uin=" + f + "&rip=" + g[0] + "&rport=" + g[1] + "&fid=" + l.file_id + "&pic=" + l.name + "&vfwebqq=" + alloy.portal.getVfWebQQ() + "&t=" + k,
            m = new Image,
            m.src = g,
            m.onload = t,
            m.onerror = p
                };
                this.onPollSuccess = function(a) {
                    if (a) {
                        a.sort(function(a, b) {
                            return (a.value && a.value.time || 0) < (b.value && b.value.time || 0) ? 1 : -1
                        });
                        for (var b = a.length - 1; b >= 0; b--) {
                            var c = a[b];
                            switch (c.poll_type) {
                                case "message":
                                    c = c.value;
                                    EQQ.Model.BuddyList.isUser(c.from_uin) ? this.receiveBuddyMsg(c) : c.msg_type === 9 ? this.receiveStrangerMsg(c) : (c.msg_type === 31 || c.msg_type === 140) && this.receiveGroupBuddyMsg(c);
                                    break;
                                case "sess_message":
                                    c = c.value;
                                    this.receiveGroupBuddyMsg(c);
                                    break;
                                case "group_message":
                                    c = c.value;
                                    this.addMessageBoxGroupList(c);
                                    this.preloadGroupMessageImages(c);
                                    this.receiveGroupMsg(c);
                                    break;
                                case "kick_message":
                                    d.out("\u8e22\u7ebf\u901a\u77e5\uff1a" + c.value);
                                    var c = c.value,
                        g = "\u60a8\u7684\u5e10\u53f7\u5728\u53e6\u4e00\u5730\u70b9\u767b\u5f55\uff0c\u60a8\u5df2\u88ab\u8feb\u4e0b\u7ebf\u3002\u5982\u6709\u7591\u95ee\uff0c\u8bf7\u767b\u5f55:safe.qq.com\u4e86\u89e3\u66f4\u591a\u3002";
                                    if (c.show_reason !== 0) g = c.reason;
                                    f.notifyObservers(EQQ, "SelfOffline", {
                                        message: g,
                                        action: "none"
                                    });
                                    break;
                                case "file_message":
                                    d.out("\u6587\u4ef6\u4fe1\u9053\u901a\u77e5" + c.value);
                                    this.receiveFile(c.value);
                                    break;
                                case "system_message":
                                    d.out("\u6536\u5230\u7cfb\u7edf\u6d88\u606f" + c.value);
                                    this.receiveSystemMsg(c.value);
                                    f.notifyObservers(EQQ, "SystemMessageRecive", c.value);
                                    break;
                                case "filesrv_transfer":
                                    d.out("\u6587\u4ef6\u4f20\u8f93\u6d88\u606f" + c.value);
                                    this.receiveTransferMsg(c.value);
                                    break;
                                case "tips":
                                    d.out("\u6536\u5230tips\u6d88\u606f" + c.value);
                                    this.receiveTipsMsg(c.value);
                                    break;
                                case "sys_g_msg":
                                    d.out("\u6536\u5230\u7fa4\u7cfb\u7edf\u6d88\u606f" + c.value);
                                    this.receiveSysGroupMsg(c.value);
                                    break;
                                case "av_request":
                                    d.out("\u6536\u5230\u89c6\u9891\u8bf7\u6c42" + c.value);
                                    this.receiveVideoMsg(c.value);
                                    break;
                                case "discu_message":
                                    d.out("\u6536\u5230\u8ba8\u8bba\u7ec4\u6d88\u606f" + c.value),
                        this.receiveDiscuMsg(c.value)
                            }
                        }
                    }
                };
                this.receiveBuddyMsg = function(a) {
                    s(a);
                    this.addMessageBoxUserList(a);
                    this.receiveMsg(a)
                };
                this.receiveStrangerMsg = function(a) {
                    var b = a.from_uin,
            c = {
                uin: b
            },
            m = EQQ.Model.BuddyList.isStranger(b),
            i = function() {
                if (!m) {
                    var b = EQQ.Model.BuddyList.createUser(c);
                    b.type = "stranger";
                    EQQ.Model.BuddyList.addStranger(b);
                    b.setClassId(EQQ.hash.userClassType.stranger);
                    EQQ.Model.BuddyList.setState(b.uin, "online", "10000");
                    f.notifyObservers(g, "NewStranger", b)
                }
                s(a);
                g.addMessageBoxUserList(a);
                g.receiveMsg(a);
                d.out("receiveStrangerMsg")
            };
                    m ? i() : alloy.rpcService.sendGetUserInfo_with_code(b, "", "",
            function(a) {
                if (a.retcode === 0) c = a.result;
                i()
            },
            function() {
                i()
            })
                };
                this.receiveGroupBuddyMsg = function(a) {
                    var b = a.from_uin,
            c, m = {
                uin: b
            },
            i = EQQ.Model.BuddyList.isUser(b),
            k = function() {
                i ? c = EQQ.Model.BuddyList.getUserByUin(b) : (c = EQQ.Model.BuddyList.createUser(m), c.type = "groupBuddy", EQQ.Model.BuddyList.addStranger(c), c.setClassId(EQQ.hash.userClassType.stranger), EQQ.Model.BuddyList.setState(c.uin, "online", "10000"), f.notifyObservers(g, "NewStranger", c), EQQ.Model.BuddyList.sendGetUserInfo(b));
                if ("service_type" in a) if (a.service_type === 0) c.currentId = a.id;
                else if (a.service_type === 1) c.currentId = EQQ.Model.BuddyList.encodeDid(a.id);
                s(a);
                g.addMessageBoxUserList(a);
                g.receiveMsg(a);
                d.out("receiveGroupBuddyMsg")
            };
                    i ? k() : alloy.rpcService.sendGetUserInfo_with_code(b, "", "",
            function(a) {
                if (a.retcode === 0) m = a.result;
                k()
            },
            function() {
                k()
            })
                };
                this.getMessagePointer = function(a) {
                    return B[a] || 0
                };
                this.getCustomFaceList = function() {
                    return i
                };
                this.getSendPicList = function() {
                    return r
                };
                this.loadCustomFaceList = function() {
                    f.addObserver(EQQ.RPCService, "SendGetCustomFaceListSuccess", K);
                    EQQ.RPCService.sendGetCustomFaceList()
                };
                var K = function(a) {
                    i = d.array.bubbleSort(a.data,
            function(a, b) {
                if (a && b) return a[1] - b[1]
            });
                    f.notifyObservers(g, "GetCustomFaceListSuccess", i);
                    f.removeObserver(EQQ.RPCService, "SendGetCustomFaceListSuccess", K)
                };
                this.deleteCustomFace = function(a) {
                    EQQ.RPCService.sendDeleteCustomFace(a)
                };
                this.getClientidFromRpc = function() {
                    return EQQ.RPCService.getClientId()
                };
                this.sendFile = function(a) {
                    var b = [["sendfile", a.filename]],
            c = {
                type: "sendfile",
                name: a.filename,
                from_uin: a.to_uin,
                time: (new Date).getTime(),
                isread: !0,
                session_id: a.lcid
            };
                    k[a.to_uin + "_" + a.lcid] = c;
                    g.addMsgToList({
                        type: "single",
                        from_uin: 0,
                        to: a.to_uin,
                        content: b,
                        attach: c
                    })
                };
                this.receiveFile = function(a) {
                    if (a.mode === "recv") {
                        var b = [["rfile", a.name, a.session_id]];
                        a.content = b;
                        a.attach = {
                            type: "rfile",
                            name: a.name,
                            from_uin: a.from_uin,
                            time: a.time,
                            isread: !1,
                            session_id: a.session_id,
                            msg_type: a.msg_type
                        };
                        var c = a.from_uin + "_" + a.session_id;
                        k[c] ? k[c] = a.attach : (k[c] = a.attach, this.fileMsgToJumpUserList(a), this.receiveMsg(a));
                        alloy.util.report2m(133161)
                    } else if (a.mode === "refuse") {
                        if (a.type !== 161) {
                            if (a.cancel_type == 2 && (D[a.session_id] = !0, b = parseInt(a.session_id, 10).toString(2), b.length >= 12)) b = b.substr(b.length - 12, 12),
                    a.session_id = parseInt(b, 2).toString(10);
                            var c = a.from_uin + "_" + a.session_id,
                    d = k[c];
                            if (typeof d == "undefined") return !1;
                            if (d.isFinished) return !1;
                            else k[c].isFinished = !0;
                            b = [["rffile", d.name]];
                            d.type = "rffile";
                            if (a.cancel_type == 2) b = [["wrffile", d.name]],
                    d.type = "wrffile";
                            else if (a.cancel_type == 3) b = [["rtfile", d.name]],
                    d.type = "rtfile";
                            a.content = b;
                            a.attach = d;
                            this.fileMsgToJumpUserList(a);
                            this.receiveMsg(a);
                            a.cancel_type != 2 && f.notifyObservers(this, "fromCancenFile", c);
                            alloy.util.report2m(133178)
                        }
                    } else if (a.mode === "send_ack") {
                        b = parseInt(a.session_id, 10).toString(2);
                        if (b.length < 12) return !1;
                        b = b.substr(b.length - 12, 12);
                        a.session_id = parseInt(b, 2).toString(10);
                        c = a.from_uin + "_" + a.session_id;
                        d = k[c];
                        b = [["wrfile", d.name, d.session_id]];
                        a.content = b;
                        a.attach = {
                            type: "wrfile",
                            name: d.name,
                            from_uin: d.from_uin,
                            time: a.time,
                            session_id: a.session_id
                        };
                        this.fileMsgToJumpUserList(a);
                        this.receiveMsg(a);
                        alloy.util.report2m(133179)
                    }
                };
                this.receiveVideoMsg = function(a) {
                    a.content = [["cvideo", "\u5bf9\u65b9\u6b63\u5728\u4f7f\u7528QQ\u5ba2\u6237\u7aef\u5411\u60a8\u53d1\u8d77\u89c6\u9891\u9080\u8bf7\uff0cWebQQ\u6682\u65f6\u4e0d\u80fd\u54cd\u5e94\u5ba2\u6237\u7aef\u89c6\u9891\u9080\u8bf7\uff0c\u4f46\u60a8\u53ef\u4ee5\u4e3b\u52a8\u53d1\u8d77\u89c6\u9891\u3002"]];
                    a.attach = {
                        type: "cvideo",
                        from_uin: a.from_uin,
                        msg_id: a.msg_id,
                        isCvideo: !0
                    };
                    this.fileMsgToJumpUserList(a);
                    this.receiveMsg(a);
                    EQQ.sendMsg(a.from_uin, "     \u5bf9\u65b9\u6b63\u5728\u4f7f\u7528WebQQ\u4e0d\u80fd\u54cd\u5e94\u60a8\u7684\u89c6\u9891\u9080\u8bf7\uff0c\u4f46\u5bf9\u65b9\u53ef\u4ee5\u4e3b\u52a8\u53d1\u8d77\uff08\u60a8\u9700\u8981\u70b9\u51fb\u9080\u8bf7\u94fe\u63a5\u8df3\u8f6c\u81f3WebQQ\u4e0e\u597d\u53cb\u8fdb\u884c\u89c6\u9891\u4f1a\u8bdd\uff09\u3002");
                    qqweb.util.report2im("mining|c2w|invite")
                };
                this.agreeReceiveFile = function(a) {
                    var b = [["agfile", a.name, a.session_id]];
                    a.type = "agfile";
                    g.addMsgToList({
                        type: "single",
                        from_uin: 0,
                        to: a.from_uin,
                        content: b,
                        attach: a
                    })
                };
                this.refuseReceiveFile = function(a) {
                    var b = [["rffile", a.name, a.session_id]];
                    a.type = "rffile";
                    g.addMsgToList({
                        type: "single",
                        from_uin: 0,
                        to: a.from_uin,
                        content: b,
                        attach: a
                    });
                    k[a.from_uin + "_" + a.session_id].isFinished = !0;
                    b = g.getClientidFromRpc();
                    EQQ.RPCService.sendRefuseFile({
                        to: a.from_uin,
                        lcid: a.session_id,
                        clientid: b
                    })
                };
                this.getFilesList = function() {
                    return k
                };
                this.fileMsgToJumpUserList = function(a) {
                    if (a.cancel_type && a.cancel_type == 2) return this.addMessageBoxUserList(a),
            !0;
                    if (typeof a.msg_type === "undefined" && !a.msg_type) {
                        var b = k[a.from_uin + "_" + a.session_id];
                        if (typeof b.msg_type === "undefined" && !b.msg_type) return !1;
                        a.msg_type = b.msg_type
                    }
                    b = EQQ.Model.BuddyList.isBuddy(a.from_uin);
                    a.msg_type === 9 ? b ? this.addMessageBoxUserList(a) : this.receiveStrangerFileMsg(a) : a.msg_type === 10 ? b && this.receiveStrangerFileMsg(a) : a.msg_type === 31 && this.receiveGroupBuddyFileMsg(a)
                };
                this.receiveStrangerFileMsg = function(a) {
                    var b = a.from_uin;
                    EQQ.Model.BuddyList.isStranger(b) || (b = EQQ.Model.BuddyList.createUser({
                        uin: b
                    }), EQQ.Model.BuddyList.addStranger(b), b.setClassId(EQQ.hash.userClassType.stranger), EQQ.Model.BuddyList.setState(b.uin, "online", "unknown"), f.notifyObservers(this, "NewStranger", b));
                    this.addMessageBoxUserList(a);
                    d.out("receiveStrangerFileMsg")
                };
                this.receiveGroupBuddyFileMsg = function(a) {
                    var b = a.from_uin;
                    if (!EQQ.Model.BuddyList.isStranger(b)) {
                        var c = EQQ.Model.BuddyList.createUser({
                            uin: b
                        });
                        EQQ.Model.BuddyList.addStranger(c);
                        c.type = "groupBuddy";
                        c.setClassId(EQQ.hash.userClassType.stranger);
                        EQQ.Model.BuddyList.setState(c.uin, "online", "unknown");
                        f.notifyObservers(this, "NewStranger", c);
                        EQQ.Model.BuddyList.sendGetUserInfo(b)
                    }
                    this.addMessageBoxUserList(a);
                    d.out("receiveGroupBuddyFileMsg, finish")
                };
                this.receiveTransferMsg = function(a) {
                    var b = a.file_infos[0];
                    if (b.file_name != "") {
                        var c = "",
                d = "";
                        if (b.file_status == 51) c = [["transtimeout", b.file_name, a.lc_id]],
                d = {
                    type: "transtimeout",
                    name: b.file_name,
                    isread: !0
                };
                        else if (b.file_status == 50) c = [["transerror", b.file_name, a.lc_id]],
                d = {
                    type: "transerror",
                    name: b.file_name,
                    isread: !0
                };
                        else if (b.file_status == 53) c = [["refusedbyclient", b.file_name, a.lc_id]],
                d = {
                    type: "refusedbyclient",
                    name: b.file_name,
                    isread: !0
                };
                        else if (b.file_status == 0) c = [["transok", b.file_name, a.lc_id]],
                d = {
                    type: "transok",
                    name: b.file_name,
                    isread: !0
                },
                alloy.util.report2m(133176),
                a.operation == 1 ? alloy.util.report2m(133152) : a.operation == 2 && alloy.util.report2m(133165);
                        else return b.file_status != 10 && alloy.util.report2m(133177),
                !1;
                        b = k[a.from_uin + "_" + a.lc_id] || {};
                        if (b.isFinished || typeof D[a.session_id] != "undefined" && D[a.session_id] === !0) return !1;
                        else b.isFinished = !0;
                        g.addMsgToList({
                            type: "single",
                            from_uin: 0,
                            to: a.to_uin,
                            content: c,
                            attach: d
                        })
                    }
                };
                this.receiveTipsMsg = function(a) {
                    if ((a.url || "").indexOf("run=mySignature") === -1) return !1;
                    var b = a.txt3.replace("\r\n", ":");
                    a.content = b;
                    a.type = "mysigntips";
                    b = {
                        type: "mysigntips",
                        sender: {
                            htmlShowName: String(a.from_uin)
                        },
                        from_uin: a.from_uin,
                        allow: 1,
                        content: b,
                        msg_id: a.msg_id,
                        opt: {
                            uin: a.from_uin,
                            nick: a.from_uin,
                            msg_id: a.msg_id,
                            type: "mysigntips"
                        }
                    };
                    a.aMag = b;
                    f.notifyObservers(EQQ, "MessageReceive", {
                        msgList: [b]
                    })
                };
                this.getMoreLog = function(a) {
                    qqweb.rpcService.sendGetGroupLogByTime({
                        c: a.total,
                        gid: a.gid,
                        gcode: a.gcode,
                        uk: a.uin,
                        tt: a.time,
                        m: a.precount
                    },
            this.getMoreLogSuccess, this.getMoreLogError)
                };
                this.getMoreLogSuccess = function(a) {
                    f.notifyObservers(EQQ.Model.ChatMsg, "GetMoreLogSuccess", a)
                };
                this.getMoreLogError = function(a) {
                    f.notifyObservers(EQQ.Model.ChatMsg, "GetMoreLogError", a);
                    d.error("getMoreLogError")
                };
                this.receiveDiscuMsg = function(a) {
                    a.did = EQQ.Model.BuddyList.encodeDid(a.did);
                    var b = EQQ.Model.BuddyList.getDiscuById(a.did);
                    if (b) this.addMessageBoxDiscuList(a),
            this.preloadGroupMessageImages(a, 1),
            this.parseDiscuMsg(a),
            G(b, a.content);
                    else {
                        o[a.did] = o[a.did] || [];
                        o[a.did].push(a);
                        for (var b = {
                            did: a.did
                        },
                c = "", f = 0; f < a.content.length; f++) {
                            var g = a.content[f];
                            if (d.isArray(g)) if (g[0] == "face") {
                                c = "[\u8868\u60c5]";
                                break
                            } else {
                                if (g[0] == "cface") {
                                    c = "[\u56fe\u7247]";
                                    break
                                }
                            } else {
                                c = $S.cutByBytes(g.toString(), 20);
                                break
                            }
                        }
                        b.name = c;
                        EQQ.Model.BuddyList.getAndAddDiscu(b)
                    }
                };
                this.parseDiscuMsg = function(a) {
                    var b = a.did,
            c = !1,
            g = 0,
            m = {
                type: "discu",
                from_uin: b,
                sender_uin: a.send_uin,
                sender: EQQ.Model.BuddyList.getUserByUin(a.send_uin),
                msg_id: a.msg_id,
                content: a.content,
                did: b,
                time: u(a.time),
                raw_time: a.time
            };
                    if (j[b]) {
                        for (var i = j[b].msgList.length, k = 0; k < i; k++) {
                            var t = j[b].msgList[k];
                            if (m.sender_uin == t.sender_uin && t.msg_id == m.msg_id) {
                                c = !0;
                                d.out("\u53d1\u73b0\u91cd\u590ddiscu\u6d88\u606f\uff0cmsg_id\uff1a" + m.msg_id);
                                break
                            }
                        }
                        c || (j[b].msgList.push(m), g++)
                    } else j[b] = {
                        last: 0,
                        msgList: []
                    },
            j[b].msgList.push(m),
            g++;
                    B[b] = m.msg_id;
                    c = j[b].msgList;
                    i = c.length;
                    m = [];
                    if (g > 0) {
                        for (k = g; k > 0; k--) m.push(c[i - k]);
                        j[b].last = 0;
                        f.notifyObservers(this, "DiscuMessageListChange", {
                            did: b,
                            msgList: m
                        });
                        f.notifyObservers(EQQ, "MessageReceive", {
                            did: b,
                            msgList: m
                        })
                    }
                    q != null && q != a.info_seq && f.notifyObservers(this, "ServerDiscuInfochange", {
                        did: b
                    });
                    q = a.info_seq
                };
                this.addMessageBoxDiscuList = function(a) {
                    var b = z[a.did];
                    b && d.array.remove(m, b);
                    z[a.did] = a;
                    m.push(a);
                    f.notifyObservers(this, "MessageBoxDiscuListChange", this.getMessageBoxDiscuList())
                };
                this.getMessageBoxDiscuList = function() {
                    return m
                };
                this.removeMessageBoxDiscuList = function(a) {
                    var b = z[a];
                    b && d.array.remove(m, b);
                    delete z[a];
                    f.notifyObservers(this, "MessageBoxDiscuListChange", this.getMessageBoxDiscuList())
                };
                this.getDiscuMsgHistory = function(a) {
                    j[a] && f.notifyObservers(this, "DiscuMessageListChange", {
                        did: a,
                        msgList: j[a].msgList
                    })
                };
                this.onAddDiscuByMsgSuccess = function(a) {
                    var a = o[a.did],
            b;
                    for (b in a) {
                        var c = a[b];
                        c.did = EQQ.Model.BuddyList.decodeDid(c.did);
                        this.receiveDiscuMsg(c)
                    }
                };
                var G = function(a, b) {
                    if (!a.notSetName || a.hadModified) return !1;
                    for (var c = {
                        did: a.did
                    },
            f = "", g = 0; g < b.length; g++) {
                        var m = b[g];
                        if (d.isArray(m)) if (m[0] == "face") {
                            f = "[\u8868\u60c5]";
                            break
                        } else {
                            if (m[0] == "cface") {
                                f = "[\u56fe\u7247]";
                                break
                            }
                        } else if (!(m == "\n" || m == " ")) {
                            f = $S.cutByBytes(m.toString(), 20);
                            break
                        }
                    }
                    c.discu_name = f;
                    EQQ.Model.BuddyList.sendModifyDiscuTopic(c)
                };
                this.saveHtmlMsg = function(a, b) {
                    t[a] = t[a] || [];
                    t[a].push(b)
                };
                this.getHtmlMsg = function(a) {
                    return d.isUndefined(t[a]) ? "" : t[a].join("")
                }
            })
        })(); (function() {
            var d = {
                statePanel: '<li class="EQQ_statePanel_li" id="EQQ_SetOnline" state="online"><div class="EQQ_stateSelect_icon EQQ_online"></div><div class="EQQ_stateSelect_text">\u6211\u5728\u7ebf\u4e0a</div></li>                    <li class="EQQ_statePanel_li" id="EQQ_SetCallme" state="callme"><div class="EQQ_stateSelect_icon EQQ_callme"></div><div class="EQQ_stateSelect_text">Q\u6211\u5427</div></li>                    <li class="EQQ_statePanel_li" id="EQQ_SetAway" state="away"><div class="EQQ_stateSelect_icon EQQ_away"></div><div class="EQQ_stateSelect_text">\u79bb\u5f00</div></li>                    <li class="EQQ_statePanel_li" id="EQQ_SetBusy" state="busy"><div class="EQQ_stateSelect_icon EQQ_busy"></div><div class="EQQ_stateSelect_text">\u5fd9\u788c</div></li>                    <li class="EQQ_statePanel_li" id="EQQ_SetSilent" state="silent"><div class="EQQ_stateSelect_icon EQQ_silent"></div><div class="EQQ_stateSelect_text">\u8bf7\u52ff\u6253\u6270</div></li>                    <li class="EQQ_statePanel_li" id="EQQ_SetHidden" state="hidden"><div class="EQQ_stateSelect_icon EQQ_hidden"></div><div class="EQQ_stateSelect_text">\u9690\u8eab</div></li>                    <li class="EQQ_statePanel_li" id="EQQ_SetOffline" state="offline"><div class="EQQ_stateSelect_icon EQQ_offline"></div><div class="EQQ_stateSelect_text">\u79bb\u7ebf</div></li>                    <li class="EQQ_statePanel_li EQQ_SetSound statusBar_sound_open" id="EQQ_SetSound"><div class="EQQ_stateSelect_icon EQQ_SetSound_icon"></div><div class="EQQ_stateSelect_text">\u9759\u97f3</div></li>',
                groupMaskPanel: '<a id="GroupMask_Costom" state="0" class="simpleMenuItem" href="###"><div class="selectedIcon"></div>\u4f7f\u7528\u7fa4\u81ea\u8eab\u7684\u6d88\u606f\u8bbe\u7f6e</a>\t\t\t\t\t\t<a id="GroupMask_Prompt" state="1" class="simpleMenuItem" href="###"><div class="selectedIcon"></div>\u6240\u6709\u7fa4\u63a5\u6536\u5e76\u63d0\u793a\u6d88\u606f</a>\t\t\t\t\t\t<a id="GroupMask_NoPrompt" state="2" class="simpleMenuItem" href="###"><div class="selectedIcon"></div>\u6240\u6709\u7fa4\u63a5\u6536\u4e0d\u63d0\u793a\u6d88\u606f</a>\t\t\t\t\t\t<a id="GroupMask_Mask" state="3" class="simpleMenuItem" href="###"><div class="selectedIcon"></div>\u6240\u6709\u7fa4\u5b8c\u5168\u963b\u6b62\u7fa4\u6d88\u606f</a>',
                miniCardPanel: '<div class="panel_1_outer">\t\t\t\t<div class="panel_1_inner">\t\t\t\t\t<div class="panel_1_container">\t\t\t\t\t\t<div id="panel_1_center" class="panel_1 panel_1_center"></div>\t\t\t\t\t\t<div id="panel_1_t" class="panel_1 panel_1_t"></div>\t\t\t\t\t\t<div id="panel_1_rt" class="panel_1 panel_1_rt"></div>\t\t\t\t\t\t<div id="panel_1_r" class="panel_1 panel_1_r"></div>\t\t\t\t\t\t<div id="panel_1_rb" class="panel_1 panel_1_rb"></div>\t\t\t\t\t\t<div id="panel_1_b" class="panel_1 panel_1_b"></div>\t\t\t\t\t\t<div id="panel_1_lb" class="panel_1 panel_1_lb"></div>\t\t\t\t\t\t<div id="panel_1_l" class="panel_1 panel_1_l"></div>\t\t\t\t\t\t<div id="panel_1_lt" class="panel_1 panel_1_lt"></div>\t\t\t\t\t</div>\t\t\t\t\t<div id="miniCardBody" class="panel_1_content">\t\t\t\t\t\t<img id="miniCard_avatar" class="miniCard_avatar" />\t\t\t\t\t\t<div class="miniCard_name">\t\t\t\t\t\t\t<div id="miniCard_name_inner" class="miniCard_name_inner"></div>\t\t\t\t\t\t</div>\t\t\t\t\t\t<div id="miniCard_signature" class="miniCard_signature">\t\t\t\t\t\t\t<div id="miniCard_signature_inner" class="miniCard_signature_inner"></div>\t\t\t\t\t\t</div>\t\t\t\t\t\t<div id="miniCard_clientType_innerWrapper" class ="miniCard_clientType_innerWrapper"><div class ="miniCard_clientTypeIcon"></div><div id="miniCard_clientType_inner" class="miniCard_clientType_inner"></div></div>\t\t\t\t\t\t<div id="miniCard_level" class="miniCard_level"></div>\t\t\t\t\t\t<div id="miniCard_level_upinfo" class="miniCard_level_upinfo"></div>\t\t\t\t\t\t<div id="miniCard_quickLink" class="miniCard_quickLink">\t\t\t\t\t\t\t<a id="miniCard_video" class="miniCard_video" type="video" title="\u5f00\u59cb\u89c6\u9891\u4f1a\u8bdd" hidefocus target="_blank" href="###"></a>\t\t\t\t\t\t\t<a id="miniCard_qzone" class="miniCard_qzone" type="qzone" title="\u8bbf\u95eeQQ\u7a7a\u95f4" hidefocus target="_blank" href="###"></a>\t\t\t\t\t\t\t<a id="miniCard_qmail" class="miniCard_qmail" type="qmail" title="\u53d1\u9001\u90ae\u4ef6" hidefocus target="_blank" href="###"></a>\t\t\t\t\t\t</div>\t\t\t\t\t\t<div id="miniCard_buddyOption_tabHead" class="buddyOption_tabHead">\t\t\t\t\t\t\t<div id="miniCard_userDetails" class="buddyOption_tabHead_div">\u8be6\u7ec6\u8d44\u6599</div>\t\t\t\t\t\t</div>\t\t\t\t\t\t<div id="miniCard_buddyOption_tabBody" class="buddyOption_tabBody">\t\t\t\t\t\t</div>\t\t\t\t\t</div>\t\t\t\t</div>\t\t\t</div>',
                myPanel: '<div id="EQQ_MyPanel" class="EQQ_myPanel">                    <img id="EQQ_MyAvatar" class="EQQ_myAvatar"/>                    <div id="EQQ_myInfo" class="EQQ_myInfo">                        <div id="EQQ_MyState" class="EQQ_myState" title="\u6211\u7684\u72b6\u6001">                            <div id="EQQ_MyStateShow" class="EQQ_myStateShow EQQ_offline">\u72b6\u6001</div>                            <div class="EQQ_myStateDown">\u4e0b</div>                        </div>                        <div id="EQQ_MyNick" class="EQQ_myNick" title=""></div>                        <\!--div id="EQQ_MyPanel_ExitButton" title="\u9000\u51fa">\u9000\u51fa</div--\>                    </div>                    <div id="EQQ_myService" class="EQQ_myService">                        <div id="EQQ_mySignature_wraper" class="EQQ_mySignature_wraper"><input id="EQQ_MySignature" class="EQQ_mySignature" type="text" title="" /></div>                    </div>            </div>            <div id="eqqMypanelToolbar" class="eqq_mypanel_toolbar">                <a href="###" title="QQ\u7a7a\u95f4" appId="16" report="qzone" class="eqq_mypanel_toolbar_button"><span class="eqq_mypanel_toolbar_icon eqq_mypanel_toolbar_qzone"></span></a>                <a href="###" title="QQ\u90ae\u7bb1" appId="17" report="mail" class="eqq_mypanel_toolbar_button "><span class="eqq_mypanel_toolbar_icon eqq_mypanel_toolbar_mail"></span></a>                <a href="###" title="\u817e\u8baf\u5fae\u535a" appId="2" report="weibo" class="eqq_mypanel_toolbar_button "><span class="eqq_mypanel_toolbar_icon eqq_mypanel_toolbar_weibo"></span></a>                <a href="###" title="\u6211\u7684\u8d44\u8baf" appId="14" report="news" class="eqq_mypanel_toolbar_button "><span class="eqq_mypanel_toolbar_icon eqq_mypanel_toolbar_news"></span></a>                <a href="###" title="QQ\u94b1\u5305" appId="4333" report="money" class="eqq_mypanel_toolbar_button "><span class="eqq_mypanel_toolbar_icon eqq_mypanel_toolbar_money"></span></a>                <a href="###" title="\u817e\u8baf\u670b\u53cb" appId="21" report="pengyou" class="eqq_mypanel_toolbar_button "><span class="eqq_mypanel_toolbar_icon eqq_mypanel_toolbar_pengyou"></span></a>                <a href="###" title="\u7f51\u7edc\u786c\u76d8" appId="13" report="harddisk" class="eqq_mypanel_toolbar_button "><span class="eqq_mypanel_toolbar_icon eqq_mypanel_toolbar_harddisk" ' + (Jet().platform.iPad ? ' style="opacity:0.3;" ' : "") + " ></span></a>            </div>",
                mainPanelHeader: '<div class="EQQ_title">\t\t\t\t<div id="EQQ_PinDownButton" class="EQQ_PinDownButton" title="\u9489\u4f4f/\u6536\u8d77">\u9489\u4f4f/\u6536\u8d77</div>\t\t\t\t<div id="EQQ_CloseButton" class="EQQ_CloseButton" title="\u9690\u85cf\u597d\u53cb\u5217\u8868">\u6700\u5c0f\u5316</div>\t\t\t\t<div id="EQQ_MinButton" class="EQQ_MinButton" title="\u8bbe\u7f6e">\u8bbe\u7f6e</div>\t\t\t\t<a class="EQQ_FeedbackButton2" href="http://support.qq.com/portal/discuss_pdt/420_1.html" target="_blank">\u53cd\u9988</a>\t\t\t\t<div id="EQQ_SettingButton" class="EQQ_settingButton" title="\u8bbe\u7f6eWebQQ">\t\t\t\t\t<div class="EQQ_settingButtonIcon">\u4e0b</div>\t\t\t\t\t<div>\u8bbe\u7f6e</div>\t\t\t\t</div>\t\t\t\t<div class="EQQ_titleText" href="#" target="_blank" title="\u8054\u7cfb\u4eba">\u8054\u7cfb\u4eba</div>\t\t\t\t<div class="EQQ_betaText" title="1.0.10.12"></div>\t\t\t</div>\t\t\t<div id="EQQ_YellowTips" class="EQQ_YellowTips">\t\t\t\t<div id="EQQ_YellowTips_CloseButton" class="EQQ_YellowTips_CloseButton" title="\u5173\u95ed\u63d0\u793a">X</div>\t\t\t\t<a class="EQQ_YellowTips_Link" href="http://survey.qq.com/cgi-bin/submitsurvey?id=2473&qpage=1&page=1&rm=dnN4k1bBG" target="_blank">\u9080\u8bf7\u53c2\u4e0eWebQQ\u7528\u6237\u8c03\u67e5</a>\t\t\t</div>',
                mainPanelFooter: '<div>                    <div id="EQQ_Logining">\u53d1\u8d77\u8fde\u63a5...</div>                </div>                <div id="EQQ_Logining_feedback"><a href="http://support.qq.com/write.shtml?guest=1&fid=513" target="_blank">                    <span class="warnning_yellow"> </span>\u53cd\u9988\u767b\u5f55\u5efa\u8bae</a></div>                <div id="EQQ_ReLoginPanel">                    <div id="EQQ_ReLoginPanel_inner"><div style="display:inline;" id="EQQ_ReLoginButton_text">\u767b\u5f55\u5931\u8d25</div>\uff0c<span id="EQQ_ReLoginButton">\u91cd\u8bd5</span></div>                </div>',
                searchReaultPanel: '<div id="EQQ_SearchResultPanel" class="EQQ_SearchResultPanel-1">                <div class="EQQ_SearchResultItem" title="">Kevity1(666666)</div>                <div class="EQQ_SearchResultItemHover" title="">Kevity2(666666)</div>                <div class="EQQ_SearchResultItem" title="">Kevity3(66666)</div>            </div>',
                searchReaultPanelFlex: '<div id="EQQ_SearchResultPanel_iframeWrap" class="EQQ_SearchResultPanel_iframeWrap">                <div id="EQQ_SearchResultPanel" class="EQQ_SearchResultPanel">                    <div class="EQQ_SearchResultItem" title="">Kevity1(666666)</div>                    <div class="EQQ_SearchResultItemHover" title="">Kevity2(666666)</div>                    <div class="EQQ_SearchResultItem" title="">Kevity3(66666)</div>                </div>                <iframe class="EQQ_SearchResultPanel_iframe"></iframe>            </div>',
                buddyListBody: "",
                buddyListBodyFlex: '<iframe id="iframe_fflist" width="100%" height="100%"  border="0" frameborder="0" style="border:0;overflow:hidden;" allowtransparency="true" src="' + qqweb.CONST.MAIN_URL + 'swf/fflist.html?t=20110113001"></iframe>    <\!--<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="100%" height="100%" id="fflist" align="middle">    <param name="movie" value="./module/eqq/swf/fflist.swf" />    <param name="quality" value="high" />    <param name="play" value="true" />    <param name="loop" value="true" />    <param name="wmode" value="transparent" />    <param name="scale" value="showall" />    <param name="menu" value="true" />    <param name="devicefont" value="false" />    <param name="salign" value="" />    <param name="allowScriptAccess" value="always" />    <embed wmode="transparent" src="./module/eqq/swf/fflist.swf" width="100%" height="100%" quality="high" pluginspage="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash"type="application/x-shockwave-flash"></embed></object--\>',
                mainPanelBody: '<div id="EQQ_LoginSuccess">\t\t\t\t<div id="EQQ_SearchBar" class="EQQ_SearchBar">\t\t\t\t\t<input id="EQQ_SearchBox" class="EQQ_SearchBox" name="" type="text" value="\u641c\u7d22\u597d\u53cb..." title="\u641c\u7d22\u597d\u53cb..." />\t\t\t\t\t<div id="EQQ_SearchButton" class="EQQ_SearchButton" title="\u641c\u7d22...">\u641c\u7d22\u6309\u94ae</div>\t\t\t\t</div>\t\t\t\t<%=searchReaultPanel%>\t\t\t\t<ul class="EQQ_tab">\t\t\t\t\t<li id="EQQ_TabBuddyList" class="EQQ_tabBuddyList" title="\u8054\u7cfb\u4eba"><a href="###" id="EQQ_TabBuddyList_MenuIcon" class="EQQ_tabmenu_icon"></a><div class="EQQ_tabBuddyList_icon"></div></li>\t\t\t\t\t<li id="EQQ_TabGroupList" class="EQQ_tabGroupList" title="\u7fa4/\u8ba8\u8bba\u7ec4"><a href="###" id="EQQ_TabGroupList_MenuIcon" class="EQQ_tabmenu_icon"></a><div class="EQQ_tabGroupList_icon"></div></li>\t\t\t\t\t<li id="EQQ_TabRecentList" class="EQQ_tabRecentList" title="\u6700\u8fd1\u8054\u7cfb\u4eba"><a href="###" id="EQQ_TabRecentList_MenuIcon" class="EQQ_tabmenu_icon"></a><div class="EQQ_tabRecentList_icon"></div></li>\t\t\t\t</ul>\t\t\t\t<div id="EQQ_ListContainer">\t\t\t\t\t<div id="EQQ_buddyListPanel" class="EQQ_buddyListPanel ">\t\t\t\t\t\t<div id="EQQ_buddyList" class="EQQ_buddyList">\t\t\t\t\t\t<%=buddyListBody%>                        </div>\t\t\t\t\t\t<div id="EQQ_buddyListPanelBottom" class="EQQ_ListBottom">\t\t\t\t\t\t\t\t<a href="" id="EQQ_findBuddy" class="searchBuddy" target="_blank"><div class="searchBuddy_div"></div>\u67e5\u627e</a>\t\t\t\t\t\t\t\t<a href="" id="EQQ_buddyManage" class="buddy_manage_icon" target="_blank"><div class="buddy_manage_icon_div"></div>\u597d\u53cb\u7ba1\u7406</a>                                <a href="" id="EQQ_messageManage" class="message_manage_icon" target="_blank"><div class="message_manage_icon_div"></div>\u6d88\u606f\u7ba1\u7406</a>\t\t\t\t\t\t</div>\t\t\t\t\t</div>\t\t\t\t\t<div id="EQQ_groupListPanel" class="EQQ_groupListPanel ">\t\t\t\t\t\t<ul id="EQQ_groupTab" class="EQQ_groupTab"><li id="EQQ_groupTabGroup" class="seled">QQ\u7fa4</li><li id="EQQ_groupTabDiscu">\u8ba8\u8bba\u7ec4</li></ul>\t\t\t\t\t\t<div id="EQQ_groupBox" class="EQQ_groupBox">\t\t\t\t\t\t\t<div id="EQQ_groupListOuter" class="EQQ_groupListOuter"><div id="EQQ_groupListInner" class="EQQ_groupListInner"></div></div>\t\t\t\t\t\t\t<div id="EQQ_groupListPanelBottom" class="EQQ_ListBottom">\t\t\t\t\t\t\t\t<a id="EQQ_createGroupButton" class="createGroup" href="http://qun.qq.com/air/create" target="_blank" title="\u521b\u5efa\u7fa4"><div class="createGroup_div"></div>\u521b\u5efa</a>\t\t\t\t\t\t\t\t<a id="EQQ_searchGroupButton" class="searchGroup" href="http://qun.qq.com/air/search" target="_blank" title="\u67e5\u627e\u7fa4"><div class="searchGroup_div"></div>\u67e5\u627e</a>\t\t\t\t\t\t\t\t<div id="EQQ_ListBottom_maskButton"><div></div>\u7fa4\u5c4f\u853d</div>\t\t\t\t\t\t\t</div>\t\t\t\t\t\t</div>\t\t\t\t\t\t<div id="EQQ_discuBox" class="EQQ_groupBox" style="display:none">\t\t\t\t\t\t\t<div id="EQQ_discuListOuter" class="EQQ_groupListOuter">\t\t\t\t\t\t\t\t<div id="EQQ_discuListInner" class="EQQ_groupListInner"></div>\t\t\t\t\t\t\t\t<div id="EQQ_discuListFail" class="EQQ_groupListInner EQQ_failBox">\t\t\t\t\t\t\t\t\t<div id="EQQ_discuReLogin_text" style="display: inline;">\u767b\u5f55\u5931\u8d25,<a href="#">\u91cd\u8bd5</a></div>   \t\t\t\t\t\t\t\t\t<div id="EQQ_discuReLogining_text" class="EQQ_discuReLogining_text">Loading...</div>\t\t\t\t\t\t\t\t</div>\t\t\t\t\t\t\t\t<div id="EQQ_discuCreate" class="EQQ_discuCreate">\t\t\t\t\t\t\t\t\t<div class="EQQ_discuCreate_text">\u8ba8\u8bba\u7ec4\u80fd\u8f7b\u677e\u53d1\u8d77\u591a\u4eba\u4f1a\u8bdd</div>\t\t\t\t\t\t\t\t\t<div class="EQQ_discuCreate_button_container">\t\t\t\t\t\t\t\t\t\t<a id="EQQ_discuCreate_button" class="createGroup" href="#" target="_blank" title="\u521b\u5efa\u8ba8\u8bba\u7ec4"></a>\t\t\t\t\t\t\t\t\t</div>\t\t\t\t\t\t\t\t</div>\t\t\t\t\t\t\t</div>\t\t\t\t\t\t\t<div id="EQQ_discuListPanelBottom" class="EQQ_ListBottom">\t\t\t\t\t\t\t\t<a id="EQQ_createDiscuButton" class="createGroup" href="#" target="_blank" title="\u521b\u5efa\u8ba8\u8bba\u7ec4"><div class="createGroup_div"></div>\u521b\u5efa\u8ba8\u8bba\u7ec4</a>\t\t\t\t\t\t\t</div>\t\t\t\t\t\t</div>\t\t\t\t\t</div>\t\t\t\t\t<div id="EQQ_recentListPanel" class="EQQ_recentListPanel "><div id="EQQ_recentList" class="EQQ_recentList"></div></div>\t\t\t\t</div>\t\t\t</div>'
            },
    g = function(d) {
        $D = d.dom;
        $E = d.event;
        $S = d.string;
        var b = !1;
        this.createDiscu = function(a) {
            a.preventDefault();
            alloy.portal.runApp("selectBuddy", {
                title: "\u521b\u5efa\u8ba8\u8bba\u7ec4",
                isAddSelf: !0,
                maxBuddy: 20,
                onSelected: EQQ.Model.BuddyList.createDiscu
            })
        };
        this.onDiscuListClick = function(a) {
            a = a.getAttribute("did");
            $E.notifyObservers(this, "StartDiscuChat", a);
            pgvSendClick({
                hottag: "web2qq.qqpanel.discu.sendmsg"
            });
            alloy.util.report2im("qqpanel|dicussions|sendmsg")
        };
        this.getNewNode = function(a, b) {
            var b = b || !1,
            d = "",
            f = b ? "EQQ_RecentList_State_" + a.did : "EQQ_discuList_State_" + a.did,
            g = b ? "EQQ_RecentDiscuList_State_" + a.did : "EQQ_discuList_Name_" + a.did;
            parseInt(a.mask) > 0 && (d = " EQQ_GroupMask_State");
            d = $S.template('\t\t\t\t<div class="EQQ_GroupList_AvatarContainer">\t\t\t\t\t<div class="EQQ_discuList_Avatar"></div>\t\t\t\t\t<div class="EQQ_GroupList_State ' + d + '" id="' + f + '" title="\u8ba8\u8bba\u7ec4\u5c4f\u853d"></div>\t\t\t\t</div>\t\t\t\t<div class="EQQ_GroupList_RightContainer" title="<%=titleName%>">\t\t\t\t\t<div id="' + g + '" class="EQQ_GroupList_Name"><%=htmlName%></div>\t\t\t\t</div>\t\t\t', a);
            f = $D.node("div", {
                id: b ? "EQQ_Recent_" + a.did : "EQQ_Discu_" + a.did,
                did: a.did,
                "class": "EQQ_GroupList_Group"
            });
            f.innerHTML = d;
            return f
        };
        this.removeDiscu = function(a) {
            var b = $D.id("EQQ_Discu_" + a);
            if (b && ($E.off(b), b.parentNode)) {
                var d = b.parentNode;
                d.removeChild(b)
            }
            if (a = $D.id("EQQ_Recent_" + a)) if ($E.off(a), a.parentNode) d = a.parentNode,
            d.removeChild(a); (d = $D.id("EQQ_discuListInner")) && d.innerHTML == "" && this.showCreatePanel()
        };
        this.discuJumpUp = function(a) {
            b = !0;
            for (var c = 0; c < a.length; c++) {
                var d = $D.id("EQQ_Discu_" + a[c]);
                d && $D.addClass(d, "EQQ_jumpUpInGroupList")
            }
        };
        this.discuJumpDown = function(a) {
            b = !1;
            for (var c = 0; c < a.length; c++) {
                var d = $D.id("EQQ_Discu_" + a[c]);
                d && $D.removeClass(d, "EQQ_jumpUpInGroupList")
            }
        };
        this.discuJumpAvatar = function(a) {
            b ? this.discuJumpDown(a) : this.discuJumpUp(a)
        };
        this.onCreateDiscu = function(a, b) {
            a.preventDefault();
            alloy.portal.runApp("selectBuddy", {
                title: "\u521b\u5efa\u8ba8\u8bba\u7ec4",
                isAddSelef: !0,
                maxBuddy: 20,
                onSelected: EQQ.Model.BuddyList.createDiscu
            });
            d.isUndefined(b) && alloy.util.report2im("qqpanel|dicussions|create")
        };
        this.updateDiscuName = function(a) {
            var b = $D.id("EQQ_discuList_Name_" + a.did);
            b.parentNode.title = a.titleName;
            b.innerHTML = a.htmlName;
            if (b = $D.id("EQQ_RecentDiscuList_State_" + a.did)) b.parentNode.title = a.titleName,
            b.innerHTML = a.htmlName
        };
        this.setDiscuListMaskState = function(a, b) {
            var d = $D.id("EQQ_discuList_State_" + a),
            f = $D.id("EQQ_RecentList_State_" + a);
            parseInt(b) > 0 ? (d && $D.addClass(d, "EQQ_GroupMask_State"), f && $D.addClass(f, "EQQ_GroupMask_State")) : (d && $D.removeClass(d, "EQQ_GroupMask_State"), f && $D.removeClass(f, "EQQ_GroupMask_State"))
        };
        this.onDiscuListContextMenu = function(a) {
            a.preventDefault();
            this.discuGlobalMenu.setZIndex(qqweb.layout.getTopZIndex(3));
            this.discuGlobalMenu.show(a.clientX, a.clientY);
            qqweb.util.report2qqweb("contextmenu|dicussions|all")
        };
        this.onDiscuContextMenu = function(a, b) {
            a.preventDefault();
            a.stopPropagation();
            this.setDiscuMaskItemState(b);
            this.discuMenu.setArgument(b);
            this.discuMenu.setZIndex(qqweb.layout.getTopZIndex(3));
            this.discuMenu.show(a.clientX, a.clientY)
        };
        this.setDiscuMaskItemState = function(a) {
            var a = EQQ.Model.BuddyList.getDiscuById(a),
            b = 2,
            b = [this.discuMenu.getItemAt(b++), this.discuMenu.getItemAt(b++), this.discuMenu.getItemAt(b++)],
            a = a.mask,
            d;
            for (d in b) b[d].option.argument.state == a ? b[d].setIcon({
                style: "background: url(./style/images/eqq_sprite.gif) no-repeat 5px -33px;"
            }) : b[d].setIcon(null)
        };
        this.onDiscuMaskItemClick = function(a, b) {
            var d = b.option.argument,
            f = this.discuMenu.getArgument();
            EQQ.Model.BuddyList.sendChangeDiscuMask({
                type: "single",
                uin: f,
                mask: d.state
            });
            qqweb.util.report2qqweb("contextmenu|dicussions|" + d.flag)
        };
        this.showReloadDiscuList = function() {
            this.EQQ_discuListInner.innerHTML = "";
            var a = $D.id("EQQ_discuListFail"),
            b = $D.id("EQQ_discuReLogin_text"),
            d = $D.id("EQQ_discuReLogining_text");
            $D.show(a);
            $D.show(b);
            $D.hide(d);
            $E.off(a, "click");
            $E.on(a, "click",
            function(a) {
                a.preventDefault();
                a.stopPropagation();
                EQQ.Model.BuddyList.sendGetDiscuList();
                $D.show(d);
                $D.hide(b)
            });
            this.hideCreatePanel()
        };
        this.hideReloadDiscuList = function() {
            var a = $D.id("EQQ_discuListFail");
            $D.isShow(a) && $D.hide(a)
        };
        this.showCreatePanel = function() {
            var a = $D.id("EQQ_discuCreate");
            $D.isShow(a) || $D.show(a)
        };
        this.hideCreatePanel = function() {
            var a = $D.id("EQQ_discuCreate");
            $D.isShow(a) && $D.hide(a)
        }
    },
    f = function(f) {
        var b = this,
        a = f.dom,
        c = f.event,
        j = f.string,
        m = !1,
        z = !1,
        q = !1,
        o = !1,
        i = {},
        r = [],
        k = [],
        D = [],
        B = [],
        E = [],
        w = {},
        x = 0,
        C = 160,
        F = "0",
        u = alloy.layout.getPanel("desktop").body,
        s,
        K,
        G = [],
        e = !1,
        n = !1,
        y,
        A = "single",
        H = "group",
        I = "",
        Q = !1,
        O;
        EQQ.avatarMouseoverTimer = null;
        var l = {},
        P = !1;
        g.apply(this, [f]);
        var R = function(a, b) {
            var c = b.option.argument,
            d;
            c.type == "single" ? (d = h.getArgument(), d = EQQ.Model.BuddyList.getGroupByCode(d).gid, d = {
                type: c.type,
                uin: d,
                mask: c.state + ""
            }) : d = {
                type: c.type,
                uin: EQQ.Model.BuddyList.getSelfUin(),
                mask: c.state + ""
            };
            EQQ.Model.BuddyList.sendChangeGroupMask(d);
            qqweb.util.report2qqweb("contextmenu|group|" + c.flag)
        },
        J,
        T,
        h,
        M,
        L,
        U,
        V,
        N,
        S,
        Y = [{
            text: "\u53d1\u9001\u5373\u65f6\u6d88\u606f",
            onClick: function() {
                var a = J.getArgument();
                c.notifyObservers(b, "StartChat", a);
                qqweb.util.report2qqweb("contextmenu|contancts|sendmsg")
            }
        },
        {
            text: "\u53d1\u9001\u7535\u5b50\u90ae\u4ef6",
            onClick: function() {
                var a = J.getArgument();
                qqweb.rpcService.sendGetFriendUin2(a, 3,
                function(a) {
                    qqweb.portal.runApp("6", {
                        url: EQQ.getSendMailUrl(a.result.account)
                    });
                    qqweb.util.report2qqweb("contextmenu|contancts|mail")
                })
            }
        },
        {
            type: "separator"
        },
        {
            text: "\u8bbf\u95eeQQ\u7a7a\u95f4",
            onClick: function() {
                var a = J.getArgument();
                qqweb.rpcService.sendGetFriendUin2(a, 2,
                function(a) {
                    qqweb.portal.runApp("6", {
                        url: EQQ.getQzoneUrl(a.result.account)
                    });
                    qqweb.util.report2qqweb("contextmenu|contancts|qzone")
                })
            }
        },
        {
            text: "\u521b\u5efa\u684c\u9762\u8054\u7cfb\u4eba",
            onClick: function() {
                var a = J.getArgument();
                alloy.desktopContact.addContactIcon({
                    t: "uin",
                    id: Number(a)
                });
                qqweb.util.report2qqweb("contextmenu|contancts|adddeskcontanct")
            }
        },
        {
            type: "separator"
        },
        {
            text: "\u79fb\u52a8\u5206\u7ec4",
            onClick: function() {
                qqweb.portal.runApp("5", {});
                qqweb.util.report2qqweb("contextmenu|contancts|manage")
            }
        },
        {
            text: "\u5220\u9664\u597d\u53cb",
            onClick: function() {
                qqweb.portal.runApp("5", {});
                qqweb.util.report2qqweb("contextmenu|contancts|manage")
            }
        },
        {
            text: "\u4fee\u6539\u5907\u6ce8",
            onClick: function() {
                qqweb.portal.runApp("5", {});
                qqweb.util.report2qqweb("contextmenu|contancts|manage")
            }
        },
        {
            text: "\u9690\u8eab\u8bbe\u7f6e",
            onClick: function() {
                qqweb.portal.runApp("5", {});
                qqweb.util.report2qqweb("contextmenu|contancts|manage")
            }
        },
        {
            type: "separator"
        },
        {
            text: "\u6d88\u606f\u8bb0\u5f55",
            onClick: function() {
                var a = J.getArgument();
                qqweb.portal.runApp("chatLogViewer", a);
                qqweb.util.report2qqweb("contextmenu|contancts|chats")
            }
        },
        {
            text: "\u67e5\u770b\u8d44\u6599",
            onClick: function() {
                var a = J.getArgument();
                qqweb.portal.runApp("userDetails", a);
                qqweb.util.report2qqweb("contextmenu|contancts|profile")
            }
}],
        ja = [{
            text: "\u5934\u50cf\u663e\u793a",
            type: "submenu",
            icon: {
                className: "eqq_header_switch_icon"
            },
            beforeShow: function(a) {
                ba() ? (a.getItemAt(0).setIcon({
                    className: "eqq_cxmenu_check_icon"
                }), a.getItemAt(1).setIcon()) : (a.getItemAt(0).setIcon(), a.getItemAt(1).setIcon({
                    className: "eqq_cxmenu_check_icon"
                }))
            },
            items: [{
                text: "\u5927\u5934\u50cf",
                onClick: function() {
                    b.ifFlexReady ? b.setFlexBigHead(!0) : W("single", !0);
                    X("single", !0);
                    qqweb.util.report2qqweb("contextmenu|contancts|largeicon")
                }
            },
            {
                text: "\u5c0f\u5934\u50cf",
                onClick: function() {
                    b.ifFlexReady ? b.setFlexBigHead(!1) : W("single", !1);
                    X("single", !1);
                    qqweb.util.report2qqweb("contextmenu|contancts|normalicon")
                }
}]
            },
        {
            text: "\u663e\u793a\u5728\u7ebf\u8054\u7cfb\u4eba",
            onClick: function(v, c) {
                if (P) {
                    for (var d = f.dom.mini(".EQQ_offlineBuddy", b.EQQ_buddyListPanel), e = 0, g = d.length; e < g; e++) a.show(d[e]);
                    c.setText("\u663e\u793a\u5728\u7ebf\u8054\u7cfb\u4eba");
                    P = !1
                } else {
                    d = f.dom.mini(".EQQ_offlineBuddy", b.EQQ_buddyListPanel);
                    e = 0;
                    for (g = d.length; e < g; e++) a.hide(d[e]);
                    c.setText("\u663e\u793a\u6240\u6709\u8054\u7cfb\u4eba");
                    P = !0
                }
                qqweb.util.report2qqweb("contextmenu|contancts|onlineonly")
            }
        },
        {
            text: "\u597d\u53cb\u6279\u91cf\u7ba1\u7406",
            onClick: function() {
                qqweb.portal.runApp("5", {});
                qqweb.util.report2qqweb("contextmenu|contancts|manage")
            }
        },
        {
            text: "\u67e5\u627e/\u6dfb\u52a0\u597d\u53cb",
            onClick: function() {
                qqweb.portal.runApp("buddyFinder", {});
                qqweb.util.report2qqweb("contextmenu|contancts|add")
            }
}],
        Ca = [{
            text: "\u53d1\u9001\u7fa4\u6d88\u606f",
            onClick: function() {
                var a = h.getArgument();
                c.notifyObservers(b, "StartGroupChat", a);
                qqweb.util.report2qqweb("contextmenu|group|sendmsg")
            }
        },
        {
            type: "separator"
        },
        {
            text: "\u8bbf\u95ee\u7fa4\u793e\u533a",
            onClick: function(a, b) {
                var c = h.getArgument();
                l[c] ? (qqweb.portal.openInWebBrowser({
                    url: EQQ.CONST.QQ_GROUP_URL + l[c],
                    title: b.option.title
                }), qqweb.util.report2qqweb("contextmenu|group|qun")) : qqweb.rpcService.sendGetFriendUin2(c, 4,
                function(a) {
                    qqweb.portal.openInWebBrowser({
                        url: EQQ.CONST.QQ_GROUP_URL + a.result.account,
                        title: b.option.title
                    });
                    qqweb.util.report2qqweb("contextmenu|group|qun")
                })
            }
        },
        {
            text: "\u67e5\u770b\u7fa4\u8d44\u6599",
            onClick: function() {
                var a = h.getArgument(),
                a = {
                    gid: EQQ.Model.BuddyList.getGroupByCode(a).gid,
                    gcode: a,
                    from: "groupDetail"
                };
                qqweb.portal.runApp("groupDetails", a);
                qqweb.util.report2qqweb("contextmenu|group|profile")
            }
        },
        {
            text: "\u67e5\u770b\u6d88\u606f\u8bb0\u5f55",
            onClick: function() {
                var a = h.getArgument(),
                a = {
                    gid: EQQ.Model.BuddyList.getGroupByCode(a).gid,
                    gcode: a,
                    from: "group"
                };
                qqweb.portal.runApp("chatLogViewer", a);
                qqweb.util.report2qqweb("contextmenu|group|chats")
            }
        },
        {
            type: "separator"
        },
        {
            text: "\u63a5\u6536\u5e76\u63d0\u793a\u7fa4\u6d88\u606f",
            argument: {
                type: "single",
                state: 0,
                flag: "single|withalert"
            },
            onClick: R
        },
        {
            text: "\u63a5\u6536\u4e0d\u63d0\u793a\u7fa4\u6d88\u606f",
            argument: {
                type: "single",
                state: 1,
                flag: "single|withoutalert"
            },
            onClick: R
        },
        {
            text: "\u5b8c\u5168\u963b\u6b62\u7fa4\u6d88\u606f",
            argument: {
                type: "single",
                state: 2,
                flag: "single|block"
            },
            onClick: R
        },
        {
            type: "separator"
        },
        {
            text: "\u521b\u5efa\u684c\u9762\u8054\u7cfb\u4eba",
            onClick: function() {
                var a = h.getArgument(),
                b = EQQ.Model.BuddyList.getGroupByCode(a).gid;
                alloy.desktopContact.addContactIcon({
                    t: "gid",
                    id: Number(a),
                    gid: b
                });
                qqweb.util.report2qqweb("contextmenu|group|adddeskcontanct")
            }
        },
        {
            text: "\u9000\u51fa\u8be5\u7fa4",
            onClick: function() {
                var a = h.getArgument();
                qqweb.layout.confirm("\u60a8\u771f\u7684\u8981\u9000\u51fa\u8be5\u7fa4\u5417?(\u9000\u7fa4\u901a\u77e5\u4ec5\u7ba1\u7406\u5458\u53ef\u89c1)",
                function() {
                    qqweb.rpcService.sendQuitGroup({
                        gcode: a
                    });
                    qqweb.util.report2qqweb("contextmenu|group|quit")
                })
            }
}],
        Da = [{
            text: "\u5934\u50cf\u663e\u793a",
            type: "submenu",
            icon: {
                className: "eqq_header_switch_icon"
            },
            beforeShow: function(a) {
                ca() ? (a.getItemAt(0).setIcon({
                    className: "eqq_cxmenu_check_icon"
                }), a.getItemAt(1).setIcon()) : (a.getItemAt(0).setIcon(), a.getItemAt(1).setIcon({
                    className: "eqq_cxmenu_check_icon"
                }))
            },
            items: [{
                text: "\u5927\u5934\u50cf",
                onClick: function() {
                    W("group", !0);
                    X("group", !0);
                    qqweb.util.report2qqweb("contextmenu|group|largeicon")
                }
            },
            {
                text: "\u5c0f\u5934\u50cf",
                onClick: function() {
                    W("group", !1);
                    X("group", !1);
                    qqweb.util.report2qqweb("contextmenu|group|normalicon")
                }
}]
            },
        {
            text: "\u8bbf\u95ee\u6211\u7684\u7fa4\u4e3b\u9875",
            link: EQQ.CONST.QQ_GROUP_URL,
            onClick: function(a, b) {
                a.preventDefault();
                qqweb.portal.openInWebBrowser({
                    url: b.option.link,
                    title: b.option.title
                });
                qqweb.util.report2qqweb("contextmenu|group|all|qun")
            }
        },
        {
            type: "separator"
        },
        {
            text: "\u4f7f\u7528\u7fa4\u81ea\u8eab\u7684\u6d88\u606f\u8bbe\u7f6e",
            argument: {
                type: "global",
                state: 0,
                flag: "all|self"
            },
            onClick: R
        },
        {
            text: "\u6240\u6709\u7fa4\u63a5\u6536\u5e76\u63d0\u793a\u6d88\u606f",
            argument: {
                type: "global",
                state: 1,
                flag: "all|withalert"
            },
            onClick: R
        },
        {
            text: "\u6240\u6709\u7fa4\u63a5\u6536\u4e0d\u63d0\u793a\u6d88\u606f",
            argument: {
                type: "global",
                state: 2,
                flag: "all|withoutalert"
            },
            onClick: R
        },
        {
            text: "\u6240\u6709\u7fa4\u5b8c\u5168\u963b\u6b62\u7fa4\u6d88\u606f",
            argument: {
                type: "global",
                state: 3,
                flag: "all|block"
            },
            onClick: R
        },
        {
            type: "separator"
        },
        {
            text: "\u67e5\u627e\u6dfb\u52a0\u7fa4",
            link: EQQ.CONST.QQ_GROUP_URL + "search",
            onClick: function(a, b) {
                a.preventDefault();
                qqweb.portal.openInWebBrowser({
                    url: b.option.link,
                    title: b.option.title
                });
                qqweb.util.report2qqweb("contextmenu|group|search")
            }
        },
        {
            text: "\u521b\u5efa\u4e00\u4e2a\u7fa4",
            link: EQQ.CONST.QQ_GROUP_URL + "create",
            onClick: function(a, b) {
                a.preventDefault();
                qqweb.portal.openInWebBrowser({
                    url: b.option.link,
                    title: b.option.title
                });
                qqweb.util.report2qqweb("contextmenu|group|create")
            }
}],
        Ea = [{
            text: "\u53d1\u9001\u8ba8\u8bba\u7ec4\u6d88\u606f",
            onClick: function() {
                var a = V.getArgument();
                c.notifyObservers(b, "StartDiscuChat", a);
                alloy.util.report2im("contextmenu|dicussions|sendmsg")
            }
        },
        {
            type: "separator"
        },
        {
            text: "\u63a5\u6536\u5e76\u63d0\u793a\u8ba8\u8bba\u7ec4\u6d88\u606f",
            argument: {
                type: "single",
                state: 0,
                flag: "single|withalert"
            },
            onClick: function(a, c) {
                b.onDiscuMaskItemClick(a, c)
            }
        },
        {
            text: "\u63a5\u6536\u4e0d\u63d0\u793a\u8ba8\u8bba\u7ec4\u6d88\u606f",
            argument: {
                type: "single",
                state: 1,
                flag: "single|withoutalert"
            },
            onClick: function(a, c) {
                b.onDiscuMaskItemClick(a, c)
            }
        },
        {
            text: "\u5b8c\u5168\u963b\u6b62\u8ba8\u8bba\u7ec4\u6d88\u606f",
            argument: {
                type: "single",
                state: 2,
                flag: "single|block"
            },
            onClick: function(a, c) {
                b.onDiscuMaskItemClick(a, c)
            }
        },
        {
            type: "separator"
        },
        {
            text: "\u9000\u51fa\u8be5\u8ba8\u8bba\u7ec4",
            onClick: function() {
                var a = V.getArgument();
                qqweb.layout.confirm("\u60a8\u771f\u7684\u8981\u9000\u51fa\u8be5\u8ba8\u8bba\u7ec4\u5417?",
                function() {
                    c.notifyObservers(EQQ, "QuitDiscu", {
                        did: a
                    });
                    qqweb.util.report2qqweb("contextmenu|dicussions|quit")
                })
            }
}],
        Fa = [{
            text: "\u5934\u50cf\u663e\u793a",
            type: "submenu",
            icon: {
                className: "eqq_header_switch_icon"
            },
            beforeShow: function(a) {
                ca() ? (a.getItemAt(0).setIcon({
                    className: "eqq_cxmenu_check_icon"
                }), a.getItemAt(1).setIcon()) : (a.getItemAt(0).setIcon(), a.getItemAt(1).setIcon({
                    className: "eqq_cxmenu_check_icon"
                }))
            },
            items: [{
                text: "\u5927\u5934\u50cf",
                onClick: function() {
                    W("group", !0);
                    X("group", !0);
                    qqweb.util.report2qqweb("contextmenu|dicussions|largeicon")
                }
            },
            {
                text: "\u5c0f\u5934\u50cf",
                onClick: function() {
                    W("group", !1);
                    X("group", !1);
                    qqweb.util.report2qqweb("contextmenu|dicussions|normalicon")
                }
}]
            },
        {
            text: "\u521b\u5efa\u8ba8\u8bba\u7ec4",
            onClick: function(a) {
                a.preventDefault();
                b.onCreateDiscu(a, "contextmenu");
                alloy.util.report2im("contextmenu|dicussions|create")
            }
}],
        Ga = [{
            text: "\u5934\u50cf\u663e\u793a",
            type: "submenu",
            icon: {
                className: "eqq_header_switch_icon"
            },
            beforeShow: function(a) {
                da() ? (a.getItemAt(0).setIcon({
                    className: "eqq_cxmenu_check_icon"
                }), a.getItemAt(1).setIcon()) : (a.getItemAt(0).setIcon(), a.getItemAt(1).setIcon({
                    className: "eqq_cxmenu_check_icon"
                }))
            },
            items: [{
                text: "\u5927\u5934\u50cf",
                onClick: function() {
                    W("recent", !0);
                    X("recent", !0);
                    qqweb.util.report2qqweb("contextmenu|recent|largeicon")
                }
            },
            {
                text: "\u5c0f\u5934\u50cf",
                onClick: function() {
                    W("recent", !1);
                    X("recent", !1);
                    qqweb.util.report2qqweb("contextmenu|recent|normalicon")
                }
}]
}];
            this.createContextMenu = function() {
                J = new f.ui.ContextMenu({
                    id: "singleMenu",
                    container: qqweb.layout.getDesktop().body,
                    items: Y
                });
                T = new f.ui.ContextMenu({
                    id: "singleGlobalMenu",
                    container: qqweb.layout.getDesktop().body,
                    items: ja
                });
                h = new f.ui.ContextMenu({
                    id: "groupMenu",
                    container: qqweb.layout.getDesktop().body,
                    width: 150,
                    items: Ca
                });
                M = new f.ui.ContextMenu({
                    id: "groupGlobalMenu",
                    container: qqweb.layout.getDesktop().body,
                    width: 180,
                    beforeShow: Na,
                    items: Da
                });
                V = new f.ui.ContextMenu({
                    id: "discuMenu",
                    container: qqweb.layout.getDesktop().body,
                    width: 180,
                    items: Ea
                });
                N = new f.ui.ContextMenu({
                    id: "discuGlobalMenu",
                    container: qqweb.layout.getDesktop().body,
                    width: 150,
                    items: Fa
                });
                S = new f.ui.ContextMenu({
                    id: "recentGlobalMenu",
                    container: qqweb.layout.getDesktop().body,
                    width: 150,
                    items: Ga
                });
                b.discuMenu = V;
                b.discuGlobalMenu = N;
                y = {
                    single: T,
                    group: M,
                    discu: N,
                    recent: S
                };
                c.addObserver(qqweb.rpcService, "sendQuitGroupSuccess", Oa)
            };
            var Ha = function(a) {
                a.preventDefault();
                T.setZIndex(qqweb.layout.getTopZIndex(3));
                T.show(a.clientX, a.clientY);
                qqweb.util.report2qqweb("contextmenu|contancts|all")
            },
        Ia = function(a) {
            a.preventDefault();
            M.setZIndex(qqweb.layout.getTopZIndex(3));
            M.show(a.clientX, a.clientY);
            qqweb.util.report2qqweb("contextmenu|group|all")
        },
        Ja = function(a) {
            a.preventDefault();
            S.setZIndex(qqweb.layout.getTopZIndex(3));
            S.show(a.clientX, a.clientY)
        },
        oa = function(a) {
            a.preventDefault();
            a.stopPropagation();
            J.setArgument(this.getAttribute("uin"));
            J.setZIndex(qqweb.layout.getTopZIndex(3));
            J.show(a.clientX, a.clientY);
            qqweb.util.report2qqweb("contextmenu|contancts|person")
        },
        Ka = function(a) {
            a.preventDefault();
            a.stopPropagation();
            J.setArgument(this.getAttribute("uin"));
            J.setZIndex(qqweb.layout.getTopZIndex(3));
            J.show(a.clientX, a.clientY);
            qqweb.util.report2qqweb("contextmenu|recent|person")
        },
        La = function(a) {
            a.preventDefault();
            a.stopPropagation();
            var b = this.getAttribute("code");
            pa(b);
            h.setArgument(b);
            h.setZIndex(qqweb.layout.getTopZIndex(3));
            h.show(a.clientX, a.clientY);
            qqweb.util.report2qqweb("contextmenu|group|single")
        },
        Ma = function(a) {
            a.preventDefault();
            a.stopPropagation();
            var b = this.getAttribute("code");
            pa(b);
            h.setArgument(b);
            h.setZIndex(qqweb.layout.getTopZIndex(3));
            h.show(a.clientX, a.clientY);
            qqweb.util.report2qqweb("contextmenu|recent|single")
        },
        ka = function(b) {
            b.preventDefault();
            b.stopPropagation();
            b = A === "group" ? H : A;
            if (y[b]) {
                b = y[b];
                b.setZIndex(qqweb.layout.getTopZIndex(3));
                var c = a.getClientXY(this);
                b.show(c[0], c[1] + 28, 0)
            }
            switch (A) {
                case "single":
                    qqweb.util.report2qqweb("qqpanel|contacts|tabmenu|menu");
                    break;
                case "group":
                    qqweb.util.report2qqweb("qqpanel|groups|tabmenu|menu");
                    break;
                case "recent":
                    qqweb.util.report2qqweb("qqpanel|recent|tabmenu|menu")
            }
        },
        Pa = function(c) {
            c.preventDefault();
            c = a.getClientXY(this);
            c[0] -= b.statePanel ? b.statePanel.getWidth() : 100;
            c[1] -= b.statePanel ? b.statePanel.getHeight() : 176;
            ga(c);
            alloy.util.report2im("contextmenu|statechange")
        },
        Oa = function(a) {
            a = a.arguments.gcode;
            qqweb.portal.getApp("50").run({
                api: ["exitGroup", [a]],
                loginMode: "logined"
            })
        },
        pa = function(a) {
            a = EQQ.Model.BuddyList.getGroupByCode(a);
            if (!L) {
                var b = 6;
                L = [h.getItemAt(b++), h.getItemAt(b++), h.getItemAt(b++)]
            }
            var a = a.mask,
            c;
            for (c in L) L[c].option.argument.state == a ? L[c].setIcon({
                className: "eqq_cxmenu_check_icon"
            }) : L[c].setIcon(null)
        },
        Na = function() {
            if (!U) {
                var a = 3;
                U = [M.getItemAt(a++), M.getItemAt(a++), M.getItemAt(a++), M.getItemAt(a++)]
            }
            var a = EQQ.Model.BuddyList.getGroupMask(),
            b;
            for (b in U) U[b].option.argument.state == a ? U[b].setIcon({
                className: "eqq_cxmenu_check_icon"
            }) : U[b].setIcon(null)
        },
        X = this.setBigHead = function(a, b) {
            var c = alloy.config.configList.useBigHead;
            switch (a) {
                case "single":
                    b ? c |= 1 : c &= -2;
                    break;
                case "group":
                    b ? (c |= 2, e || (e = !0, qa())) : c &= -3;
                    break;
                case "recent":
                    b ? (c |= 4, n || (n = !0, ra())) : c &= -5
            }
            EQQ.Presenter.MainPanel.saveBigHeadSetting(c)
        },
        W = function(c, d) {
            var f;
            switch (c) {
                case "single":
                    f = b.EQQ_buddyListPanel;
                    break;
                case "group":
                    f = b.EQQ_groupListPanel;
                    break;
                case "recent":
                    f = b.EQQ_recentListPanel
            }
            f && (d ? a.addClass(f, "EQQ_List_BigHead") : (a.removeClass(f, "EQQ_List_BigHead"), c == "single" && la()))
        },
        sa = function() {
            ba() ? b.ifFlexReady ? b.setFlexBigHead(!0) : a.addClass(b.EQQ_buddyListPanel, "EQQ_List_BigHead") : b.ifFlexReady ? b.setFlexBigHead(!1) : a.removeClass(b.EQQ_buddyListPanel, "EQQ_List_BigHead");
            ca() ? a.addClass(b.EQQ_groupListPanel, "EQQ_List_BigHead") : a.removeClass(b.EQQ_groupListPanel, "EQQ_List_BigHead");
            da() ? a.addClass(b.EQQ_recentListPanel, "EQQ_List_BigHead") : a.removeClass(b.EQQ_recentListPanel, "EQQ_List_BigHead")
        },
        ba = this.isBuddyListUseBigHead = function() {
            return alloy.config.configList.useBigHead & 1
        },
        ca = function() {
            return alloy.config.configList.useBigHead & 2
        },
        da = function() {
            return alloy.config.configList.useBigHead & 4
        },
        Qa = function() {
            var a = this.getAttribute("state");
            b.setSelfState(a);
            pgvSendClick({
                hottag: "web2qq.corner.topright." + a
            })
        },
        ta = function() {
            a.setStyle(this, "backgroundColor", "#cbe7fc")
        },
        ua = function() {
            a.setStyle(this, "backgroundColor", "transparent")
        },
        Ra = function() {
            a.removeClass(b.EQQ_MyState, "hover")
        },
        Sa = function() {
            a.addClass(b.EQQ_MyState, "hover")
        },
        Ta = function() { },
        va = function(a) {
            b.toggleStatePanel(a)
        },
        ga = va,
        Ua = function(c) {
            c.stopPropagation();
            c = a.getClientXY(b.EQQ_MyState);
            c[1] += 16;
            ga(c);
            alloy.util.report2im("personalinfo|statechange")
        },
        Va = function() {
            var a = this.getAttribute("classIndex");
            b.toggleClass(a)
        },
        Wa = function(a) {
            a.preventDefault();
            alloy.sound.isMute() ? (alloy.sound.setMute(!1), alloy.util.report2im("personalinfo|setting|sound")) : (alloy.sound.setMute(!0), alloy.util.report2im("personalinfo|setting|mute"))
        },
        wa = function(c) {
            b.EQQ_SetSound && (c ? a.replaceClass(b.EQQ_SetSound, "statusBar_sound_open", "statusBar_sound_mute") : a.replaceClass(b.EQQ_SetSound, "statusBar_sound_mute", "statusBar_sound_open"))
        },
        Z = function() {
            a.setStyle(this, "backgroundColor", "#cbe7fc")
        },
        $ = function() {
            a.setStyle(this, "backgroundColor", "transparent")
        },
        ha = function() {
            var v = this.getAttribute("uin");
            if (v) {
                if (EQQ.avatarMouseoverTimer) clearTimeout(EQQ.avatarMouseoverTimer),
                EQQ.avatarMouseoverTimer = null;
                var d = a.getClientXY(this);
                d[0] -= 218;
                d[1] -= 5;
                b.showMiniCardPanel(v, d);
                c.notifyObservers(b, "AvatarMouseover", v)
            }
        },
        ia = function() {
            EQQ.avatarMouseoverTimer = window.setTimeout(xa, 500)
        },
        xa = function() {
            b.hideMiniCardPanel()
        },
        Xa = function() {
            if (EQQ.avatarMouseoverTimer) clearTimeout(EQQ.avatarMouseoverTimer),
            EQQ.avatarMouseoverTimer = null
        },
        Ya = function() {
            EQQ.avatarMouseoverTimer = window.setTimeout(xa, 500)
        },
        Za = function() {
            alloy.portal.runApp("userDetails", b.miniCardPanel.uin);
            pgvSendClick({
                hottag: "web2qq.minicard.contacts.more"
            });
            alloy.util.report2im("minicard|contacts|more")
        },
        $a = function(a) {
            a.preventDefault();
            var b = this.getAttribute("href"),
            c = /\d+/,
            a = parseInt(b.match(c)[0]);
            alloy.rpcService.sendGetFriendUin2(a, 2,
            function(a) {
                O = a.result.account;
                alloy.portal.runApp("6", {
                    url: b.replace(c, O)
                })
            });
            pgvSendClick({
                hottag: "web2qq.minicard.contacts.qzone"
            });
            alloy.util.report2im("minicard|contacts|qzone")
        },
        ab = function(a) {
            a.preventDefault();
            var b = this.getAttribute("href"),
            c = /\d+/,
            a = parseInt(b.match(c)[0]);
            a == alloy.portal.getUin() ? alloy.portal.runApp("17", {
                url: b
            }) : alloy.rpcService.sendGetFriendUin2(a, 3,
            function(a) {
                O = a.result.account;
                alloy.portal.runApp("6", {
                    url: b.replace(c, O)
                })
            });
            pgvSendClick({
                hottag: "web2qq.minicard.contacts.qqmail"
            });
            alloy.util.report2im("minicard|contacts|email")
        },
        bb = function(a) {
            a.preventDefault();
            a = this.getAttribute("uin");
            c.notifyObservers(b, "AskVideo", {
                uin: a
            });
            c.notifyObservers(b, "StartChat", a)
        },
        aa = function(a) {
            a.stopPropagation()
        },
        ma = function(a) {
            a.preventDefault();
            a.stopPropagation();
            a = this.getAttribute("uin");
            c.notifyObservers(b, "StartChat", a)
        },
        ya = function() {
            var a = this.getAttribute("code");
            c.notifyObservers(b, "StartGroupChat", a)
        },
        cb = function(a) {
            a.preventDefault();
            a.stopPropagation();
            pgvSendClick({
                hottag: "WEB2QQ.QQPANEL.QUN.GROUPSEEK"
            });
            alloy.util.report2im("qqpanel|groups|seek");
            qqweb.portal.runApp("buddyFinder", {
                from: "group"
            })
        },
        db = function() {
            a.addClass(this, "EQQ_MySignature_hover")
        },
        eb = function() {
            a.removeClass(this, "EQQ_MySignature_hover")
        },
        fb = function(v) {
            v.preventDefault();
            if (!Q) Q = !0,
            I = b.EQQ_MySignature.value,
            c.on(b.EQQ_MySignature, "blur", na),
            a.addClass(b.EQQ_MySignature_wraper, "EQQ_MySignature_edit"),
            b.EQQ_MySignature.focus(),
            b.EQQ_MySignature.select(),
            pgvSendClick({
                hottag: "web2qq.corner.topright.personalmsg"
            })
        },
        za = function() {
            Q = !1;
            c.off(b.EQQ_MySignature, "blur", na);
            a.removeClass(b.EQQ_MySignature_wraper, "EQQ_MySignature_edit");
            b.EQQ_MySignature.blur()
        },
        na = function() {
            za();
            b.EQQ_MySignature.value == I ? b.EQQ_MySignature.title = I : (b.EQQ_MySignature.title = "\u7b7e\u540d\u66f4\u65b0\u4e2d:" + b.EQQ_MySignature.value, alloy.rpcService.sendSetSignature(b.EQQ_MySignature.value), alloy.util.report2im("personalinfo|personalmsg|personalmsgedit"))
        },
        hb = function(a) {
            switch (a.keyCode) {
                case 13:
                    na();
                    break;
                case 27:
                    a.stopPropagation();
                    za();
                    b.EQQ_MySignature.title = I;
                    b.EQQ_MySignature.value = I;
                    break;
                default:
                    gb()
            }
        },
        gb = function() {
            Aa(this, 150)
        },
        Aa = function(a, b) {
            var c = String(a.value);
            if (c.replace(/[^\x00-\xff]/g, "aaa").length > b) a.value = f.string.cutRight(c, 1),
            Aa(a, b)
        },
        ib = function() {
            var a = parseInt(this.getAttribute("uin"), 10);
            a && (alloy.portal.runApp("userDetails", a), alloy.util.report2im("personalinfo|icon"))
        },
        jb = function(a) {
            var b = a.target;
            b.tagName == "SPAN" ? b = b.parentNode : b.tagName != "A" && (b = null);
            if (b) {
                var c = b.getAttribute("appId");
                c && (a.preventDefault(), alloy.portal.runApp(c, {}), alloy.util.report2im("personalinfo|icon|" + b.getAttribute("target")))
            }
        };
            this.init = function() {
                G = [];
                o = q = z = m = !1;
                i = {};
                r = [];
                k = [];
                D = [];
                B = [];
                E = [];
                w = {};
                x = 0;
                K = s = null;
                b.ifFlexReady = !1;
                c.notifyObservers(b, "AddPObservers");
                c.addObserver(alloy.sound, "SoundMuteChange", wa);
                c.addObserver(alloy.app.eqq.window, "resize", f.bind(this.onEqqResize, this));
                f.browser.ie !== 7 && c.addObserver(alloy.app.eqq.window, "dragEnd", Ba);
                this.contactDragController = alloy.layout.getDesktopManager().getDragController();
                this.EQQ_Container = a.id("EQQ_Container");
                this.EQQ_MainPanel = a.id("EQQ_MainPanel");
                this.EQQ_MyPanel = a.id("EQQ_MyPanel");
                this.EQQ_MyAvatar = a.id("EQQ_MyAvatar");
                this.EQQ_MyNick = a.id("EQQ_MyNick");
                this.EQQ_MyState = a.id("EQQ_MyState");
                this.EQQ_MyStateShow = a.id("EQQ_MyStateShow");
                this.EQQ_MySignature = a.id("EQQ_MySignature");
                this.EQQ_MySignature_wraper = a.id("EQQ_mySignature_wraper");
                this.EQQ_myService = a.id("EQQ_myService");
                this.EQQ_myInfo = a.id("EQQ_myInfo");
                var v = a.id("eqqMypanelToolbar");
                this.EQQ_MyState.title = "\u66f4\u6539\u5728\u7ebf\u72b6\u6001";
                c.on(v, "click", jb);
                c.on(this.EQQ_MyAvatar, "mouseover", ha);
                c.on(this.EQQ_MyAvatar, "mouseout", ia);
                c.on(this.EQQ_MyAvatar, "click", ib);
                c.on(this.EQQ_MySignature_wraper, "mouseover", db);
                c.on(this.EQQ_MySignature_wraper, "mouseout", eb);
                c.on(this.EQQ_MySignature, "click", fb);
                c.on(this.EQQ_MySignature, "keyup", hb);
                c.off(this.EQQ_MyState, "click");
                c.on(this.EQQ_MyState, "click", Ua);
                this.EQQ_YellowTips = a.id("EQQ_YellowTips");
                c.on(this.EQQ_YellowTips, "click", this.onYellowTipsClick);
                this.EQQ_LoginSuccess = a.id("EQQ_LoginSuccess");
                this.EQQ_SearchBar = a.id("EQQ_SearchBar");
                this.EQQ_SearchBox = a.id("EQQ_SearchBox");
                this.EQQ_SearchButton = a.id("EQQ_SearchButton");
                this.EQQ_SearchResultPanel = a.id("EQQ_SearchResultPanel");
                this.EQQ_SearchResultPanel_iframeWrap = a.id("EQQ_SearchResultPanel_iframeWrap");
                c.on(this.EQQ_SearchBox, "mouseover", this.onSearchBoxMouseover);
                c.on(this.EQQ_SearchBox, "mouseout", this.onSearchBoxMouseout);
                c.on(this.EQQ_SearchBox, "focus", this.onSearchBoxFocus);
                c.on(this.EQQ_SearchBox, "blur", this.onSearchBoxBlur);
                c.on(this.EQQ_SearchBox, "keyup", this.onSearchBoxKeyup);
                c.on(this.EQQ_SearchBox, "keydown", this.onSearchBoxKeydown);
                c.on(this.EQQ_SearchBox, "click", f.bind(this.startSearch, this));
                c.on(this.EQQ_SearchButton, "click", f.bind(function() {
                    s && (b.hideSearchResult(), c.notifyObservers(b, "StartChat", s.uin), pgvSendClick({
                        hottag: "web2qq.qqpanel.searchcontacts"
                    }), alloy.util.report2im("qqpanel|searchcontacts"))
                },
            this));
                this.EQQ_Logining = a.id("EQQ_Logining");
                this.EQQ_Logining_Container = this.EQQ_Logining.parentNode;
                this.EQQ_Logining_feedback = a.id("EQQ_Logining_feedback");
                this.EQQ_ReLoginPanel = a.id("EQQ_ReLoginPanel");
                this.EQQ_ReLoginButton = a.id("EQQ_ReLoginButton");
                this.EQQ_ReLoginButton_text = a.id("EQQ_ReLoginButton_text");
                c.on(this.EQQ_ReLoginButton, "click", this.onReLoginButtonClick);
                this.EQQ_TabBuddyList = a.id("EQQ_TabBuddyList");
                this.EQQ_TabGroupList = a.id("EQQ_TabGroupList");
                this.EQQ_TabRecentList = a.id("EQQ_TabRecentList");
                var v = a.id("EQQ_TabBuddyList_MenuIcon"),
            d = a.id("EQQ_TabGroupList_MenuIcon"),
            g = a.id("EQQ_TabRecentList_MenuIcon");
                c.on(v, "click", ka);
                c.on(d, "click", ka);
                c.on(g, "click", ka);
                this.EQQ_ListContainer = a.id("EQQ_ListContainer");
                this.EQQ_buddyListPanel = a.id("EQQ_buddyListPanel");
                this.EQQ_buddyListPanelBottom = a.id("EQQ_buddyListPanelBottom");
                this.EQQ_groupListOuter = a.id("EQQ_groupListOuter");
                this.EQQ_groupListPanelBottom = a.id("EQQ_groupListPanelBottom");
                f.platform.iPad && new f.ui.TouchScroller(this.EQQ_buddyListPanel);
                this.EQQ_buddyList = a.id("EQQ_buddyList");
                c.on(this.EQQ_buddyList, "mousedown", aa);
                c.on(this.EQQ_buddyListPanel, "scroll", ea);
                this.EQQ_createGroupButton = a.id("EQQ_createGroupButton");
                this.EQQ_searchGroupButton = a.id("EQQ_searchGroupButton");
                c.on(this.EQQ_createGroupButton, "click", alloy.util.observer.openInWebBrowser);
                c.on(this.EQQ_createGroupButton, "click",
            function() {
                pgvSendClick({
                    hottag: "WEB2QQ.QQPANEL.QUN.CREATE"
                });
                alloy.util.report2im("qqpanel|groups|create")
            });
                c.on(this.EQQ_searchGroupButton, "click", cb);
                this.EQQ_ListBottom_maskButton = a.id("EQQ_ListBottom_maskButton");
                c.on(this.EQQ_ListBottom_maskButton, "click", kb);
                this.EQQ_groupListPanel = a.id("EQQ_groupListPanel");
                this.EQQ_groupListInner = a.id("EQQ_groupListInner");
                f.platform.iPad && new f.ui.TouchScroller(this.EQQ_groupListInner.parentNode);
                c.on(this.EQQ_groupListInner, "mousedown", aa);
                this.EQQ_groupTabGroup = a.id("EQQ_groupTabGroup");
                this.EQQ_groupTabDiscu = a.id("EQQ_groupTabDiscu");
                this.EQQ_groupBox = a.id("EQQ_groupBox");
                this.EQQ_discuBox = a.id("EQQ_discuBox");
                c.on(this.EQQ_groupTabGroup, "click",
            function() {
                a.addClass(b.EQQ_groupTabGroup, "seled");
                a.removeClass(b.EQQ_groupTabDiscu, "seled");
                a.show(b.EQQ_groupBox);
                a.hide(b.EQQ_discuBox);
                H = "group";
                alloy.util.report2im("qqpanel|groups|tab")
            });
                c.on(this.EQQ_groupTabDiscu, "click",
            function() {
                a.removeClass(b.EQQ_groupTabGroup, "seled");
                a.addClass(b.EQQ_groupTabDiscu, "seled");
                a.hide(b.EQQ_groupBox);
                a.show(b.EQQ_discuBox);
                H = "discu";
                alloy.util.report2im("qqpanel|dicussions|tab")
            });
                this.EQQ_discuListOuter = a.id("EQQ_discuListOuter");
                this.EQQ_discuListInner = a.id("EQQ_discuListInner");
                this.EQQ_discuListPanelBottom = a.id("EQQ_discuListPanelBottom");
                this.EQQ_createDiscuButton = a.id("EQQ_createDiscuButton");
                c.on(this.EQQ_createDiscuButton, "click", this.onCreateDiscu);
                this.EQQ_discuCreate_button = a.id("EQQ_discuCreate_button");
                c.on(this.EQQ_discuCreate_button, "click", this.onCreateDiscu);
                f.platform.iPad && new f.ui.TouchScroller(this.EQQ_discuListInner.parentNode);
                this.EQQ_recentListPanel = a.id("EQQ_recentListPanel");
                f.platform.iPad && new f.ui.TouchScroller(this.EQQ_recentListPanel);
                this.EQQ_recentList = a.id("EQQ_recentList");
                c.on(this.EQQ_recentList, "mousedown", aa);
                this.EQQ_findBuddy = a.id("EQQ_findBuddy");
                this.EQQ_buddyManage = a.id("EQQ_buddyManage");
                this.EQQ_messageManage = a.id("EQQ_messageManage");
                f.browser.mobileSafari && a.hide(this.EQQ_buddyManage);
                c.on(this.EQQ_findBuddy, "click",
            function(a) {
                a.preventDefault();
                a.stopPropagation();
                pgvSendClick({
                    hottag: "WEB2QQ.QQPANEL.CONTACTS.SEEK"
                });
                alloy.util.report2im("qqpanel|contacts|seek");
                alloy.portal.runApp("buddyFinder", {})
            });
                c.on(this.EQQ_buddyManage, "click",
            function(a) {
                a.preventDefault();
                a.stopPropagation();
                pgvSendClick({
                    hottag: "WEB2QQ.QQPANEL.CONTACTS.MANAGE"
                });
                alloy.util.report2im("qqpanel|contacts|manage");
                alloy.portal.runApp("5", {})
            });
                c.on(this.EQQ_messageManage, "click",
            function(a) {
                a.preventDefault();
                a.stopPropagation();
                pgvSendClick({
                    hottag: "WEB2QQ.QQPANEL.CONTACTS.MSGMGR"
                });
                alloy.util.report2im("qqpanel|contacts|msgmgr");
                alloy.portal.runApp("messageManager", {})
            });
                this.mainTab = new f.ui.Tab;
                this.mainTab.add({
                    trigger: this.EQQ_TabBuddyList,
                    sheet: this.EQQ_buddyListPanel
                });
                this.mainTab.add({
                    trigger: this.EQQ_TabGroupList,
                    sheet: this.EQQ_groupListPanel
                });
                this.mainTab.add({
                    trigger: this.EQQ_TabRecentList,
                    sheet: this.EQQ_recentListPanel
                });
                this.mainTab.config.triggerEvent = "click";
                this.mainTab.config.slideEnabled = !1;
                this.mainTab.init();
                c.addObserver(this.mainTab, "show",
            function(a) {
                switch (this.indexOf(a)) {
                    case 0:
                        A = "single";
                        pgvSendClick({
                            hottag: "WEB2QQ.QQPANEL.CONTACTS.CONTACTSLIST"
                        });
                        alloy.util.report2im("qqpanel|contacts|list");
                        break;
                    case 1:
                        A = "group"; !e && ca() && (e = !0, qa());
                        pgvSendClick({
                            hottag: "WEB2QQ.QQPANEL.QUN.QUNLIST"
                        });
                        alloy.util.report2im("qqpanel|groups|list");
                        break;
                    case 2:
                        A = "recent",
                    !n && da() && (n = !0, ra()),
                    pgvSendClick({
                        hottag: "WEB2QQ.QQPANEL.RECENT.RECENTLIST"
                    }),
                    alloy.util.report2im("qqpanel|recent|list")
                }
            });
                c.on(this.EQQ_buddyListPanel, "contextmenu", Ha);
                c.on(this.EQQ_groupBox, "contextmenu", Ia);
                c.on(this.EQQ_discuBox, "contextmenu", f.bind(this.onDiscuListContextMenu, this));
                c.on(this.EQQ_recentListPanel, "contextmenu", Ja);
                c.on(this.EQQ_buddyListPanelBottom, "contextmenu", aa);
                c.on(this.EQQ_groupListPanelBottom, "contextmenu", aa);
                c.on(this.EQQ_discuListPanelBottom, "contextmenu", aa);
                v = alloy.taskBar.quickPanel.getQuickButton(50);
                v.setClass("EQQ_qucikButton");
                c.on(v.getElement(), "contextmenu", Pa);
                this.onEqqResize(alloy.app.eqq.window.getBodySize());
                this.onWindowResize();
                a.show(this.EQQ_MyState);
                sa();
                c.addObserver(EQQ, "eqqUacChange", sa)
            };
            this.createStatePanelDom = function() {
                var b, e = d.statePanel;
                f.browser.ie == 7 ? (b = a.node("div", {
                    id: "EQQ_StatePanel",
                    "class": "EQQ_statePanel_warp"
                }), e = '<ul class="EQQ_statePanel EQQ_statePanel_ul">' + e + '</ul><iframe class="ui_maskBgIframe"></iframe>') : b = a.node("ul", {
                    id: "EQQ_StatePanel",
                    "class": "EQQ_statePanel"
                });
                b.innerHTML = e;
                u.appendChild(b);
                this.statePanel = new alloy.layout.PopupBox({
                    noCatchMouseUp: !0,
                    container: b
                });
                c.addObserver(this.statePanel, "hide", Ra);
                c.addObserver(this.statePanel, "show", Sa);
                this.EQQ_SetOnline = a.id("EQQ_SetOnline");
                this.EQQ_SetCallme = a.id("EQQ_SetCallme");
                this.EQQ_SetAway = a.id("EQQ_SetAway");
                this.EQQ_SetBusy = a.id("EQQ_SetBusy");
                this.EQQ_SetSilent = a.id("EQQ_SetSilent");
                this.EQQ_SetHidden = a.id("EQQ_SetHidden");
                this.EQQ_SetOffline = a.id("EQQ_SetOffline");
                this.EQQ_SetSound = a.id("EQQ_SetSound");
                c.on(this.EQQ_SetSound, "mouseover", ta);
                c.on(this.EQQ_SetSound, "mouseout", ua);
                c.on(this.EQQ_SetSound, "click", Wa);
                b = [this.EQQ_SetOnline, this.EQQ_SetCallme, this.EQQ_SetAway, this.EQQ_SetBusy, this.EQQ_SetSilent, this.EQQ_SetHidden, this.EQQ_SetOffline];
                f.array.forEach(b,
            function(a) {
                c.on(a, "mouseover", ta)
            });
                f.array.forEach(b,
            function(a) {
                c.on(a, "mouseout", ua)
            });
                f.array.forEach(b,
            function(a) {
                c.on(a, "click", Qa)
            })
            };
            this.createGroupMaskPanelDom = function() {
                var v = a.id("groupMaskPanelMenu");
                v || (v = a.node("div", {
                    "class": "groupMaskPanel",
                    id: "groupMaskPanelMenu"
                }));
                u.appendChild(v);
                b.groupMaskPanel = new alloy.layout.PopupBox({
                    container: v,
                    html: d.groupMaskPanel
                });
                this.costomDom = a.id("GroupMask_Costom");
                this.promptDom = a.id("GroupMask_Prompt");
                this.noPromptDom = a.id("GroupMask_NoPrompt");
                this.maskDom = a.id("GroupMask_Mask");
                f.array.forEach([this.costomDom, this.promptDom, this.noPromptDom, this.maskDom],
            function(a) {
                c.on(a, "click", lb)
            });
                this.setGroupMaskState(F)
            };
            var lb = function(a) {
                a.preventDefault();
                F = a = parseInt(this.getAttribute("state"));
                c.notifyObservers(b, "SetGroupMaskState", a);
                switch (a) {
                    case "0":
                    case 0:
                        pgvSendClick({
                            hottag:
                    "WEB2QQ.QQPANEL.MESSAGESETTING.QUNSELF"
                        });
                        alloy.util.report2im("qqpanel|groups|msgsetting|self");
                        break;
                    case "1":
                    case 1:
                        pgvSendClick({
                            hottag:
                    "WEB2QQ.QQPANEL.MESSAGESETTING.WIDTHALERTS"
                        });
                        alloy.util.report2im("qqpanel|groups|msgsetting|withalert");
                        break;
                    case "2":
                    case 2:
                        pgvSendClick({
                            hottag:
                    "WEB2QQ.QQPANEL.MESSAGESETTING.WIDTHOUTALERTS"
                        });
                        alloy.util.report2im("qqpanel|groups|msgsetting|withoutalert");
                        break;
                    case "3":
                    case 3:
                        pgvSendClick({
                            hottag:
                    "WEB2QQ.QQPANEL.MESSAGESETTING.BLOCK"
                        }),
                alloy.util.report2im("qqpanel|groups|msgsetting|block")
                }
            };
            this.setGroupMaskState = function(b) {
                a.removeClass(this.costomDom, "simpleMenuItemSelected");
                a.removeClass(this.promptDom, "simpleMenuItemSelected");
                a.removeClass(this.noPromptDom, "simpleMenuItemSelected");
                a.removeClass(this.maskDom, "simpleMenuItemSelected");
                b = parseInt(b);
                switch (b) {
                    case 0:
                        a.addClass(this.costomDom, "simpleMenuItemSelected");
                        break;
                    case 1:
                        a.addClass(this.promptDom, "simpleMenuItemSelected");
                        break;
                    case 2:
                        a.addClass(this.noPromptDom, "simpleMenuItemSelected");
                        break;
                    case 3:
                        a.addClass(this.maskDom, "simpleMenuItemSelected")
                }
            };
            this.setGroupListMaskState = function(b, c) {
                var d = a.id("EQQ_GroupList_State_" + b),
            f = a.id("EQQ_RecentList_State_" + b);
                c ? (d && a.removeClass(d, "EQQ_GroupMask_State"), f && a.removeClass(f, "EQQ_GroupMask_State")) : (d && a.addClass(d, "EQQ_GroupMask_State"), f && a.addClass(f, "EQQ_GroupMask_State"))
            };
            var kb = function(c) {
                c.stopPropagation();
                alloy.util.report2im("qqpanel|groups|msgsetting");
                c = a.getClientXY(b.EQQ_ListBottom_maskButton);
                b.toggleGroupMaskStatePanel(c)
            };
            this.toggleGroupMaskStatePanel = function(a) {
                this.groupMaskPanel && this.groupMaskPanel.isShow() ? this.hideGroupMaskStatePanel() : this.showGroupMaskStatePanel(a)
            };
            this.showGroupMaskStatePanel = function(a) {
                this.groupMaskPanel || this.createGroupMaskPanelDom();
                if (a) {
                    var b = this.groupMaskPanel.getWidth(),
                c = this.groupMaskPanel.getHeight(),
                d = alloy.layout.getClientWidth(),
                f = alloy.layout.getClientHeight(),
                e = a[0],
                a = a[1] - 100;
                    e < 2 && (e = 2);
                    a < 2 && (a = 2);
                    e > d - b - 2 && (e = d - b - 2);
                    a > f - c - 2 && (a = f - c - 2);
                    this.groupMaskPanel.setXY(e, a)
                }
                this.groupMaskPanel.setZIndex(alloy.layout.getTopZIndex(3));
                this.groupMaskPanel.show()
            };
            this.hideGroupMaskStatePanel = function() {
                this.groupMaskPanel && this.groupMaskPanel.hide()
            };
            this.createMiniCardPanelDom = function() {
                var v = a.node("div", {
                    id: "miniCard",
                    "class": "panel_1"
                });
                v.innerHTML = d.miniCardPanel;
                u.appendChild(v);
                var e = a.id("miniCard_avatar"),
            g = a.id("miniCard_name_inner"),
            h = a.id("miniCard_signature"),
            m = a.id("miniCard_signature_inner"),
            i = a.id("miniCard_clientType_inner"),
            k = a.id("miniCard_clientType_innerWrapper"),
            l = a.id("miniCard_level"),
            j = a.id("miniCard_level_upinfo"),
            o = a.id("miniCard_qzone"),
            n = a.id("miniCard_qmail"),
            q = a.id("miniCard_video");
                f.platform.iPad && a.hide(q);
                var M = a.id("miniCard_userDetails");
                c.on(v, "mouseover", Xa);
                c.on(v, "mouseout", Ya);
                c.on(M, "click", Za);
                c.on(o, "click", $a);
                c.on(n, "click", ab);
                c.on(q, "click", bb);
                this.miniCardPanel = new alloy.layout.Panel({
                    container: v,
                    body: a.id("miniCardBody"),
                    html: ""
                });
                this.miniCardPanel.setInfo = function(v) {
                    this.uin = v.uin;
                    var d = v.uin == alloy.portal.getUin();
                    e.src = EQQ.getUserDefaultAvatar();
                    e.src = v.avatarUrl;
                    d ? (M.innerHTML = "\u4fee\u6539\u8d44\u6599", e.src = alloy.util.getUserAvatar(v.uin, 1) + "&t=" + (new Date).getTime(), a.hide(q)) : (M.innerHTML = "\u8be6\u7ec6\u8d44\u6599", a.show(q));
                    f.platform.iPad && a.hide(q);
                    g.innerHTML = v.htmlAllName;
                    g.title = v.allName;
                    m.innerHTML = "";
                    l.innerHTML = "";
                    j.innerHTML = "";
                    o.href = EQQ.getQzoneUrl(v.uin);
                    n.title = v.uin == alloy.portal.getUin() ? "\u8fdb\u5165\u90ae\u7bb1" : "\u53d1\u9001\u90ae\u4ef6";
                    n.href = EQQ.getSendMailUrl(v.uin);
                    q.setAttribute("uin", v.uin);
                    d || v.clientType == "1" || v.clientType == "10000" || v.type == "stranger" || !v.clientType ? (k.className = "miniCard_clientType_innerWrapper", h.style.display = "block") : (k.className = "miniCard_clientType_" + EQQ.hash.clientType[v.clientType || "10000"], i.innerHTML = EQQ.hash.clientTypeText[v.clientType || "10000"] + "\u767b\u5f55\u4e2d", h.style.display = "none");
                    c.notifyObservers(b, "MiniCardShow", v)
                };
                this.miniCardPanel.setSignature = function(a) {
                    m.innerHTML = a.htmlSignature;
                    m.title = a.signature
                };
                this.miniCardPanel.setClientType = function(a) {
                    if (this.uin == a.uin) a.clientType == "1" ? (k.className = "miniCard_clientType_" + EQQ.hash.clientType[a.clientType || "10000"], i.innerHTML = EQQ.hash.clientTypeText[a.clientType || "10000"] + "\u767b\u5f55\u4e2d", h.style.display = "none") : (k.className = "miniCard_clientType_innerWrapper", h.style.display = "block")
                };
                this.miniCardPanel.setQQLevel = function(a) {
                    for (var b = a.level,
                c = b.level,
                v = parseInt(c / 64), d = parseInt(c % 64 / 16), f = parseInt(c % 64 % 16 / 4), e = c % 64 % 16 % 4, g = "", h = 0; h < v; h++) g += '<div class="miniCard_level_div qqLevel_queen"></div>';
                    for (h = 0; h < d; h++) g += '<div class="miniCard_level_div qqLevel_sun"></div>';
                    for (h = 0; h < f; h++) g += '<div class="miniCard_level_div qqLevel_moon"></div>';
                    for (h = 0; h < e; h++) g += '<div class="miniCard_level_div qqLevel_star"></div>';
                    l.innerHTML = g;
                    l.title = "\u7b49\u7ea7: " + c;
                    if (a.uin == alloy.portal.getUin()) j.innerHTML = '<div class="miniCard_level_upinfo_div" title="\u6d3b\u8dc3\u5929\u6570\uff1a' + b.days + '"><span class="icon days"></span>' + b.days + '\u5929</div><div class="miniCard_level_upinfo_div" title="\u8ddd\u5347\u7ea7\u5230' + (c + 1) + "\u7ea7\u8fd8\u6709" + b.remainDays + '\u5929"><span class="icon remainDays"></span>' + b.remainDays + "\u5929</div>"
                }
            };
            this.showMiniCardPanel = function(a, b) {
                this.miniCardPanel || this.createMiniCardPanelDom();
                if (b) {
                    var c = this.miniCardPanel.getWidth() + 10,
                d = this.miniCardPanel.getHeight() + 10,
                f = alloy.layout.getClientWidth(),
                e = alloy.layout.getClientHeight(),
                g = b[0],
                h = b[1];
                    g < 2 && (g = 2);
                    h < 2 && (h = 2);
                    g > f - c - 2 && (g = f - c - 2);
                    h > e - d - 2 && (h = e - d - 2);
                    this.miniCardPanel.setXY(g, h)
                }
                this.miniCardPanel.setInfo(EQQ.Model.BuddyList.getUserByUin(a), a);
                this.miniCardPanel.setZIndex(alloy.layout.getTopZIndex(3));
                this.miniCardPanel.show()
            };
            this.hideMiniCardPanel = function() {
                if (this.miniCardPanel) {
                    var b = a.id("miniCard_buddyOption_tabBody");
                    a.setStyle(b, "display", "none");
                    this.miniCardPanel.hide()
                }
            };
            this.setNoneFlashStyle = function() {
                a.addClass(this.EQQ_buddyList, "EQQ_buddyList_noneFlash")
            };
            this.getHtml = function() {
                return d.myPanel + '<div id="EQQ_MainPanel" class="EQQ_mainPanel">' + d.mainPanelHeader + f.string.template(d.mainPanelBody, {
                    searchReaultPanel: d.searchReaultPanel,
                    buddyListBody: d.buddyListBody
                }) + d.mainPanelFooter + "</div>"
            };
            this.createDom = function() {
                var a = this.getHtml();
                alloy.app.eqq.getWindow().setHtml(a);
                this.createContextMenu()
            };
            this.onYellowTipsClick = function() {
                b.hideYellowTips();
                c.notifyObservers(b, "CloseYellowTipsFinish")
            };
            this.showYellowTips = function() {
                C += 20;
                this.onWindowResize();
                a.show(this.EQQ_YellowTips)
            };
            this.hideYellowTips = function() {
                a.hide(this.EQQ_YellowTips);
                C -= 20;
                this.onWindowResize()
            };
            this.onEqqResize = function(b) {
                var c = b.width,
            b = b.height - 50;
                b < 5 && (b = 5);
                var d = b - 5 - 77;
                a.setStyle(this.EQQ_myInfo, "width", c - 60 + "px");
                a.setStyle(this.EQQ_MyNick, "width", c - 90 + "px");
                a.setStyle(this.EQQ_myService, "width", c - 55 + "px");
                f.browser.ie == 6 && (d += 3);
                a.setStyle(this.EQQ_ListContainer, "height", d + "px");
                a.setStyle(this.EQQ_Logining_Container, "height", b - 2 + "px");
                a.setStyle(this.EQQ_ReLoginPanel, "height", b - 2 + "px");
                a.setStyle(this.EQQ_buddyListPanel, "height", d - 25 + "px");
                a.setStyle(this.EQQ_groupListOuter, "height", d - 50 + "px");
                a.setStyle(this.EQQ_discuListOuter, "height", d - 50 + "px");
                a.setStyle(this.EQQ_groupBox, "height", d - 25 + "px");
                a.setStyle(this.EQQ_discuBox, "height", d - 25 + "px");
                la()
            };
            this.onWindowResize = function() { };
            this.onSearchBoxMouseover = function() {
                a.setClass(this, "EQQ_SearchBoxHover")
            };
            this.onSearchBoxMouseout = function() {
                a.setClass(this, "EQQ_SearchBox")
            };
            this.onSearchBoxFocus = function() {
                c.off(b.EQQ_SearchBox, "mouseover", b.onSearchBoxMouseover);
                c.off(b.EQQ_SearchBox, "mouseout", b.onSearchBoxMouseout);
                a.setClass(this, "EQQ_SearchBoxFocus");
                a.setClass(b.EQQ_SearchButton, "EQQ_SearchButton EQQ_SearchButtonHightLight");
                b.clearSearchBox(this);
                this.select();
                b.startSearch()
            };
            this.onSearchBoxBlur = function() {
                c.on(b.EQQ_SearchBox, "mouseover", b.onSearchBoxMouseover);
                c.on(b.EQQ_SearchBox, "mouseout", b.onSearchBoxMouseout);
                a.setClass(this, "EQQ_SearchBox");
                a.setClass(b.EQQ_SearchButton, "EQQ_SearchButton");
                b.resetSearchBox(this)
            };
            this.resetSearchBox = function(a) {
                if (a.value == "") a.value = "\u641c\u7d22\u597d\u53cb..."
            };
            this.clearSearchBox = function(a) {
                if (f.string.trim(a.value) == "\u641c\u7d22\u597d\u53cb...") a.value = ""
            };
            this.onSearchButtonClick = function() {
                b.startSearch()
            };
            this.onSearchBoxKeyup = function(a) {
                a.stopPropagation();
                b.EQQ_SearchBox.value ? a.keyCode != 38 && a.keyCode != 40 && b.startSearch() : b.hideSearchResult()
            };
            this.onSearchBoxKeydown = function(d) {
                switch (d.keyCode) {
                    case 13:
                        s && (d.preventDefault(), b.hideSearchResult(), c.notifyObservers(b, "StartChat", s.uin), pgvSendClick({
                            hottag: "web2qq.qqpanel.searchcontacts"
                        }), alloy.util.report2im("qqpanel|searchcontacts"));
                        break;
                    case 38:
                        x > 0 && (d = a.id("EQQ_SearchResultItem_" + s.uin), a.setStyle(d, "backgroundColor", "transparent"), x--, s = K[x], (d = a.id("EQQ_SearchResultItem_" + s.uin)) && a.setStyle(d, "backgroundColor", "#cbe7fc"));
                        break;
                    case 40:
                        x < K.length - 1 && (d = a.id("EQQ_SearchResultItem_" + s.uin), a.setStyle(d, "backgroundColor", "transparent"), x++, s = K[x], (d = a.id("EQQ_SearchResultItem_" + s.uin)) && a.setStyle(d, "backgroundColor", "#cbe7fc"))
                }
            };
            this.startSearch = function() {
                this.clearSearchBox(this.EQQ_SearchBox);
                c.notifyObservers(this, "Search", this.EQQ_SearchBox.value)
            };
            this.showSearchResult = function(b) {
                if (this.EQQ_SearchBox.value) {
                    K = b;
                    var d = a.getRelativeXY(this.EQQ_SearchBox, this.EQQ_MainPanel);
                    a.setStyle(this.EQQ_SearchResultPanel, "left", d[0] + "px");
                    a.setStyle(this.EQQ_SearchResultPanel, "top", d[1] + 26 + "px");
                    a.show(this.EQQ_SearchResultPanel);
                    this.EQQ_SearchResultPanel.innerHTML = "";
                    if (b.length == 0) s = x = null,
                this.EQQ_SearchResultPanel.innerHTML = '<div class="EQQ_SearchResultNo">\u6ca1\u6709\u627e\u5230\u76f8\u5173\u597d\u53cb</div>';
                    else {
                        x = 0;
                        s = b[0];
                        for (d = 0; d < b.length; d++) {
                            var e = b[d],
                        g = a.node("div");
                            a.setClass(g, "EQQ_SearchResultItem");
                            g.id = "EQQ_SearchResultItem_" + e.uin;
                            g.setAttribute("uin", e.uin);
                            g.innerHTML = e.htmlAllName;
                            g.title = e.allName;
                            this.EQQ_SearchResultPanel.appendChild(g);
                            d == 0 && a.setStyle(g, "backgroundColor", "#cbe7fc");
                            c.on(g, "mouseover", this.onSearchResultMouseover);
                            c.on(g, "mouseout", this.onSearchResultMouseout);
                            c.on(g, "mousedown", this.onSearchResultClick)
                        }
                    }
                    c.on(document, "mousedown", f.bind(this.hideSearchResult, this))
                }
            };
            this.hideSearchResult = function() {
                a.hide(this.EQQ_SearchResultPanel);
                c.off(document, "mousedown")
            };
            this.onSearchResultMouseover = function() {
                a.setStyle(this, "backgroundColor", "#cbe7fc")
            };
            this.onSearchResultMouseout = function() {
                a.setStyle(this, "backgroundColor", "transparent")
            };
            this.onSearchResultClick = function() {
                var a = this.getAttribute("uin");
                b.hideSearchResult();
                c.notifyObservers(b, "StartChat", a);
                pgvSendClick({
                    hottag: "web2qq.qqpanel.searchcontacts"
                });
                alloy.util.report2im("qqpanel|searchcontacts")
            };
            this.show = function() {
                a.show(this.EQQ_MainPanel)
            };
            this.hide = function() {
                a.hide(this.EQQ_MainPanel)
            };
            this.updateSelftAvatar = function() {
                var a = alloy.portal.getUin();
                this.EQQ_MyAvatar.src = alloy.util.getUserAvatar(a, 1) + "&t=" + (new Date).getTime()
            };
            this.updateSelfInfoChange = function(a) {
                this.EQQ_MyAvatar.src = EQQ.getUserAvatar(a.uin);
                this.EQQ_MyAvatar.title = "\u4fee\u6539\u8d44\u6599";
                this.EQQ_MyAvatar.setAttribute("uin", a.uin);
                this.EQQ_MyNick.innerHTML = a.htmlNick;
                this.EQQ_MyNick.title = a.titleNick + "<" + a.uin + ">"
            };
            this.updateSelfStateChange = function(b) {
                a.setClass(this.EQQ_MyStateShow, "EQQ_myStateShow EQQ_" + b);
                b === "offline" ? a.addClass(this.EQQ_MyAvatar, "EQQ_myAvatar_offline") : a.removeClass(this.EQQ_MyAvatar, "EQQ_myAvatar_offline");
                var c = alloy.taskBar.quickPanel.getQuickButton(50);
                b == "online" ? c.setStateClass("") : c.setStateClass("EQQ_" + b)
            };
            this.updateSelfSignatureChange = function(a) {
                (I = a = a.signature) || (a = "\u70b9\u51fb\u7f16\u8f91\u7b7e\u540d");
                this.EQQ_MySignature.value = a;
                this.EQQ_MySignature.title = a
            };
            this.createBuddyClass = function(a) {
                this.addOnlineBuddyClass();
                for (var b = 0; b < a.length; b++) this.addBuddyClass(a[b]);
                this.addStrangerBuddyClass();
                this.addBlackListBuddyClass()
            };
            this.addOnlineBuddyClass = function() {
                var a = {};
                a.index = EQQ.hash.userClassType.online;
                a.name = "\u5728\u7ebf\u597d\u53cb";
                a.htmlName = f.string.toHtml(a.name);
                a.titleName = f.string.encodeHtmlSimple(a.name);
                a.count = 0;
                a.onlineCount = 0;
                a.list = {
                    callme: [],
                    online: [],
                    away: [],
                    busy: [],
                    silent: [],
                    offline: []
                };
                this.addBuddyClass(a)
            };
            this.addStrangerBuddyClass = function() {
                var a = {};
                a.index = EQQ.hash.userClassType.stranger;
                a.name = "\u964c\u751f\u4eba";
                a.htmlName = f.string.toHtml(a.name);
                a.titleName = f.string.encodeHtmlSimple(a.name);
                a.count = 0;
                a.onlineCount = 0;
                a.list = {
                    callme: [],
                    online: [],
                    away: [],
                    busy: [],
                    silent: [],
                    offline: []
                };
                this.addBuddyClass(a)
            };
            this.addBlackListBuddyClass = function() {
                var a = {};
                a.index = EQQ.hash.userClassType.blacklist;
                a.name = "\u9ed1\u540d\u5355";
                a.htmlName = f.string.toHtml(a.name);
                a.titleName = f.string.encodeHtmlSimple(a.name);
                a.count = 0;
                a.onlineCount = 0;
                a.list = {
                    callme: [],
                    online: [],
                    away: [],
                    busy: [],
                    silent: [],
                    offline: []
                };
                this.addBuddyClass(a)
            };
            var Ba = function(b) {
                for (var b = b.width,
            c = G.length; --c >= 0; ) {
                    var d = G[c].el = G[c].el || a.id("EQQ_Class_" + G[c].index + "_className"),
                f = G[c].len,
                e = G[c].html,
                g = G[c].html_short;
                    if (b <= 200) d.innerHTML = g;
                    else if (b > f + 20) d.innerHTML = e
                }
            };
            this.addBuddyClass = function(b, d) {
                var e, g;
                e = a.node("div", {
                    id: "EQQ_listClassHead_" + b.index,
                    classIndex: b.index
                });
                g = b.index == EQQ.hash.userClassType.online ? '\t\t\t\t\t<div class="EQQ_listClassHeadIcon">icon</div>\t\t\t\t\t<div class="EQQ_ClassList_RightContainer" title="<%=titleName%>">\t\t\t\t\t\t<div class="EQQ_Class_className" id="EQQ_Class_<%=index%>_className"><%=cut_htmlName%></div>[<span id="EQQ_Class_<%=index%>_OnlineCounter"><%=onlineCount%></span>]\t\t\t\t\t</div>\t\t\t\t' : '\t\t\t\t\t<div class="EQQ_listClassHeadIcon">icon</div>\t\t\t\t\t<div class="EQQ_ClassList_RightContainer" title="<%=titleName%>">\t\t\t\t\t\t<div class="EQQ_Class_className" id="EQQ_Class_<%=index%>_className"><%=cut_htmlName%> </div>[<span id="EQQ_Class_<%=index%>_OnlineCounter"><%=onlineCount%></span>/<span id="EQQ_Class_<%=index%>_Counter"><%=count%></span>]\t\t\t\t\t</div>\t\t\t\t';
                b.cut_htmlName = b.htmlName;
                if (b.caculateName) {
                    var h = j.getCharWidth(b.caculateName + ("[" + b.onlineCount + "/" + (b.count || 1) + "]"), 12);
                    if (h > 120) h = {
                        index: b.index,
                        len: h,
                        html: b.cut_htmlName
                    },
                b.cut_htmlName = '<div class="mainpanel_limit_class_width_outer"><div class="mainpanel_limit_class_width_inner">' + b.htmlName + "</div></div>...",
                h.html_short = b.cut_htmlName,
                G.push(h)
                }
                g = f.string.template(g, b);
                e.innerHTML = g;
                d ? this.EQQ_buddyList.insertBefore(e, d) : this.EQQ_buddyList.appendChild(e);
                c.on(e, "click", Va);
                h = a.node("div", {
                    id: "EQQ_listClassBody_" + b.index,
                    "class": "EQQ_listClassBody"
                });
                g = f.string.template('\t\t\t\t<div id="EQQ_Class_<%=index%>_callme" class="EQQ_callmeBuddy"></div>\t\t\t\t<div id="EQQ_Class_<%=index%>_online" class="EQQ_onlineBuddy"></div>\t\t\t\t<div id="EQQ_Class_<%=index%>_busy" class="EQQ_busyBuddy"></div>\t\t\t\t<div id="EQQ_Class_<%=index%>_away" class="EQQ_awayBuddy"></div>\t\t\t\t<div id="EQQ_Class_<%=index%>_silent" class="EQQ_silentBuddy"></div>\t\t\t\t<div id="EQQ_Class_<%=index%>_offline" class="EQQ_offlineBuddy"></div>\t\t\t', b);
                h.innerHTML = g;
                this.EQQ_buddyList.insertBefore(h, e.nextSibling);
                this.collapsedClass(b.index)
            };
            this.hideLogin = function() {
                a.hide(this.EQQ_Logining_Container);
                a.hide(this.EQQ_Logining_feedback);
                a.hide(this.EQQ_ReLoginPanel);
                a.show(this.EQQ_LoginSuccess);
                a.setStyle(this.EQQ_LoginSuccess, "height", "100%");
                var b = {
                    height: alloy.app.eqq.window.getBodySize().height,
                    width: alloy.app.eqq.window.getBodySize().width
                };
                this.onEqqResize(b);
                f.browser.ie !== 7 && Ba(b)
            };
            this.showLogin = function(b) {
                a.show(this.EQQ_Logining_Container);
                this.EQQ_Logining.innerHTML = b || "\u53d1\u8d77\u8fde\u63a5...";
                a.show(this.EQQ_Logining_feedback);
                a.hide(this.EQQ_ReLoginPanel);
                a.hide(this.EQQ_LoginSuccess);
                a.setStyle(this.EQQ_LoginSuccess, "height", "0px")
            };
            this.showPullData = function() {
                a.show(this.EQQ_Logining_Container);
                this.EQQ_Logining.innerHTML = "\u62c9\u53d6\u6570\u636e..."
            };
            this.clearBuddyList = function() {
                this.EQQ_buddyList.innerHTML = ""
            };
            this.createBuddyList = function(a) {
                f.timedChunk(a, this.addBuddy, this, !1,
            function() {
                c.notifyObservers(b, "BuddyListReady")
            })
            };
            this.getClassExpandFlag = function(a) {
                return i[a]
            };
            this.setClassExpandFlag = function(a, b) {
                return i[a] = b
            };
            this.getClassAvatarLoadFlag = function(a) {
                return w[a]
            };
            this.setClassAvatarLoadFlag = function(a, b) {
                return w[a] = b
            };
            this.toggleClass = function(a) {
                i[a] ? this.collapsedClass(a) : this.expandClass(a)
            };
            this.collapsedClass = function(b) {
                var c = a.id("EQQ_listClassHead_" + b),
            d = a.id("EQQ_listClassBody_" + b);
                b == EQQ.hash.userClassType.online ? (a.setClass(c, "EQQ_onlineClassHeadCollapsed"), a.removeClass(c, "expand_online")) : (a.setClass(c, "EQQ_listClassHeadCollapsed"), a.removeClass(c, "expand"));
                a.setStyle(d, "height", "0");
                this.setClassExpandFlag(b, !1)
            };
            this.expandClass = function(b) {
                var c = a.id("EQQ_listClassHead_" + b),
            d = a.id("EQQ_listClassBody_" + b);
                b == EQQ.hash.userClassType.online ? (a.setClass(c, "EQQ_onlineClassHeadExpand"), a.addClass(c, "expand_online")) : (a.setClass(c, "EQQ_listClassHeadExpand"), a.addClass(c, "expand"));
                a.setStyle(d, "height", "auto");
                this.setClassExpandFlag(b, !0);
                f.out("index: " + b);
                fa()
            };
            var fa = this.loadBuddyListAvatar = function() {
                for (var c = b.EQQ_buddyListPanel,
            d = parseInt(a.getStyle(c, "height"), 10), c = a.getXY(c)[1], e = 0; e < r.length; ) {
                    var g = r[e],
                h = g.imgEl,
                m = g.classId,
                i = a.getXY(h)[1] - c;
                    b.getClassExpandFlag(m) && h && i > 0 && i < d ? (f.out("checkAndLoadAvatar & loadAvatar containerHeight: " + d + ", imgTop2:" + i), h.src = EQQ.getUserAvatar(g.uin), r.splice(e, 1)) : e++
                }
                if (ba()) {
                    c = b.EQQ_buddyListPanel;
                    d = parseInt(a.getStyle(c, "height"), 10);
                    c = a.getXY(c)[1];
                    for (e = 0; e < k.length; ) m = k[e],
                g = m.el,
                h = m.uin,
                m = m.classId,
                i = a.getXY(g)[1] - c,
                b.getClassExpandFlag(m) && g && i > 0 && i < d ? (g.hasSign || EQQ.Model.BuddyList.getUserSignature(h), k.splice(e, 1)) : e++
                }
            },
        ea = function() {
            la()
        },
        la = function() {
            if (ea.timer) window.clearTimeout(ea.timer),
            ea.timer = null;
            ea.timer = window.setTimeout(fa, 500)
        },
        qa = function() {
            for (var a = [], b; b = D.shift(); ) {
                var c = b.gcode;
                b.el.hasSign || a.push(c)
            }
            a.length && EQQ.Model.BuddyList.getMultiGroupAnnounce(a)
        },
        ra = function() {
            for (var a = [], b; b = B.shift(); ) {
                var c = b.el;
                b = b.uin;
                c.hasSign || a.push(b)
            }
            a.length && EQQ.Model.BuddyList.getMultiUserSignture(a);
            for (a = []; b = E.shift(); ) c = b.el,
            b = b.gcode,
            c.hasSign || a.push(b);
            a.length && EQQ.Model.BuddyList.getMultiGroupAnnounce(a)
        };
            this.addBuddy = function(d) {
                if (d) {
                    var e = f.string.template('\t\t\t\t\t<div class="EQQ_BuddyList_ClientType" uin="<%=uin%>" id="EQQ_BuddyList_ClientType_Title_<%=uin%>" title="' + EQQ.hash.clientTypeText[d.clientType || "PC"] + '">\t\t\t\t\t\t<div id="EQQ_BuddyList_ClientType_<%=uin%>" class="EQQ_BuddyList_ClientType_' + EQQ.hash.clientType[d.clientType || "10000"] + '"></div>\t\t\t\t\t</div>\t\t\t\t\t<div id="EQQ_BuddyList_AvatarContainer_<%=uin%>" class="EQQ_BuddyList_AvatarContainer" uin="<%=uin%>" title="' + EQQ.hash.onlineStatusText[d.state] + '">\t\t\t\t\t\t<img id="EQQ_BuddyList_Avatar_<%=uin%>" class="EQQ_BuddyList_Avatar" src="' + alloy.CONST.CDN_URL + 'style/images/avatar_default_20_20.gif" />\t\t\t\t\t\t<div class="EQQ_BuddyList_State"></div>\t\t\t\t\t</div>\t\t\t\t\t<div id="EQQ_BuddyList_RightContainer_<%=uin%>" class="EQQ_BuddyList_RightContainer" >\t\t\t\t\t\t<div id="EQQ_BuddyList_Nick_<%=uin%>" title="<%=titleAllName%> - ' + EQQ.hash.onlineStatusText[d.state] + '" class="EQQ_BuddyList_Nick"><%=htmlShowName%></div>\t\t\t\t\t\t<div id="EQQ_BuddyList_Sign_<%=uin%>" title="" class="EQQ_BuddyList_Sign"></div>\t\t\t\t\t</div>\t\t\t\t', d),
                g = a.id("EQQ_Class_" + d.classId + "_" + d.state);
                    a.show(g);
                    var h = a.node("div", {
                        id: "EQQ_Buddy_" + d.uin,
                        "class": "EQQ_BuddyList_Buddy",
                        uin: d.uin,
                        fileId: d.uin,
                        uid: "buddy_uin_" + d.uin,
                        from: "buddy",
                        type: "uin"
                    });
                    h.innerHTML = e;
                    g.appendChild(h);
                    c.on(h, "mouseover", Z);
                    c.on(h, "mouseout", $);
                    c.on(h, "click",
                function(a) {
                    ma.apply(this, [a]);
                    pgvSendClick({
                        hottag: "web2qq.qqpanel.contacts.sendmsg"
                    });
                    alloy.util.report2im("qqpanel|contacts|sendmsg")
                });
                    c.on(h, "contextmenu", oa);
                    e = a.id("EQQ_BuddyList_AvatarContainer_" + d.uin);
                    c.on(e, "mouseover", ha);
                    c.on(e, "mouseout", ia);
                    f.platform.iPad || b.contactDragController.addDragClass(h);
                    h = a.id("EQQ_BuddyList_Avatar_" + d.uin);
                    this.getClassExpandFlag(d.classId) ? (f.out("addBuddy & loadAvatar"), h.src = EQQ.getUserAvatar(d.uin)) : r.push({
                        uin: d.uin,
                        imgEl: h,
                        classId: d.classId
                    });
                    ba() && this.getClassExpandFlag(d.classId) ? EQQ.Model.BuddyList.getUserSignature(d.uin) : (h = a.id("EQQ_BuddyList_Sign_" + d.uin), k.push({
                        uin: d.uin,
                        el: h,
                        classId: d.classId
                    }))
                }
            };
            this.removeBuddy = function(b) {
                var d = a.id("EQQ_Buddy_" + b.uin);
                if (d) {
                    c.off(d, "mouseover");
                    c.off(d, "mouseout");
                    c.off(d, "click");
                    c.off(d, "contextmenu");
                    if (b = a.id("EQQ_BuddyList_AvatarContainer_" + b.uin)) c.off(b, "mouseover"),
                c.off(b, "mouseout");
                    d.parentNode && d.parentNode.removeChild(d);
                    return !0
                } else return !1
            };
            this.addOnlineBuddy = function(d) {
                if (d) {
                    var e = f.string.template('\t\t\t\t\t<div class="EQQ_BuddyList_ClientType" uin="<%=uin%>" id="EQQ_OnlineBuddyList_ClientType_Title_<%=uin%>" title="' + EQQ.hash.clientTypeText[d.clientType] + '">\t\t\t\t\t\t<div id="EQQ_OnlineBuddyList_ClientType_<%=uin%>" class="EQQ_BuddyList_ClientType_' + EQQ.hash.clientType[d.clientType || "10000"] + '"></div>\t\t\t\t\t</div>\t\t\t\t\t<div id="EQQ_OnlineBuddyList_AvatarContainer_<%=uin%>" class="EQQ_BuddyList_AvatarContainer" uin="<%=uin%>" title="' + EQQ.hash.onlineStatusText[d.state] + '">\t\t\t\t\t\t<img id="EQQ_OnlineBuddyList_Avatar_<%=uin%>" class="EQQ_BuddyList_Avatar" src="' + alloy.CONST.CDN_URL + 'style/images/avatar_default_20_20.gif" />\t\t\t\t\t\t<div class="EQQ_BuddyList_State"></div>\t\t\t\t\t</div>\t\t\t\t\t<div class="EQQ_BuddyList_RightContainer">\t\t\t\t\t\t<div class="EQQ_BuddyList_Nick" title="<%=titleAllName%> - ' + (EQQ.hash.clientTypeText[d.clientType || "pc"] === "PC" ? "" : EQQ.hash.clientTypeText[d.clientType || "pc"]) + EQQ.hash.onlineStatusText[d.state] + '"><%=htmlShowName%></div>                        <div id="EQQ_OnlineBuddyList_Sign_<%=uin%>" title="" class="EQQ_BuddyList_Sign"></div>\t\t\t\t\t</div>\t\t\t\t', d),
                g = a.id("EQQ_Class_" + EQQ.hash.userClassType.online + "_" + d.state);
                    a.setStyle(g, "display", "block");
                    var h = a.node("div", {
                        id: "EQQ_OnlineBuddy_" + d.uin,
                        uin: d.uin,
                        fileId: d.uin,
                        uid: "online_uin_" + d.uin,
                        from: "buddy",
                        type: "uin"
                    });
                    h.innerHTML = e;
                    g.appendChild(h);
                    c.on(h, "mouseover", Z);
                    c.on(h, "mouseout", $);
                    c.on(h, "click",
                function(a) {
                    ma.apply(this, [a]);
                    pgvSendClick({
                        hottag: "web2qq.qqpanel.contacts.sendmsg"
                    });
                    alloy.util.report2im("qqpanel|contacts|sendmsg")
                });
                    c.on(h, "contextmenu", oa);
                    a.addClass(h, "EQQ_BuddyList_Buddy");
                    e = a.id("EQQ_OnlineBuddyList_AvatarContainer_" + d.uin);
                    c.on(e, "mouseover", ha);
                    c.on(e, "mouseout", ia);
                    f.platform.iPad || b.contactDragController.addDragClass(h);
                    e = a.id("EQQ_OnlineBuddyList_Avatar_" + d.uin);
                    h = EQQ.hash.userClassType.online;
                    this.getClassExpandFlag(h) ? (f.out("addOnlineBuddy & loadAvatar"), e.src = EQQ.getUserAvatar(d.uin)) : r.push({
                        uin: d.uin,
                        imgEl: e,
                        classId: h
                    });
                    ba() && this.getClassExpandFlag(h) ? EQQ.Model.BuddyList.getUserSignature(d.uin) : (e = a.id("EQQ_OnlineBuddyList_Sign_" + d.uin), k.push({
                        uin: d.uin,
                        el: e,
                        classId: h
                    }))
                }
                fa()
            };
            this.removeOnlineBuddy = function(b) {
                var d = a.id("EQQ_OnlineBuddy_" + b.uin);
                if (d) {
                    c.off(d, "mouseover");
                    c.off(d, "mouseout");
                    c.off(d, "click");
                    c.off(d, "contextmenu");
                    if (b = a.id("EQQ_OnlineBuddyList_AvatarContainer_" + b.uin)) c.off(b, "mouseover"),
                c.off(b, "mouseout");
                    d.parentNode && d.parentNode.removeChild(d);
                    return !0
                } else return !1
            };
            this.updateOnlineBuddyClass = function(b) {
                b = b.length;
                a.id("EQQ_Class_" + EQQ.hash.userClassType.online + "_OnlineCounter").innerHTML = b
            };
            this.updateBuddySignature = function(b) {
                if (b) {
                    var c = a.id("EQQ_OnlineBuddyList_Sign_" + b.uin),
                d = a.id("EQQ_BuddyList_Sign_" + b.uin),
                f = a.id("EQQ_RecentList_Sign_" + b.uin);
                    if (c && !c.hasSign) c.innerHTML = b.htmlSignature,
                c.title = b.titleSignature,
                c.hasSign = !0;
                    if (d && !d.hasSign) d.innerHTML = b.htmlSignature,
                d.title = b.titleSignature,
                d.hasSign = !0;
                    if (f && !f.hasSign) f.innerHTML = b.htmlSignature,
                f.title = b.titleSignature,
                f.hasSign = !0
                }
            };
            this.updateGroupAnnouncement = function(b) {
                var c = a.id("EQQ_GroupList_Bulletin_" + b.gid),
            d = a.id("EQQ_GroupRecentList_Bulletin_" + b.gid);
                if (c && !c.hasSign) c.innerHTML = b.htmlAnnouncement,
            c.title = b.titleAnnouncement,
            c.hasSign = !0;
                if (d && !d.hasSign) d.innerHTML = b.htmlAnnouncement,
            d.title = b.titleAnnouncement,
            d.hasSign = !0
            };
            this.jumpUp = function(b) {
                m = !0;
                for (var c = 0; c < b.length; c++) {
                    var d = a.id("EQQ_Buddy_" + b[c]);
                    d && a.addClass(d, "EQQ_jumpUpInBuddyList")
                }
            };
            this.jumpDown = function(b) {
                m = !1;
                for (var c = 0; c < b.length; c++) {
                    var d = a.id("EQQ_Buddy_" + b[c]);
                    d && a.removeClass(d, "EQQ_jumpUpInBuddyList")
                }
            };
            this.jumpAvatar = function(a) {
                m ? this.jumpDown(a) : this.jumpUp(a)
            };
            this.flickerClassHide = function(b) {
                o = !0;
                for (var c = 0; c < b.length; c++) {
                    var d = a.id("EQQ_listClassHead_" + b[c]);
                    a.addClass(d, "EQQ_flickerHideInBuddyList")
                }
            };
            this.flickerClassShow = function(b) {
                o = !1;
                for (var c = 0; c < b.length; c++) {
                    var d = a.id("EQQ_listClassHead_" + b[c]);
                    a.removeClass(d, "EQQ_flickerHideInBuddyList")
                }
            };
            this.flickerClass = function(a) {
                o ? this.flickerClassShow(a) : this.flickerClassHide(a)
            };
            this.groupJumpUp = function(b) {
                z = !0;
                for (var c = 0; c < b.length; c++) {
                    var d = a.id("EQQ_Group_" + b[c]);
                    d && a.addClass(d, "EQQ_jumpUpInGroupList")
                }
            };
            this.groupJumpDown = function(b) {
                z = !1;
                for (var c = 0; c < b.length; c++) {
                    var d = a.id("EQQ_Group_" + b[c]);
                    d && a.removeClass(d, "EQQ_jumpUpInGroupList")
                }
            };
            this.groupJumpAvatar = function(a) {
                z ? this.groupJumpDown(a) : this.groupJumpUp(a)
            };
            this.recentJumpUp = function(b) {
                q = !0;
                for (var c = 0; c < b.length; c++) {
                    var d = a.id("EQQ_Recent_" + b[c]);
                    d && (a.addClass(d, "EQQ_jumpUpInBuddyList"), a.addClass(d, "EQQ_jumpUpInGroupList"))
                }
            };
            this.recentJumpDown = function(b) {
                q = !1;
                for (var c = 0; c < b.length; c++) {
                    var d = a.id("EQQ_Recent_" + b[c]);
                    d && (a.removeClass(d, "EQQ_jumpUpInBuddyList"), a.removeClass(d, "EQQ_jumpUpInGroupList"))
                }
            };
            this.recentJumpAvatar = function(a) {
                q ? this.recentJumpDown(a) : this.recentJumpUp(a)
            };
            this.moveBuddy = function(b) {
                var c = a.id("EQQ_Buddy_" + b.uin),
            d = a.id("EQQ_Class_" + b.classId + "_" + b.state);
                if (d && c) {
                    a.setStyle(d, "display", "block");
                    var f = c.parentNode;
                    d.insertBefore(c, d.firstChild);
                    var c = a.id("EQQ_BuddyList_AvatarContainer_" + b.uin),
                d = a.id("EQQ_BuddyList_RightContainer_" + b.uin),
                e = a.id("EQQ_RecentList_AvatarContainer_" + b.uin),
                h = a.id("EQQ_RecentList_RightContainer_" + b.uin);
                    if (c) c.title = EQQ.hash.onlineStatusText[b.state];
                    if (d) d.title = b.allName + " - " + EQQ.hash.onlineStatusText[b.state];
                    if (e) e.title = EQQ.hash.onlineStatusText[b.state];
                    if (h) h.title = b.allName + " - " + EQQ.hash.onlineStatusText[b.state];
                    f.childNodes.length == 0 && a.setStyle(f, "display", "none")
                }
                fa()
            };
            this.moveOnlineBuddy = function(b) {
                var c = a.id("EQQ_OnlineBuddy_" + b.uin);
                if ((b = a.id("EQQ_Class_" + EQQ.hash.userClassType.online + "_" + b.state)) && c) {
                    a.setStyle(b, "display", "block");
                    var d = c.parentNode;
                    b.insertBefore(c, b.firstChild);
                    d.childNodes.length == 0 && a.setStyle(d, "display", "none")
                }
                fa()
            };
            this.updateClientType = function(b) {
                var c = EQQ.hash.clientType[b.clientType],
            d = EQQ.hash.clientTypeText[b.clientType || "PC"],
            f = a.id("EQQ_BuddyList_ClientType_" + b.uin) || {},
            e = a.id("EQQ_BuddyList_ClientType_Title_" + b.uin) || {};
                f.className = "EQQ_BuddyList_ClientType_" + c;
                e.title = d;
                f = a.id("EQQ_OnlineBuddyList_ClientType_" + b.uin) || {};
                e = a.id("EQQ_OnlineBuddyList_ClientType_Title_" + b.uin) || {};
                f.className = "EQQ_BuddyList_ClientType_" + c;
                e.title = d
            };
            this.updateBuddyClassOnlineBuddy = function(b) {
                a.id("EQQ_Class_" + b.index + "_OnlineCounter").innerHTML = b.onlineCount
            };
            this.updateRecentState = function(b) {
                var c = a.id("EQQ_Recent_" + b.uin);
                if (c) {
                    c.className = "";
                    a.addClass(c, "EQQ_BuddyList_Buddy");
                    a.addClass(c, "EQQ_" + EQQ.hash.onlineStatus[b.state] + "Buddy");
                    var c = EQQ.hash.clientType[b.clientType],
                d = EQQ.hash.clientTypeText[b.clientType || "PC"],
                f = a.id("EQQ_RecentList_ClientType_" + b.uin) || {},
                b = a.id("EQQ_RecentList_ClientType_Title_" + b.uin) || {};
                    f.className = "EQQ_BuddyList_ClientType_" + c;
                    b.title = d
                }
            };
            this.updateBuddyClassCount = function(b) {
                a.id("EQQ_Class_" + b.index + "_Counter").innerHTML = b.count
            };
            this.updateStrangerClassOnlineCount = function(b) {
                a.id("EQQ_Class_" + EQQ.hash.userClassType.stranger + "_OnlineCounter").innerHTML = b
            };
            this.updateStrangerClassCount = function(b) {
                b = b.length;
                a.id("EQQ_Class_" + EQQ.hash.userClassType.stranger + "_Counter").innerHTML = b
            };
            this.setUserName = function(b) {
                var c = b.uin,
            d = a.id("EQQ_BuddyList_Nick_" + c),
            c = a.id("EQQ_BuddyList_RightContainer_" + c);
                if (d && c) d.innerHTML = b.htmlShowName,
            c.title = b.allName
            };
            this.setGroupMask = function(c) {
                F = c;
                switch (c) {
                    case "0":
                    case 0:
                        a.id("EQQ_ListBottom_maskButton").className = "accept";
                        a.id("EQQ_ListBottom_maskButton").childNodes[0].className = "accept_div";
                        break;
                    case "1":
                    case 1:
                        a.id("EQQ_ListBottom_maskButton").className = "accept";
                        a.id("EQQ_ListBottom_maskButton").childNodes[0].className = "accept_div";
                        break;
                    case "2":
                    case 2:
                        a.id("EQQ_ListBottom_maskButton").className = "mask";
                        a.id("EQQ_ListBottom_maskButton").childNodes[0].className = "mask_div";
                        break;
                    case "3":
                    case 3:
                        a.id("EQQ_ListBottom_maskButton").className = "mask",
                a.id("EQQ_ListBottom_maskButton").childNodes[0].className = "mask_div"
                }
                b.groupMaskPanel && b.setGroupMaskState(F)
            };
            this.showReLoginPanel = function(b) {
                this.EQQ_ReLoginButton_text.innerHTML = b;
                a.hide(this.EQQ_Logining_Container);
                a.hide(this.EQQ_Logining_feedback);
                a.show(this.EQQ_ReLoginPanel);
                a.hide(this.EQQ_LoginSuccess)
            };
            this.onReLoginButtonClick = function() {
                a.show(b.EQQ_Logining_Container);
                a.show(b.EQQ_Logining_feedback);
                a.hide(b.EQQ_ReLoginPanel);
                a.hide(b.EQQ_LoginSuccess);
                c.notifyObservers(b, "ReLogin")
            };
            this.createGroupList = function(a) {
                this.EQQ_groupListInner.innerHTML = "";
                for (var b = 0; b < a.length; b++) this.addGroup(a[b])
            };
            this.addGroup = function(d) {
                var e = '\t\t\t\t<div class="EQQ_GroupList_AvatarContainer" title="">\t\t\t\t\t<img id="EQQ_GroupList_Avatar_' + d.gid + '" class="EQQ_GroupList_Avatar" src="' + EQQ.getGroupAvatar(d.code) + '" />\t\t\t\t\t<div class="EQQ_GroupList_State" id="EQQ_GroupList_State_' + d.gid + '" title="\u7fa4\u5c4f\u853d"></div>\t\t\t\t</div>\t\t\t\t<div class="EQQ_GroupList_RightContainer">\t\t\t\t\t<div id="EQQ_GroupList_Name_' + d.gid + '"  title="<%=titleAllName%> - <%=titleTypeText%>" class="EQQ_GroupList_Name"><%=htmlShowName%></div>\t\t\t\t\t<div id="EQQ_GroupList_Bulletin_' + d.gid + '" title="" class="EQQ_GroupList_Bulletin"></div>\t\t\t\t</div>\t\t\t',
            e = f.string.template(e, d),
            h = a.node("div", {
                id: "EQQ_Group_" + d.gid,
                code: d.code,
                gid: d.gid,
                fileId: d.code,
                uid: "group_gid_" + d.code,
                from: "buddy",
                type: "gid"
            });
                h.innerHTML = e;
                this.EQQ_groupListInner.appendChild(h);
                f.platform.iPad || b.contactDragController.addDragClass(h);
                c.on(h, "mouseover", Z);
                c.on(h, "mouseout", $);
                c.on(h, "click",
            function(a) {
                ya.apply(this, [a]);
                pgvSendClick({
                    hottag: "web2qq.qqpanel.qun.sendmsg"
                });
                alloy.util.report2im("qqpanel|groups|sendmsg")
            });
                c.on(h, "contextmenu", La);
                a.addClass(h, "EQQ_GroupList_Group");
                A === "group" && ca() ? EQQ.Model.BuddyList.getGroupAnnouncement(d.code) : (e = a.id("EQQ_GroupList_Bulletin_" + d.gid), D.push({
                    gcode: d.code,
                    el: e
                }))
            };
            this.updateGroupMarkName = function(b) {
                var c = a.id("EQQ_GroupList_Name_" + b.gid);
                if (c) c.innerHTML = b.htmlShowName;
                if (c = a.id("EQQ_GroupRecentList_Name_" + b.gid)) c.innerHTML = b.htmlShowName
            };
            this.addDiscu = function(a) {
                a = this.getNewNode(a);
                this.EQQ_discuListInner.appendChild(a);
                c.on(a, "mouseover", Z);
                c.on(a, "mouseout", $);
                c.on(a, "click",
            function() {
                b.onDiscuListClick(this)
            });
                c.on(a, "contextmenu",
            function(a) {
                var c = this.getAttribute("did");
                b.onDiscuContextMenu(a, c)
            });
                this.hideReloadDiscuList();
                this.hideCreatePanel()
            };
            this.createDiscuList = function(a) {
                this.EQQ_discuListInner.innerHTML = "";
                a.length == 0 && this.showCreatePanel();
                for (var b in a) this.addDiscu(a[b])
            };
            this.createRecentList = function(a) {
                this.EQQ_recentList.innerHTML = "";
                for (var b = 0; b < a.length; b++) this.addRecent(a[b])
            };
            this.addRecent = function(d) {
                if (d.content) if (d.type == 0) {
                    var d = d.content,
                e = f.string.template('\t\t\t\t\t\t<div class="EQQ_RecentList_ClientType" uin="<%=uin%>" id="EQQ_BuddyList_ClientType_Title_<%=uin%>" title="' + EQQ.hash.clientTypeText[d.clientType || "PC"] + '">\t\t\t\t\t\t\t<div id="EQQ_RecentList_ClientType_<%=uin%>" class="EQQ_BuddyList_ClientType_' + EQQ.hash.clientType[d.clientType || "10000"] + '"></div>\t\t\t\t\t\t</div>\t\t\t\t\t\t<div id="EQQ_RecentList_AvatarContainer_<%=uin%>" class="EQQ_BuddyList_AvatarContainer" uin="<%=uin%>" title="' + EQQ.hash.onlineStatusText[d.state] + '">\t\t\t\t\t\t\t<img id="EQQ_RecentList_Avatar_<%=uin%>" class="EQQ_BuddyList_Avatar" src="' + alloy.CONST.CDN_URL + 'style/images/avatar_default_20_20.gif" />\t\t\t\t\t\t\t<div class="EQQ_BuddyList_State"></div>\t\t\t\t\t\t</div>\t\t\t\t\t\t<div id="EQQ_RecentList_RightContainer_<%=uin%>" class="EQQ_BuddyList_RightContainer">\t\t\t\t\t\t\t<div id="EQQ_BuddyList_Nick_<%=uin%>" class="EQQ_BuddyList_Nick"  title="<%=titleAllName%> - ' + EQQ.hash.onlineStatusText[d.state] + '"><%=htmlShowName%></div>                            <div id="EQQ_RecentList_Sign_<%=uin%>" title="" class="EQQ_BuddyList_Sign"></div>\t\t\t\t\t\t</div>\t\t\t\t\t', d),
                h = a.node("div", {
                    id: "EQQ_Recent_" + d.uin,
                    uin: d.uin,
                    uin: d.uin,
                    fileId: d.uin,
                    uid: "recent_uin_" + d.uin,
                    from: "buddy",
                    type: "uin"
                });
                    h.innerHTML = e;
                    this.EQQ_recentList.insertBefore(h, this.EQQ_recentList.firstChild);
                    c.on(h, "mouseover", Z);
                    c.on(h, "mouseout", $);
                    c.on(h, "click",
                function(a) {
                    ma.apply(this, [a]);
                    pgvSendClick({
                        hottag: "web2qq.qqpanel.recent.sendC2Cmsg"
                    });
                    alloy.util.report2im("qqpanel|recent|sendC2Cmsg")
                });
                    c.on(h, "contextmenu", Ka);
                    f.platform.iPad || b.contactDragController.addDragClass(h);
                    e = a.id("EQQ_RecentList_AvatarContainer_" + d.uin);
                    c.on(e, "mouseover", ha);
                    c.on(e, "mouseout", ia);
                    a.addClass(h, "EQQ_BuddyList_Buddy");
                    a.addClass(h, "EQQ_" + EQQ.hash.onlineStatus[d.state] + "Buddy");
                    e = a.id("EQQ_RecentList_Avatar_" + d.uin);
                    if (d.uin && e) e.src = EQQ.getUserAvatar(d.uin);
                    A === "recent" && da() ? EQQ.Model.BuddyList.getUserSignature(d.uin) : (e = a.id("EQQ_RecentList_Sign_" + d.uin), B.push({
                        uin: d.uin,
                        el: e
                    }))
                } else d.type == 1 ? (d = d.content, e = '\t\t\t\t\t<div class="EQQ_GroupList_AvatarContainer" title="">\t\t\t\t\t\t<img id="EQQ_GroupList_Avatar_' + d.gid + '" class="EQQ_GroupList_Avatar" src="' + EQQ.getGroupAvatar(d.code) + '" />\t\t\t\t\t\t<div class="EQQ_GroupList_State" id="EQQ_RecentList_State_' + d.gid + '" title="\u7fa4\u5c4f\u853d"></div>\t\t\t\t\t</div>\t\t\t\t\t<div class="EQQ_GroupList_RightContainer" title="<%=titleAllName%> - <%=titleTypeText%>">\t\t\t\t\t\t<div id="EQQ_GroupRecentList_Name_' + d.gid + '" class="EQQ_GroupList_Name"><%=htmlShowName%></div>                        <div id="EQQ_GroupRecentList_Bulletin_' + d.gid + '" title="" class="EQQ_GroupList_Bulletin"></div>\t\t\t\t\t</div>\t\t\t\t', e = f.string.template(e, d), h = a.node("div", {
                    id: "EQQ_Recent_" + d.gid,
                    code: d.code,
                    gid: d.gid,
                    fileId: d.code,
                    uid: "recent_gid_" + d.code,
                    from: "buddy",
                    type: "gid"
                }), h.innerHTML = e, this.EQQ_recentList.insertBefore(h, this.EQQ_recentList.firstChild), f.platform.iPad || b.contactDragController.addDragClass(h), c.on(h, "mouseover", Z), c.on(h, "mouseout", $), c.on(h, "click",
            function(a) {
                ya.apply(this, [a]);
                pgvSendClick({
                    hottag: "web2qq.qqpanel.recent.sendqunmsg"
                });
                alloy.util.report2im("qqpanel|recent|sendgroupsmsg")
            }), c.on(h, "contextmenu", Ma), a.addClass(h, "EQQ_GroupList_Group"), A === "recent" && da() ? EQQ.Model.BuddyList.getGroupAnnouncement(d.code) : (e = a.id("EQQ_GroupRecentList_Bulletin_" + d.gid), E.push({
                gcode: d.code,
                el: e
            }))) : d.type == 2 && (d = this.getNewNode(d.content, !0), this.EQQ_recentList.insertBefore(d, this.EQQ_recentList.firstChild), c.on(d, "mouseover", Z), c.on(d, "mouseout", $), c.on(d, "click",
            function() {
                b.onDiscuListClick(this)
            }), c.on(d, "contextmenu",
            function(a) {
                var c = this.getAttribute("did");
                b.onDiscuContextMenu(a, c)
            }))
            };
            this.removeRecentBuddy = function(b) {
                var d = a.id("EQQ_Recent_" + b.uin);
                if (d) {
                    c.off(d, "mouseover");
                    c.off(d, "mouseout");
                    c.off(d, "click");
                    c.off(d, "contextmenu");
                    if (b = a.id("EQQ_RecentList_AvatarContainer_" + b.uin)) c.off(b, "mouseover"),
                c.off(b, "mouseout");
                    d.parentNode && d.parentNode.removeChild(d)
                }
            };
            this.updateRecentByBuddy = function(b) {
                var c = a.id("EQQ_Recent_" + b.uin);
                c ? this.EQQ_recentList.insertBefore(c, this.EQQ_recentList.firstChild) : this.addRecent({
                    type: 0,
                    content: b
                })
            };
            this.updateRecentByGroup = function(b) {
                var c = a.id("EQQ_Recent_" + b.gid);
                c ? this.EQQ_recentList.insertBefore(c, this.EQQ_recentList.firstChild) : this.addRecent({
                    type: 1,
                    content: b
                })
            };
            this.updateRecentByDiscu = function(b) {
                var c = a.id("EQQ_Recent_" + b.did);
                c ? this.EQQ_recentList.insertBefore(c, this.EQQ_recentList.firstChild) : this.addRecent({
                    type: 2,
                    content: b
                })
            };
            this.setMode = function(b) {
                switch (b) {
                    case "master":
                        ga = va;
                        a.removeClass(this.EQQ_MyState, "EQQ_DisableMyStateSelect");
                        this.EQQ_MyState.title = "\u66f4\u6539\u5728\u7ebf\u72b6\u6001";
                        break;
                    case "slave":
                        ga = Ta,
                a.addClass(this.EQQ_MyState, "EQQ_DisableMyStateSelect"),
                this.EQQ_MyState.title = "WebQQ\u73b0\u5728\u5904\u4e8e\u8f85\u6a21\u5f0f\uff0c\u8bf7\u4ece\u5ba2\u6237\u7aefQQ\u4fee\u6539\u60a8\u7684\u5728\u7ebf\u72b6\u6001\u3002"
                }
            };
            this.toggleStatePanel = function(a) {
                this.statePanel && this.statePanel.isShow() ? this.hideStatePanel() : this.showStatePanel(a)
            };
            this.showStatePanel = function(b) {
                a.id("EQQ_StatePanel") || this.createStatePanelDom();
                if (b) {
                    var c = this.statePanel.getWidth(),
                d = this.statePanel.getHeight(),
                e = alloy.layout.getClientWidth(),
                f = alloy.layout.getClientHeight(),
                h = b[0],
                b = b[1];
                    h < 2 && (h = 2);
                    b < 2 && (b = 2);
                    h > e - c - 2 && (h = e - c - 2);
                    b > f - d - 2 && (b = f - d - 2);
                    this.statePanel.setXY(h, b)
                }
                this.statePanel.setZIndex(alloy.layout.getTopZIndex(3));
                this.statePanel.show();
                wa(alloy.sound.isMute())
            };
            this.hideStatePanel = function() {
                this.statePanel && this.statePanel.hide()
            };
            this.setSelfState = function(a) {
                c.notifyObservers(this, "SelfStateChange", a);
                this.updateSelfStateChange(a)
            };
            this.removeGroup = function(b) {
                var d = EQQ.Model.BuddyList.getGroupByCode(b),
            b = d.gid;
                f.out(d);
                var e = a.id("EQQ_Group_" + b);
                if (e && (c.off(e), e.parentNode)) d = e.parentNode,
            d.removeChild(e);
                f.out(e);
                if (b = a.id("EQQ_Recent_" + b)) if (c.off(b), b.parentNode) d = b.parentNode,
            d.removeChild(b);
                f.out(b)
            }
        };
            WebqCore.register("EQQ.View.MainPanel", f);
            var j;
            j = Jx().extend(function(g) {
                f.call(this, g);
                var b = this,
        a = g.dom,
        c = g.event;
                this.getHtml = function() {
                    return d.myPanel + '<div id="EQQ_MainPanel" class="EQQ_mainPanel">' + d.mainPanelHeader + g.string.template(d.mainPanelBody, {
                        searchReaultPanel: d.searchReaultPanelFlex,
                        buddyListBody: d.buddyListBodyFlex
                    }) + d.mainPanelFooter + "</div>"
                };
                this.viewQzone = function(a) {
                    qqweb.rpcService.sendGetFriendUin2(a, 2,
            function(a) {
                qqweb.portal.runApp("6", {
                    url: EQQ.CONST.QZONE_USER_SERVER_DOMAIN + a.result.account
                });
                qqweb.util.report2qqweb("contextmenu|contancts|qzone")
            });
                    return !0
                };
                this.sendQMail = function(a) {
                    qqweb.rpcService.sendGetFriendUin2(a, 3,
            function(a) {
                qqweb.portal.runApp("6", {
                    url: EQQ.getSendMailUrl(a.result.account)
                });
                qqweb.util.report2qqweb("contextmenu|contancts|mail")
            });
                    return !0
                };
                this.chatFromFlashMenu = function(a) {
                    c.notifyObservers(b, "StartChat", a);
                    qqweb.util.report2qqweb("contextmenu|contancts|sendmsg");
                    return !0
                };
                this.viewDetailFromFlashMenu = function(a) {
                    qqweb.portal.runApp("userDetails", a);
                    qqweb.util.report2qqweb("contextmenu|contancts|profile");
                    return !0
                };
                this.viewLogFromFlashMenu = function(a) {
                    qqweb.portal.runApp("chatLogViewer", a);
                    qqweb.util.report2qqweb("contextmenu|contancts|chats");
                    return !0
                };
                this.ManageFriendFromFlashMenu = function() {
                    qqweb.portal.runApp("5", {});
                    qqweb.util.report2qqweb("contextmenu|contancts|manage");
                    return !0
                };
                this.findFriendFromFlashMenu = function() {
                    qqweb.portal.runApp("buddyFinder", {});
                    qqweb.util.report2qqweb("contextmenu|contancts|add");
                    return !0
                };
                this.onAvatarMouseover = function(d, f) {
                    if (d && f) {
                        if (EQQ.avatarMouseoverTimer) clearTimeout(EQQ.avatarMouseoverTimer),
                EQQ.avatarMouseoverTimer = null;
                        var g = a.getClientXY(b.EQQ_buddyList);
                        g[0] -= 218;
                        g[1] += f.y;
                        b.showMiniCardPanel(d, g);
                        c.notifyObservers(b, "AvatarMouseover", d)
                    }
                };
                this.onFlexException = function() {
                    g.out("Flex-Exception");
                    b.flex = window.frames.iframe_fflist.document.getElementById("fflist");
                    b.ifFlexReady = !0;
                    c.notifyObservers(EQQ, "LoginFailure", {
                        text: "\u62c9\u53d6\u5931\u8d25"
                    })
                };
                this.buddyListReady = function() {
                    b.flex = window.frames.iframe_fflist.document.getElementById("fflist");
                    b.ifFlexReady = !0;
                    c.notifyObservers(b, "BuddyListReady");
                    this.setFlexBigHead(this.isBuddyListUseBigHead())
                };
                var j = function() {
                    b.hideMiniCardPanel()
                };
                this.onAvatarMouseout = function() {
                    EQQ.avatarMouseoverTimer = window.setTimeout(j, 500)
                };
                this.onBuddyListClick = function(a) {
                    c.notifyObservers(b, "StartChat", a)
                };
                this.showSearchResult = function(b) {
                    if (this.EQQ_SearchBox.value) {
                        var d = a.getRelativeXY(this.EQQ_SearchBox, this.EQQ_MainPanel);
                        a.setStyle(this.EQQ_SearchResultPanel_iframeWrap, "left", d[0] + "px");
                        a.setStyle(this.EQQ_SearchResultPanel_iframeWrap, "top", d[1] + 26 + "px");
                        a.show(this.EQQ_SearchResultPanel);
                        a.show(this.EQQ_SearchResultPanel_iframeWrap);
                        this.EQQ_SearchResultPanel.innerHTML = "";
                        if (b.length == 0) this.EQQ_SearchResultPanel.innerHTML = '<div class="EQQ_SearchResultNo">\u6ca1\u6709\u627e\u5230\u76f8\u5173\u597d\u53cb</div>';
                        else for (d = 0; d < b.length; d++) {
                            var f = b[d],
                    j = a.node("div");
                            a.setClass(j, "EQQ_SearchResultItem");
                            j.id = "EQQ_SearchResultItem_" + f.uin;
                            j.setAttribute("uin", f.uin);
                            j.innerHTML = f.htmlAllName;
                            j.title = f.allName;
                            this.EQQ_SearchResultPanel.appendChild(j);
                            d == 0 && a.setStyle(j, "backgroundColor", "#cbe7fc");
                            c.on(j, "mouseover", this.onSearchResultMouseover);
                            c.on(j, "mouseout", this.onSearchResultMouseout);
                            c.on(j, "mousedown", this.onSearchResultClick)
                        }
                        c.on(document, "mousedown", g.bind(this.hideSearchResult, this))
                    }
                };
                this.hideSearchResult = function() {
                    a.hide(this.EQQ_SearchResultPanel_iframeWrap);
                    c.off(document, "mousedown")
                };
                this.createBuddyClass = function() { };
                this.addBuddyClass = function(b, d) {
                    var f, j;
                    f = a.node("div", {
                        id: "EQQ_listClassHead_" + b.index,
                        classIndex: b.index
                    });
                    j = b.index == EQQ.hash.userClassType.online ? '                    <div class="EQQ_listClassHeadIcon">icon</div>                    <div class="EQQ_ClassList_RightContainer" title="<%=titleName%>">                        <%=htmlName%>[<span id="EQQ_Class_<%=index%>_OnlineCounter"><%=onlineCount%></span>]                    </div>                ' : '                    <div class="EQQ_listClassHeadIcon">icon</div>                    <div class="EQQ_ClassList_RightContainer" title="<%=titleName%>">                        <%=htmlName%> [<span id="EQQ_Class_<%=index%>_OnlineCounter"><%=onlineCount%></span>/<span id="EQQ_Class_<%=index%>_Counter"><%=count%></span>]                    </div>                ';
                    j = g.string.template(j, b);
                    f.innerHTML = j;
                    d ? this.EQQ_buddyList.insertBefore(f, d) : this.EQQ_buddyList.appendChild(f);
                    c.on(f, "click", onClassHeadElClick);
                    var i = a.node("div", {
                        id: "EQQ_listClassBody_" + b.index,
                        "class": "EQQ_listClassBody"
                    });
                    j = g.string.template('                <div id="EQQ_Class_<%=index%>_callme" class="EQQ_callmeBuddy"></div>                <div id="EQQ_Class_<%=index%>_online" class="EQQ_onlineBuddy"></div>                <div id="EQQ_Class_<%=index%>_busy" class="EQQ_busyBuddy"></div>                <div id="EQQ_Class_<%=index%>_away" class="EQQ_awayBuddy"></div>                <div id="EQQ_Class_<%=index%>_silent" class="EQQ_silentBuddy"></div>                <div id="EQQ_Class_<%=index%>_offline" class="EQQ_offlineBuddy"></div>            ', b);
                    i.innerHTML = j;
                    this.EQQ_buddyList.insertBefore(i, f.nextSibling);
                    this.collapsedClass(b.index)
                };
                this.showPullData = function() { };
                this.clearBuddyList = function() {
                    b.ifFlexReady && this.flex.clearBuddyList()
                };
                this.createBuddyList = function() { };
                this.collapsedClass = function(b) {
                    var c = a.id("EQQ_listClassHead_" + b),
            d = a.id("EQQ_listClassBody_" + b);
                    b == EQQ.hash.userClassType.online ? a.setClass(c, "EQQ_onlineClassHeadCollapsed") : a.setClass(c, "EQQ_listClassHeadCollapsed");
                    a.setStyle(d, "height", "0");
                    this.setClassExpandFlag(b, !1)
                };
                this.expandClass = function(c) {
                    var d = a.id("EQQ_listClassHead_" + c),
            f = a.id("EQQ_listClassBody_" + c);
                    c == EQQ.hash.userClassType.online ? a.setClass(d, "EQQ_onlineClassHeadExpand") : a.setClass(d, "EQQ_listClassHeadExpand");
                    a.setStyle(f, "height", "auto");
                    this.setClassExpandFlag(c, !0);
                    g.out("index: " + c);
                    b.loadBuddyListAvatar()
                };
                this.onBuddyStateChange = function(a) {
                    if (b.ifFlexReady) this.flex.onBuddyStateChange(a)
                };
                this.onOnlineBuddyChange = function(a) {
                    if (b.ifFlexReady) this.flex.onOnlineBuddyChange(a)
                };
                this.addBuddy = function(a) {
                    a = {
                        classId: a.classId,
                        uin: a.uin,
                        clientType: a.clientType,
                        state: a.state,
                        nick: a.nick
                    };
                    b.ifFlexReady && this.flex.addBuddy(a)
                };
                this.addOnlineBuddy = function(a) {
                    a = {
                        uin: a.uin,
                        clientType: a.clientType,
                        state: a.state,
                        nick: a.nick
                    };
                    b.ifFlexReady && this.flex.addOnlineBuddy(a)
                };
                this.removeOnlineBuddy = function(a) {
                    b.ifFlexReady && this.flex.removeOnlineBuddy(a.uin)
                };
                this.updateOnlineBuddyClass = function(a) {
                    b.ifFlexReady && this.flex.updateOnlineBuddyClass(a.length)
                };
                this.flexStartJump = function(a) {
                    b.ifFlexReady && this.flex.startjump(a)
                };
                this.flexStopJump = function(a) {
                    b.ifFlexReady && this.flex.stopjump(a)
                };
                this.jumpUp = function() { };
                this.jumpDown = function() { };
                this.jumpAvatar = function() { };
                this.flickerClassHide = function() { };
                this.flickerClassShow = function() { };
                this.flickerClass = function() { };
                this.moveBuddy = function(a) {
                    a = {
                        uin: a.uin,
                        state: a.state
                    };
                    b.ifFlexReady && this.flex.moveBuddy(a)
                };
                this.moveOnlineBuddy = function(a) {
                    a = {
                        uin: a.uin,
                        state: a.state
                    };
                    b.ifFlexReady && this.flex.moveOnlineBuddy(a)
                };
                this.updateClientType = function(a) {
                    a = {
                        uin: a.uin,
                        clientType: a.clientType
                    };
                    b.ifFlexReady && this.flex.updateClientType(a)
                };
                this.updateBuddyClassOnlineBuddy = function(a) {
                    a = {
                        index: a.index,
                        onlineCount: a.onlineCount
                    };
                    b.ifFlexReady && this.flex.updateBuddyClassOnlineBuddy(a)
                };
                this.updateBuddyClassCount = function(a) {
                    a = {
                        index: a.index,
                        count: a.count
                    };
                    b.ifFlexReady && this.flex.updateBuddyClassCount(a)
                };
                this.updateStrangerClassOnlineCount = function(a) {
                    b.ifFlexReady && this.flex.updateStrangerClassOnlineCount(a)
                };
                this.updateStrangerClassCount = function(a) {
                    b.ifFlexReady && this.flex.updateStrangerClassCount(a.length)
                };
                this.setUserName = function(a) {
                    a.markName && (a = {
                        uin: a.uin,
                        nick: a.markName
                    },
            b.ifFlexReady ? this.flex.setUserName(a) : recent.type == 2 && (a = this.getNewNode(recent.content, !0), this.EQQ_recentList.insertBefore(a, this.EQQ_recentList.firstChild), c.on(a, "mouseover", onListMouseover), c.on(a, "mouseout", onListMouseout), c.on(a, "click",
            function() {
                b.onDiscuListClick(this)
            }), c.on(a, "contextmenu",
            function(a) {
                var c = this.getAttribute("did");
                b.onDiscuContextMenu(a, c)
            })))
                };
                this.setUseBigHead = function(a) {
                    this.setBigHead("single", a)
                };
                this.setFlexBigHead = function(a) {
                    a ? this.flex.viewBigHead() : this.flex.viewSmallHead()
                }
            },
    f);
            WebqCore.register("EQQ.View.MainPanelFlex", j)
        })(); (function() {
            WebqCore.register("EQQ.Presenter.MainPanel",
    function(d) {
        var g = this,
        f = d.event,
        j = !1,
        t = [],
        b = [],
        a = [],
        c = [],
        p = [],
        m = !0,
        z = !1,
        q = !1,
        o = !1,
        i = !1;
        this.init = function() {
            j = !1;
            t = [];
            b = [];
            a = [];
            c = [];
            p = [];
            m = !0;
            i = o = q = z = !1;
            this.View = EQQ.View.MainPanel;
            if (d.browser.ie && d.browser.ie == 7) {
                var h = d.GetSwfVer();
                h != -1 ? (h = h.split(" ")[1].split(","), parseInt(h[0]) >= 10 ? (o = !0, this.View = EQQ.View.MainPanelFlex, f.addObserver(EQQ.Model.ChatMsg, "flexStartJump", d.bind(this.onFlexStartJump, this)), f.addObserver(EQQ.Model.ChatMsg, "flexStopJump", d.bind(this.onFlexStopJump, this))) : r()) : r()
            }
            this.View.createDom(this.getContainer());
            f.addObserver(EQQ, "CloseWebQQ", d.bind(this.onCloseWebQQ, this));
            f.addObserver(EQQ, "SelfOffline", d.bind(this.onSelfOffline, this));
            f.addObserver(EQQ, "LoginSuccess", w);
            f.addObserver(EQQ, "LoginFailure", d.bind(x, this));
            f.addObserver(EQQ, "PtwebqqFail", d.bind(C, this));
            f.addObserver(EQQ.RPCService, "ChangeStatusSuccess", d.bind(u, this));
            f.addObserver(alloy.portal, "UserAvatarChanged", d.bind(this.onUserAvatarChanged, this));
            f.addObserver(alloy.portal, "selfInfoReady", d.bind(this.onSelfInfoReady, this));
            f.addObserver(alloy.rpcService, "SetBuddySignatureSuccess", d.bind(this.onSetBuddySignatureSuccess, this));
            f.addObserver(alloy.rpcService, "SetBuddySignatureError", d.bind(this.onSetBuddySignatureError, this));
            f.addObserver(EQQ.Model.BuddyList, "SelfInfoChange", d.bind(this.onSelfInfoChange, this));
            f.addObserver(EQQ.Model.BuddyList, "SelfStateChange", d.bind(this.updateSelfStateChange, this));
            f.addObserver(EQQ.Model.BuddyList, "SelfSignatureChange", d.bind(this.handleSelfSignatureChange, this));
            f.addObserver(EQQ.Model.BuddyList, "UserSignatureChange", k);
            f.addObserver(EQQ.Model.BuddyList, "UserQQLevelChange", D);
            f.addObserver(EQQ.Model.BuddyList, "GroupAnnouncementChange", B);
            f.addObserver(EQQ.Model.BuddyList, "LoginFail", d.bind(this.onLoginFail, this));
            f.addObserver(EQQ.Model.BuddyList, "GetUserInfoSuccess", d.bind(this.onGetUserInfoSuccess, this));
            f.addObserver(EQQ.Model.BuddyList, "BuddyClassChange", d.bind(this.onBuddyClassChange, this));
            f.addObserver(EQQ.Model.BuddyList, "AllClassOnlineBuddyReady", d.bind(this.onAllClassOnlineBuddyReady, this));
            f.addObserver(this.View, "SendGetRecentList", s);
            f.addObserver(EQQ.Model.BuddyList, "GroupNameChange", this.onOnGroupNameChange);
            f.addObserver(EQQ.Model.BuddyList, "AddBuddy", d.bind(this.onAddANewBuddy, this));
            f.addObserver(EQQ.Model.BuddyList, "RemoveBuddy", d.bind(this.onRemoveBuddy, this));
            f.addObserver(EQQ.Model.BuddyList, "GroupListChange", d.bind(this.onGroupListChange, this));
            f.addObserver(EQQ.Model.BuddyList, "AddNewGroupToList", d.bind(this.onAddNewGroupToList, this));
            f.addObserver(EQQ.Model.BuddyList, "GroupMaskChange", d.bind(this.onGroupMaskChange, this));
            f.addObserver(EQQ.Model.BuddyList, "SingleGroupMaskChange", d.bind(this.onSingleGroupMaskChange, this));
            f.addObserver(EQQ.Model.BuddyList, "RecentListChange", d.bind(this.onRecentListChange, this));
            f.addObserver(EQQ.Model.ChatMsg, "NewStranger", d.bind(this.onNewStranger, this));
            f.addObserver(EQQ.Model.ChatMsg, "MessageBoxUserListChange", d.bind(this.onMessageBoxUserListChange, this));
            f.addObserver(EQQ.Model.ChatMsg, "MessageBoxGroupListChange", d.bind(this.onMessageBoxGroupListChange, this));
            f.addObserver(EQQ.Model.ChatMsg, "MessageListChange", d.bind(this.onMessageListChange, this));
            f.addObserver(EQQ.Model.ChatMsg, "GroupMessageListChange", d.bind(this.onGroupMessageListChange, this));
            f.addObserver(this.View, "StartChat", G);
            f.addObserver(this.View, "AskVideo", e);
            f.addObserver(this.View, "StartGroupChat", n);
            f.addObserver(this.View, "StartDiscuChat", Q);
            f.addObserver(this.View, "SelfStateChange", d.bind(this.onViewSelfStateChange, this));
            f.addObserver(this.View, "SetGroupMaskState", K);
            f.addObserver(this.View, "AddPObservers", d.bind(this.onAddPObservers, this));
            f.addObserver(this.View, "ExitPortal", d.bind(this.onExitPortal, this));
            f.addObserver(this.View, "CloseWebQQ", d.bind(y, this));
            f.addObserver(this.View, "MinMainPanel", d.bind(A, this));
            f.addObserver(this.View, "ReLogin", d.bind(H, this));
            f.addObserver(this.View, "Search", d.bind(this.onSearch, this));
            f.addObserver(this.View, "BuddyListReady", d.bind(this.onBuddyListDomReady, this));
            f.addObserver(this.View, "CloseYellowTipsFinish", d.bind(this.onCloseYellowTipsFinish, this));
            f.addObserver(this.View, "MiniCardShow", E);
            f.addObserver(EQQ.Model.BuddyList, "DiscuListChange", d.bind(this.onDiscuListChange, this));
            f.addObserver(EQQ.Model.BuddyList, "AddNewDiscuToList", d.bind(this.onAddNewDiscuToList, this));
            f.addObserver(EQQ.Model.BuddyList, "ToStartDiscuChat", Q);
            f.addObserver(EQQ.Model.BuddyList, "ModifyDiscuTopicSuccess", O);
            f.addObserver(EQQ, "QuitDiscu", l);
            f.addObserver(EQQ.Model.BuddyList, "QuitDiscuSuccess", P);
            f.addObserver(EQQ.Model.ChatMsg, "MessageBoxDiscuListChange", d.bind(this.onMessageBoxDiscuListChange, this));
            f.addObserver(EQQ.Model.BuddyList, "SingleDiscuMaskChange", R);
            f.addObserver(EQQ.Model.ChatMsg, "ServerDiscuInfochange", J);
            f.addObserver(EQQ.Model.BuddyList, "DiscuInfoChange", O);
            f.addObserver(EQQ.Model.ChatMsg, "DiscuMessageListChange", d.bind(this.onDiscuMessageListChange, this));
            f.addObserver(EQQ, "GetDiscuListFail", T);
            this.View.init();
            this.View.setNoneFlashStyle && this.View.setNoneFlashStyle()
        };
        var r = function() {
            alloy.layout.getWindowManager().createWindow("Window", {
                title: "\u6e29\u99a8\u63d0\u793a",
                modeSwitch: !0,
                dragable: !0,
                resize: !0,
                width: 400,
                height: 50,
                hasCloseButton: !0,
                hasOkButton: !0,
                isSetCentered: !0
            }).setHtml('<div style="width:100%; height:100%; background-color:#FFFFFF; line-height:60px;text-align:center; vertical-align:middle;">\t\t\t\t\t\t\u68c0\u6d4b\u5230\u60a8\u4e3aIE7\u5185\u6838\u7528\u6237\uff0c\u8bf7\u5b89\u88c5\u6700\u65b0<a target="_blank" href="http://get.adobe.com/flashplayer">Flash\u7248\u672c</a>\uff0c\u83b7\u5f97\u66f4\u597d\u4f53\u9a8c\uff01\t\t\t\t\t   </div>')
        };
        this.onAddPObservers = function() {
            m = !1;
            f.addObserver(EQQ.Model.BuddyList, "BuddyListChange", d.bind(this.onBuddyListChange, this));
            f.addObserver(EQQ.Model.BuddyList, "BuddyStateChange", d.bind(this.onBuddyStateChange, this));
            f.addObserver(EQQ.Model.BuddyList, "OnlineBuddyChange", d.bind(this.onOnlineBuddyChange, this))
        };
        this.onBuddyListDomReady = function() {
            if (!z) {
                if (m) this.onAddPObservers();
                f.addObserver(EQQ.Model.BuddyList, "UserNameChange", d.bind(this.onUserNameChange, this));
                z = !0
            }
            q = !0
        };
        this.getContainer = function() {
            return EQQ.panel.mainPanel
        };
        var k = function(a) {
            g.View.miniCardPanel && (d.out("onUserSignatureChange 33:" + a.uin), g.View.miniCardPanel.setSignature(a));
            g.View.updateBuddySignature(a)
        },
        D = function(a) {
            g.View.miniCardPanel && (d.out("onUserQQLevelChange 33:" + a.uin), g.View.miniCardPanel.setQQLevel(a))
        },
        B = function(a) {
            g.View.updateGroupAnnouncement(a)
        },
        E = function(a) {
            a && (EQQ.Model.BuddyList.getUserSignature(a.uin), EQQ.Model.BuddyList.sendGetQQLevel(a.uin))
        };
        this.showYellowTips = function() {
            this.View.showYellowTips()
        };
        this.hideYellowTips = function() {
            this.View.hideYellowTips()
        };
        this.onCloseYellowTipsFinish = function() {
            this.setCookieTips("hide")
        };
        this.getCookieTips = function() {
            return d.cookie.get("is_close_tips", EQQ.CONST.MAIN_DOMAIN)
        };
        this.setCookieTips = function(a) {
            d.cookie.set("is_close_tips", a, EQQ.CONST.MAIN_DOMAIN, null, 120)
        };
        this.onSearch = function(a) {
            this.View.showSearchResult(EQQ.Model.BuddyList.searchBuddy(a, 5))
        };
        this.showMiniCardPanel = function(a, b) {
            this.View.showMiniCardPanel(a, b)
        };
        this.hideMiniCardPanel = function() {
            this.View.hideMiniCardPanel()
        };
        this.onLoginFail = function() {
            alloy.layout.alert("\u767b\u5f55\u5931\u8d25\uff0c\u8bf7\u7a0d\u540e\u91cd\u8bd5")
        };
        this.onSelfInfoChange = function(a) {
            this.View.updateSelfInfoChange(a)
        };
        this.onSelfInfoReady = function(a) {
            this.View.updateSelfInfoChange(a)
        };
        this.onSetBuddySignatureSuccess = function(a) {
            EQQ.Model.BuddyList.getSelf().setSignature(a);
            this.handleSelfSignatureChange({
                signature: a
            });
            alloy.util.report2im("personalinfo|personalmsg|personalmsgsucceed")
        };
        this.onSetBuddySignatureError = function() {
            alloy.layout.alert("\u7b7e\u540d\u4fee\u6539\u5931\u8d25")
        };
        this.onUserAvatarChanged = function() {
            this.View.updateSelftAvatar()
        };
        this.onOnGroupNameChange = function(a) {
            typeof g.View != "undefined" && g.View.updateGroupMarkName(a)
        };
        this.updateSelfStateChange = function(a) {
            this.View.updateSelfStateChange(a)
        };
        this.handleSelfSignatureChange = function(a) {
            this.View.updateSelfSignatureChange(a)
        };
        this.onSelfOffline = function(a) {
            var b = EQQ.Model.BuddyList.getSelf();
            q = i = !1;
            EQQ.stopPoll();
            if (b) b.oldState = b.state,
            b.state = "offline";
            this.updateSelfStateChange("offline");
            a.action == "relogin" ? F(a.message) : EQQ.showEQQtips({
                title: "\u8fde\u63a5\u4e2d\u65ad",
                content: a.message,
                callback: function() {
                    EQQ.reLogin()
                }
            })
        };
        var w = function() { },
        x = function() {
            this.updateSelfStateChange("offline")
        },
        C = function() {
            this.updateSelfStateChange("offline")
        },
        F = function(a) {
            EQQ.hideEQQtips();
            alloy.layout.showLoginWindow("eqq", !0, null, a)
        },
        u = function(a) {
            var b = EQQ.Model.BuddyList.getSelf();
            b && (b.state = a)
        };
        this.onBuddyClassChange = function(a) {
            this.clearBuddyList();
            this.View.createBuddyClass(a);
            this.View.hideLogin()
        };
        this.onAllClassOnlineBuddyReady = function() {
            i || (i = !0, this.onBuddyClassListReady())
        };
        this.onBuddyClassListReady = function() {
            EQQ.loginEnd = (new Date).getTime();
            var a = EQQ.loginEnd - EQQ.loginStart;
            a /= 1E3;
            d.out("time: " + a)
        };
        this.onBuddyListChange = function(a) {
            !q && !o && (this.updateAllBuddyClassCount(EQQ.Model.BuddyList.getClassList()), this.createBuddyList(a))
        };
        this.onRemoveBuddy = function(a) {
            o || this.View.removeBuddy(a) && this.View.updateBuddyClassCount(EQQ.Model.BuddyList.getClassById(a.classId));
            this.View.removeRecentBuddy(a)
        };
        this.onGroupListChange = function(a) {
            this.View.createGroupList(a)
        };
        this.onAddNewGroupToList = function(a) {
            this.View.addGroup(a)
        };
        this.onAddANewBuddy = function(a) {
            var b = a.user,
            c = a.newstate;
            this.View.addBuddy(b);
            this.View.updateBuddyClassCount(EQQ.Model.BuddyList.getClassById(b.classId));
            a.markname && EQQ.Model.BuddyList.getBuddyByUin(b.uin).setMarkName(a.markname);
            f.notifyObservers(EQQ.Model.BuddyList, "BuddyStatusChange", c)
        };
        this.onRecentListChange = function(a) {
            for (var b = [], c = a.length - 1; c >= 0; c--) {
                if (a[c].type == 0) a[c].content = EQQ.Model.BuddyList.getBuddyByUin(a[c].uin);
                else if (a[c].type == 1) a[c].content = EQQ.Model.BuddyList.getGroupByGid(a[c].uin);
                else if (a[c].type == 2) a[c].content = EQQ.Model.BuddyList.getDiscuById(a[c].uin);
                b.push(a[c])
            }
            this.View.createRecentList(b)
        };
        this.onUserNameChange = function(a) {
            this.View.setUserName(a)
        };
        this.onGroupMaskChange = function(a) {
            for (var b = EQQ.Model.BuddyList.getGroupList(), c = 0; c < b.length; c++) {
                var d = b[c],
                e = EQQ.Model.BuddyList.isGroupPrompt(d.gid);
                this.View.setGroupListMaskState(d.gid, e)
            }
            this.View.setGroupMask(a)
        };
        this.onSingleGroupMaskChange = function(a) {
            var b = EQQ.Model.BuddyList.isGroupPrompt(a.gid);
            this.View.setGroupListMaskState(a.gid, b)
        };
        this.onGetUserInfoSuccess = function() { };
        this.onNewStranger = function(a) {
            var b = EQQ.Model.BuddyList.getStrangerList();
            this.View.updateStrangerClassOnlineCount(b.length);
            this.View.updateStrangerClassCount(b);
            this.View.addBuddy(a)
        };
        this.updateAllBuddyClassCount = function(a) {
            for (var b = 0; b < a.length; b++) this.updateBuddyClassCount(a[b])
        };
        this.updateBuddyClassCount = function(a) {
            this.View.updateBuddyClassCount(a)
        };
        this.createBuddyList = function(a) {
            this.View.createBuddyList(a)
        };
        this.updateRecentByBuddy = function(a) {
            this.View.updateRecentByBuddy(a)
        };
        this.updateRecentByGroup = function(a) {
            this.View.updateRecentByGroup(a)
        };
        this.updateRecentByDiscu = function(a) {
            this.View.updateRecentByDiscu(a)
        };
        this.onBuddyStateChange = function(a) {
            o ? q && (a = EQQ.Model.BuddyList.getUserByUin(a), this.View.onBuddyStateChange({
                uin: a.uin,
                client_type: a.clientType,
                state: a.state,
                nick: a.nick
            })) : (a = EQQ.Model.BuddyList.getUserByUin(a), this.View.moveBuddy(a), this.View.moveOnlineBuddy(a), this.View.updateClientType(a), this.View.updateRecentState(a), this.View.miniCardPanel && this.View.miniCardPanel.setClientType(a))
        };
        this.onOnlineBuddyChange = function(a) {
            if (o) {
                if (q) {
                    var b = EQQ.Model.BuddyList.getUserByUin(a);
                    this.View.onOnlineBuddyChange({
                        uin: b.uin,
                        client_type: b.clientType,
                        state: b.state,
                        nick: b.showName
                    })
                }
            } else {
                var b = EQQ.Model.BuddyList.getUserByUin(a),
                a = EQQ.Model.BuddyList.getClassByUin(a),
                c = EQQ.hash.onlineStatus.offline,
                d = EQQ.Model.BuddyList.getOnlineBuddy();
                this.View.updateBuddyClassOnlineBuddy(a);
                this.View.updateOnlineBuddyClass(d);
                b.state == c ? this.View.removeOnlineBuddy(b) : this.View.addOnlineBuddy(b)
            }
        };
        this.onFlexStartJump = function(a) {
            this.View.flexStartJump(a)
        };
        this.onFlexStopJump = function(a) {
            this.View.flexStopJump(a)
        };
        this.onMessageBoxUserListChange = function(c) {
            EQQ.Model.BuddyList.getSelf();
            var d = typeof EQQ.Presenter.TaskBar != "undefined" ? EQQ.Presenter.TaskBar.getCurrentTaskUin() : !1;
            this.View.jumpDown(b);
            this.View.flickerClassShow(a);
            t = [];
            b = [];
            a = [];
            for (var e = 0; e < c.length; e++) d != c[e].from_uin && (t.push(c[e].from_uin), EQQ.Model.BuddyList.getSelfState() == "callme" && G(c[e].from_uin));
            t.length !== 0 && (EQQ.addNeedBeat2("mainPanel"), f.addObserver(EQQ, "NotifyBeat_250", I))
        };
        this.onMessageBoxGroupListChange = function(a) {
            EQQ.Model.BuddyList.getSelf();
            var b;
            try {
                b = EQQ.Presenter.TaskBar.getCurrentTaskUin()
            } catch (d) { }
            this.View.jumpDown(c);
            c = [];
            for (var e = 0; e < a.length; e++) b != a[e].from_uin && EQQ.Model.BuddyList.isGroupPrompt(a[e].from_uin) && c.push(a[e].from_uin),
            EQQ.Model.BuddyList.getSelfState() == "callme" && EQQ.Model.BuddyList.isGroupPrompt(a[e].from_uin) && n(a[e].group_code);
            c.length !== 0 && (EQQ.addNeedBeat2("mainPanel"), f.addObserver(EQQ, "NotifyBeat_250", I))
        };
        this.onMessageListChange = function(a) {
            (a = EQQ.Model.BuddyList.getBuddyByUin(a.uin)) && this.View.updateRecentByBuddy(a)
        };
        this.onGroupMessageListChange = function(a) {
            (a = EQQ.Model.BuddyList.getGroupByGid(a.gid)) && this.View.updateRecentByGroup(a)
        };
        this.onDiscuMessageListChange = function(a) {
            (a = EQQ.Model.BuddyList.getDiscuById(a.did)) && this.View.updateRecentByDiscu(a)
        };
        var s = function() {
            EQQ.Model.BuddyList.sendGetRecentList()()
        },
        K = function(a) {
            EQQ.Model.BuddyList.sendChangeGroupMask({
                type: "global",
                uin: EQQ.Model.BuddyList.getSelfUin(),
                mask: a
            })
        },
        G = function(a) {
            EQQ.handleNotification(a, "single") || WebqCore.api.call(["chat", ["single", a]])
        },
        e = function(a) {
            a = a.uin;
            if (!EQQ.Model.ChatMsg.uinToVideo) EQQ.Model.ChatMsg.uinToVideo = [];
            EQQ.Model.ChatMsg.uinToVideo[a] = {};
            f.notifyObservers(g, "AskVideo", {
                uin: a
            })
        },
        n = function(a) {
            var b = EQQ.Model.BuddyList.getGroupByCode(a).gid;
            EQQ.handleNotification(b, "group") || WebqCore.api.call(["chat", ["group", a]])
        };
        this.collapsedAllClass = function() {
            for (var a = EQQ.Model.BuddyList.getClassList(), b = 0; b < a.length; b++) this.View.collapsedClass(a[b].index)
        };
        var y = function() {
            EQQ.exit()
        },
        A = function() {
            this.hide()
        },
        H = function() {
            EQQ.reLogin()
        };
        this.onExitPortal = function() {
            alloy.portal.exit()
        };
        this.onCloseWebQQ = function() {
            q = i = !1;
            this.hide();
            this.View.showLogin()
        };
        this.clearBuddyList = function() {
            this.View.clearBuddyList()
        };
        this.showLogin = function() {
            this.View.showLogin()
        };
        this.show = function() {
            j = !0;
            this.View.show()
        };
        this.hide = function() {
            j = !1;
            this.View.hide()
        };
        this.toggleShow = function() {
            j ? this.hide() : this.show()
        };
        this.showReLoginPanel = function(a) {
            this.View.showReLoginPanel(a)
        };
        var I = function() {
            b = [];
            a = [];
            var e = t.concat(c, p);
            e.length === 0 && (f.removeObserver(EQQ, "NotifyBeat_250", I), EQQ.removeNeedBeat2("mainPanel"));
            for (var i = 0; i < t.length; i++) {
                var j = t[i],
                k = EQQ.Model.BuddyList.getClassIdByUin(j);
                g.View.getClassExpandFlag(k) ? b.push(j) : d.array.indexOf(a, k) == -1 && a.push(k)
            }
            b.length > 0 && g.View.jumpAvatar(b);
            a.length > 0 && g.View.flickerClass(a);
            c.length > 0 && g.View.groupJumpAvatar(c);
            e.length > 0 && g.View.recentJumpAvatar(e);
            p.length > 0 && g.View.discuJumpAvatar(p)
        };
        this.onViewSelfStateChange = function(a) {
            var b = "offline",
            c = EQQ.Model.BuddyList.getSelf();
            if (c) b = c.state;
            d.out("==onViewSelfStateChange, self: " + a + ", old: " + b);
            b == "offline" && a != "offline" ? EQQ.login(a) : EQQ.Model.BuddyList.sendChangeStatus(a);
            a == "offline" && (q = i = !1, EQQ.stopPoll())
        };
        this.removeGroup = function(a) {
            g.View.removeGroup(a);
            EQQ.Model.BuddyList.removeGroup(a)
        };
        this.removeDiscu = function(a) {
            g.View.removeDiscu(a)
        };
        var Q = function(a) {
            EQQ.handleNotification(a, "discu") || WebqCore.api.call(["chat", ["discu", a]])
        };
        this.onDiscuListChange = function(a) {
            this.View.createDiscuList(a)
        };
        this.onAddNewDiscuToList = function(a) {
            this.View.addDiscu(a)
        };
        var O = function(a) {
            g.View.updateDiscuName(a)
        },
        l = function(a) {
            EQQ.Model.BuddyList.sendQuitDisc(a)
        },
        P = function(a) {
            g.removeDiscu(a.did)
        };
        this.onMessageBoxDiscuListChange = function(a) {
            EQQ.Model.BuddyList.getSelf();
            var b = "";
            try {
                b = EQQ.Presenter.TaskBar.getCurrentTaskUin()
            } catch (c) { }
            this.View.discuJumpDown(p);
            p = [];
            for (var d = 0; d < a.length; d++) {
                var e = a[d];
                b != e.did && EQQ.Model.BuddyList.isDiscuPrompt(e.did) && p.push(e.did);
                EQQ.Model.BuddyList.getSelfState() == "callme" && EQQ.Model.BuddyList.isDiscuPrompt(e.did) && Q(e.did)
            }
            p.length !== 0 && (EQQ.addNeedBeat2("mainPanel"), f.addObserver(EQQ, "NotifyBeat_250", I))
        };
        var R = function(a) {
            g.View.setDiscuListMaskState(a.did, a.mask)
        },
        J = function(a) {
            EQQ.Model.BuddyList.refreshDiscuInfo(a.did)
        },
        T = function() {
            g.View.showReloadDiscuList()
        };
        this.saveBigHeadSetting = function(a) {
            alloy.config.configList.useBigHead = a;
            alloy.rpcService.sendSetConfig({
                data: {
                    r: {
                        appid: 50,
                        value: {
                            useBigHead: a
                        }
                    }
                }
            })
        }
    })
        })();

抱歉!评论已关闭.