Ejemplo n.º 1
0
        public override QQHttpRequest OnBuildRequest()
        {
            IHttpService httpService = Context.GetSerivce <IHttpService>(QQServiceType.HTTP);
            QQSession    session     = Context.Session;
            Random       rand        = new Random();

            if (session.ClientId == 0)
            {
                session.ClientId = new Random().Next(1000000, 9999999); //random??
            }

            JObject json = new JObject();

            json.Add("ptwebqq", httpService.GetCookie("ptwebqq", QQConstants.URL_CHANNEL_LOGIN).Value);
            json.Add("clientid", session.ClientId.ToString());
            json.Add("psessionid", session.SessionId);
            json.Add("status", _status.Value);
            json.Add("passwd_sig", "");
            QQHttpRequest req = CreateHttpRequest("POST", QQConstants.URL_CHANNEL_LOGIN);

            req.AddPostValue("r", JsonConvert.SerializeObject(json));
            req.AddPostValue("clientid", session.ClientId + "");
            req.AddPostValue("psessionid", session.SessionId ?? "null");
            req.AddHeader("Referer", QQConstants.REFFER);
            return(req);
        }
Ejemplo n.º 2
0
        public override QQHttpRequest OnBuildRequest()
        {
/*
 *          retype:1 app:EQQ
 *          itemlist:{"groupmask":{"321105219":"1","1638195794":"0","cAll":0,"idx":1075,"port":37883}}
 *          vfwebqq:8b26c442e239630f250e1e74d135fd85ab78c38e7b8da1c95a2d1d560bdebd2691443df19d87e70d
 */
            QQStore       store   = Context.Store;
            QQSession     session = Context.Session;
            QQHttpRequest req     = CreateHttpRequest("POST", QQConstants.URL_GROUP_MESSAGE_FILTER);

            req.AddPostValue("retype", "1");    // 群???
            req.AddPostValue("app", "EQQ");

            JObject groupmask = new JObject();

            groupmask.Add("cAll", 0);
            groupmask.Add("idx", session.Index);
            groupmask.Add("port", session.Port);
            foreach (QQGroup g in store.GetGroupList())
            {
                if (g.Gin > 0)
                {
                    groupmask.Add(g.Gin + "", g.Mask + "");
                }
            }
            JObject itemlist = new JObject();

            itemlist.Add("groupmask", groupmask);
            req.AddPostValue("itemlist", itemlist.ToString());
            req.AddPostValue("vfwebqq", Context.Session.Vfwebqq);
            return(req);
        }
Ejemplo n.º 3
0
        public override QQHttpRequest OnBuildRequest()
        {
            // r:{"to":2982077931,"face":0,"content":"[\"123\",[\"face\",1],\"456\",[\"face\",0],\"\",\"\\n【提示:此用户正在使用Q+ Web:http://web.qq.com/】\",[\"font\",{\"name\":\"微软雅黑\",\"size\":\"11\",\"style\":[0,0,0],\"color\":\"ffcc99\"}]]","msg_id":91310001,"clientid":"74131454","psessionid":"8368046764001e636f6e6e7365727665725f77656271714031302e3133332e34312e3230320000230700001f01026e04002aafd23f6d0000000a40484a526f4866467a476d00000028d954c71693cd99ae8c0c64b651519e88f55ce5075140346da7d957f3abefb51d0becc25c425d7cf5"}
            // r:{"group_uin":3408869879,"content":"[\"群消息发送测试\",[\"face\",13],\"\",\"\\n【提示:此用户正在使用Q+ Web:http://web.qq.com/】\",[\"font\",{\"name\":\"微软雅黑\",\"size\":\"11\",\"style\":[0,0,0],\"color\":\"ffcc99\"}]]","msg_id":91310002,"clientid":"74131454","psessionid":"8368046764001e636f6e6e7365727665725f77656271714031302e3133332e34312e3230320000230700001f01026e04002aafd23f6d0000000a40484a526f4866467a476d00000028d954c71693cd99ae8c0c64b651519e88f55ce5075140346da7d957f3abefb51d0becc25c425d7cf5"}
            // clientid、psessionid

            QQSession     session = Context.Session;
            JObject       json    = new JObject();
            QQHttpRequest req     = null;

            if (msg.Type == QQMsgType.BUDDY_MSG)
            {
                req = CreateHttpRequest("POST", QQConstants.URL_SEND_BUDDY_MSG);
                json.Add("to", msg.To.Uin);
                json.Add("face", 0); // 这个是干嘛的??
            }
            else if (msg.Type == QQMsgType.GROUP_MSG)
            {
                req = CreateHttpRequest("POST", QQConstants.URL_SEND_GROUP_MSG);
                json.Add("group_uin", msg.Group.Gin);
                json.Add("key", session.CfaceKey);
                json.Add("sig", session.CfaceSig);
            }
            else if (msg.Type == QQMsgType.DISCUZ_MSG)
            {
                req = CreateHttpRequest("POST", QQConstants.URL_SEND_DISCUZ_MSG);
                json.Add("did", msg.Discuz.Did);
                json.Add("key", session.CfaceKey);
                json.Add("sig", session.CfaceSig);
            }
            else if (msg.Type == QQMsgType.SESSION_MSG)
            {   // 临时会话消息
                req = CreateHttpRequest("POST", QQConstants.URL_SEND_SESSION_MSG);
                QQStranger member = (QQStranger)msg.To;
                json.Add("to", member.Uin);
                json.Add("face", 0); // 这个是干嘛的??
                json.Add("group_sig", member.GroupSig);
                json.Add("service_type", member.ServiceType + "");
            }
            else
            {
                MyLogger.Default.Warn("unknown MsgType: " + msg.Type);
            }

            json.Add("content", msg.PackContentList());
            json.Add("msg_id", ++_msgId);
            json.Add("clientid", session.ClientId);
            json.Add("psessionid", session.SessionId);

            req.AddPostValue("r", JsonConvert.SerializeObject(json));
            req.AddPostValue("clientid", session.ClientId + "");
            req.AddPostValue("psessionid", session.SessionId);
            req.AddHeader("Referer", QQConstants.REFFER);

            // System.out.println("sendMsg: " + JsonConvert.SerializeObject(json));
            return(req);
        }
Ejemplo n.º 4
0
        public override QQHttpRequest OnBuildRequest()
        {
            QQSession session = Context.Session;

            QQHttpRequest req = CreateHttpRequest("POST", QQConstants.URL_UPLOAD_CUSTOM_FACE);

            req.AddGetValue("time", DateUtils.NowTimestamp() / 1000 + "");
            req.AddPostValue("from", "control");
            req.AddPostValue("f", "EQQ.Model.ChatMsg.callbackSendPicGroup");
            req.AddPostValue("vfwebqq", session.Vfwebqq);
            req.AddPostValue("fileid", Context.Store.GetPicItemListSize() + "");
            req.AddPostFile("custom_face", file);

            return(req);
        }
Ejemplo n.º 5
0
        public override QQHttpRequest OnBuildRequest()
        {
            QQSession session = Context.Session;

            JObject json = new JObject();

            json.Add("vfwebqq", session.Vfwebqq);
            json.Add("clientid", session.ClientId);
            json.Add("psessionid", session.SessionId);

            QQHttpRequest req = CreateHttpRequest("POST", QQConstants.URL_GET_RECENT_LIST);

            req.AddPostValue("r", JsonConvert.SerializeObject(json));
            req.AddPostValue("clientid", session.ClientId + "");
            req.AddPostValue("psessionid", session.SessionId);

            return(req);
        }
Ejemplo n.º 6
0
        public override QQHttpRequest BuildRequest()
        {
            QQHttpRequest req = CreateHttpRequest("POST", QQConstants.URL_MARK_EMAIL);

            req.AddPostValue("mailaction", "mail_flag");
            req.AddPostValue("flag", "new");
            req.AddPostValue("resp_charset", "UTF8");
            req.AddPostValue("ef", "js");
            req.AddPostValue("folderkey", "1");
            req.AddPostValue("sid", Context.Session.EmailAuthKey);
            req.AddPostValue("status", status + "");
            foreach (QQEmail mail in markList)
            {
                req.AddPostValue("mailid", mail.Id);
            }
            return(req);
        }
Ejemplo n.º 7
0
        public override QQHttpRequest OnBuildRequest()
        {
            QQSession session = Context.Session;

            QQHttpRequest req = CreateHttpRequest("POST", QQConstants.URL_ACCEPET_BUDDY_ADD);

            JObject json = new JObject();

            json.Add("account", _account);
            json.Add("gid", "0");
            json.Add("mname", "");
            json.Add("vfwebqq", session.Vfwebqq);
            req.AddPostValue("r", json.ToString());
            req.AddHeader("Referer", QQConstants.REFFER);
            return(req);
        }
Ejemplo n.º 8
0
        public override QQHttpRequest BuildRequest()
        {
            // mailaction=mail_del&mailid=C1TFACD70BB&t=mail_mgr2&resp_charset=UTF8&ef=js&sid=eEVNdM8QDlC8YWEz&folderkey=1
            QQHttpRequest req = CreateHttpRequest("POST", QQConstants.URL_MARK_EMAIL);

            req.AddPostValue("mailaction", "mail_del");
            req.AddPostValue("t", "mail_mgr2");
            req.AddPostValue("resp_charset", "UTF8");
            req.AddPostValue("ef", "js");
            req.AddPostValue("folderkey", "1");
            req.AddPostValue("sid", Context.Session.EmailAuthKey);
            foreach (QQEmail mail in _markList)
            {
                req.AddPostValue("mailid", mail.Id);
            }
            return(req);
        }
Ejemplo n.º 9
0
        public override QQHttpRequest OnBuildRequest()
        {
            IHttpService httpService = Context.GetSerivce<IHttpService>(QQServiceType.HTTP);
            QQHttpCookie ptwebqq = httpService.GetCookie("ptwebqq", QQConstants.URL_GET_USER_CATEGORIES);
            QQSession session = Context.Session;
            QQAccount account = Context.Account;

            JObject json = new JObject();
            json.Add("vfwebqq", session.Vfwebqq);
            json.Add("hash", QQEncryptor.GetHash(account.Uin + "", ptwebqq.Value));

            QQHttpRequest req = CreateHttpRequest("POST",
                    QQConstants.URL_GET_GROUP_NAME_LIST);
            req.AddPostValue("r", JsonConvert.SerializeObject(json));

            req.AddHeader("Referer", QQConstants.REFFER);

            return req;
        }
Ejemplo n.º 10
0
        public override QQHttpRequest OnBuildRequest()
        {
            IHttpService httpService = Context.GetSerivce <IHttpService>(QQServiceType.HTTP);
            QQSession    session     = Context.Session;

            QQHttpRequest req = CreateHttpRequest("POST", QQConstants.URL_UPLOAD_OFFLINE_PICTURE);

            req.AddGetValue("time", DateUtils.NowTimestamp() / 1000 + "");
            req.AddPostFile("file", this.file);
            req.AddPostValue("callback", "parent.EQQ.Model.ChatMsg.callbackSendPic");
            req.AddPostValue("locallangid", "2052");
            req.AddPostValue("clientversion", "1409");
            req.AddPostValue("uin", Context.Account.Uin + ""); // 自己的账号
            req.AddPostValue("skey", httpService.GetCookie("skey", QQConstants.URL_UPLOAD_OFFLINE_PICTURE).Value);
            req.AddPostValue("appid", "1002101");
            req.AddPostValue("peeruin", user.Uin + ""); // 图片对方UIN
            req.AddPostValue("fileid", "1");
            req.AddPostValue("vfwebqq", session.Vfwebqq);
            req.AddPostValue("senderviplevel", Context.Account.Level.Level + "");
            req.AddPostValue("reciverviplevel", user.Level.Level + "");
            return(req);
        }