From 91996a2f0ab5228acdfac1d0c662d68339a0ed79 Mon Sep 17 00:00:00 2001 From: MikalaiR Date: Sun, 20 Mar 2016 16:57:19 +0000 Subject: VK: code cleanup git-svn-id: http://svn.miranda-ng.org/main/trunk@16518 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/VKontakte/src/main.cpp | 1 - protocols/VKontakte/src/vk_chats.cpp | 41 ++++++++++++------------------- protocols/VKontakte/src/vk_feed.cpp | 9 +++---- protocols/VKontakte/src/vk_files.cpp | 20 ++++++--------- protocols/VKontakte/src/vk_history.cpp | 3 +-- protocols/VKontakte/src/vk_messages.cpp | 15 ++++------- protocols/VKontakte/src/vk_pollserver.cpp | 3 +-- protocols/VKontakte/src/vk_proto.cpp | 6 ++--- protocols/VKontakte/src/vk_queue.cpp | 7 ++++-- protocols/VKontakte/src/vk_search.cpp | 9 +++---- protocols/VKontakte/src/vk_status.cpp | 18 +++++--------- protocols/VKontakte/src/vk_thread.cpp | 21 ++++++---------- protocols/VKontakte/src/vk_wallpost.cpp | 3 +-- 13 files changed, 57 insertions(+), 99 deletions(-) diff --git a/protocols/VKontakte/src/main.cpp b/protocols/VKontakte/src/main.cpp index a44700d0b6..4279c2c3cf 100644 --- a/protocols/VKontakte/src/main.cpp +++ b/protocols/VKontakte/src/main.cpp @@ -71,7 +71,6 @@ extern "C" int __declspec(dllexport) Load() { mir_getLP(&pluginInfo); mir_getCLI(); - InitIcons(); // Register protocol module diff --git a/protocols/VKontakte/src/vk_chats.cpp b/protocols/VKontakte/src/vk_chats.cpp index 231d26db9a..6be3455d39 100644 --- a/protocols/VKontakte/src/vk_chats.cpp +++ b/protocols/VKontakte/src/vk_chats.cpp @@ -128,8 +128,7 @@ void CVkProto::RetrieveChatInfo(CVkChatInfo *cc) if (!IsOnline()) return; Push(new AsyncHttpRequest(this, REQUEST_GET, "/method/execute.json", true, &CVkProto::OnReceiveChatInfo) - << CHAR_PARAM("code", tszQuery) - << VER_API)->pUserInfo = cc; + << CHAR_PARAM("code", tszQuery))->pUserInfo = cc; } void CVkProto::OnReceiveChatInfo(NETLIBHTTPREQUEST *reply, AsyncHttpRequest *pReq) @@ -606,8 +605,7 @@ void CVkProto::LogMenuHook(CVkChatInfo *cc, GCHOOK *gch) if (LPTSTR ptszNew = ChangeChatTopic(cc)) { Push(new AsyncHttpRequest(this, REQUEST_GET, "/method/messages.editChat.json", true, &CVkProto::OnReceiveSmth) << TCHAR_PARAM("title", ptszNew) - << INT_PARAM("chat_id", cc->m_chatid) - << VER_API); + << INT_PARAM("chat_id", cc->m_chatid)); mir_free(ptszNew); } break; @@ -619,8 +617,7 @@ void CVkProto::LogMenuHook(CVkChatInfo *cc, GCHOOK *gch) if (uid != -1) Push(new AsyncHttpRequest(this, REQUEST_GET, "/method/messages.addChatUser.json", true, &CVkProto::OnReceiveSmth) << INT_PARAM("user_id", uid) - << INT_PARAM("chat_id", cc->m_chatid) - << VER_API); + << INT_PARAM("chat_id", cc->m_chatid)); } break; @@ -637,8 +634,7 @@ void CVkProto::LogMenuHook(CVkChatInfo *cc, GCHOOK *gch) "Hist=API.messages.getHistory({\"chat_id\":%d, \"count\":200});" "countMsg = Hist.count;itemsMsg = Hist.items@.id;}; return 1;", cc->m_chatid, m_myUserId, cc->m_chatid, cc->m_chatid); Push(new AsyncHttpRequest(this, REQUEST_GET, "/method/execute.json", true, &CVkProto::OnChatDestroy) - << CHAR_PARAM("code", code) - << VER_API)->pUserInfo = cc; + << CHAR_PARAM("code", code))->pUserInfo = cc; } break; } @@ -663,8 +659,7 @@ INT_PTR __cdecl CVkProto::OnJoinChat(WPARAM hContact, LPARAM) AsyncHttpRequest *pReq = new AsyncHttpRequest(this, REQUEST_POST, "/method/messages.send.json", true, &CVkProto::OnSendChatMsg, AsyncHttpRequest::rpHigh) << INT_PARAM("chat_id", chat_id) - << TCHAR_PARAM("message", m_ReturnChatMessage) - << VER_API; + << TCHAR_PARAM("message", m_ReturnChatMessage); pReq->AddHeader("Content-Type", "application/x-www-form-urlencoded"); Push(pReq); db_unset(hContact, m_szModuleName, "off"); @@ -687,8 +682,7 @@ INT_PTR __cdecl CVkProto::OnLeaveChat(WPARAM hContact, LPARAM) Push(new AsyncHttpRequest(this, REQUEST_GET, "/method/messages.removeChatUser.json", true, &CVkProto::OnChatLeave) << INT_PARAM("chat_id", cc->m_chatid) - << INT_PARAM("user_id", m_myUserId) - << VER_API)->pUserInfo = cc; + << INT_PARAM("user_id", m_myUserId))->pUserInfo = cc; return 0; } @@ -774,8 +768,7 @@ INT_PTR __cdecl CVkProto::SvcDestroyKickChat(WPARAM hContact, LPARAM) "Hist=API.messages.getHistory({\"chat_id\":%d, \"count\":200});" "countMsg = Hist.count;itemsMsg = Hist.items@.id;}; return 1;", chat_id, chat_id); Push(new AsyncHttpRequest(this, REQUEST_GET, "/method/execute.json", true, &CVkProto::OnReceiveSmth) - << CHAR_PARAM("code", code) - << VER_API); + << CHAR_PARAM("code", code)); CallService(MS_DB_CONTACT_DELETE, (WPARAM)hContact); @@ -831,8 +824,7 @@ void CVkProto::NickMenuHook(CVkChatInfo *cc, GCHOOK *gch) Push(new AsyncHttpRequest(this, REQUEST_GET, "/method/messages.removeChatUser.json", true, &CVkProto::OnReceiveSmth) << INT_PARAM("chat_id", cc->m_chatid) - << INT_PARAM("user_id", cu->m_uid) - << VER_API); + << INT_PARAM("user_id", cu->m_uid)); cu->m_bUnknown = true; break; } @@ -910,12 +902,12 @@ void CVkProto::ChatContactTypingThread(void * p) if (cp != NULL) m_ChatsTyping.remove(cp); m_ChatsTyping.insert(param); - - StatusTextData st = { 0 }; - st.cbSize = sizeof(st); - mir_sntprintf(st.tszText, TranslateT("%s is typing a message..."), cu->m_tszNick); - - CallService(MS_MSG_SETSTATUSTEXT, (WPARAM)hChatContact, (LPARAM)&st); + + StatusTextData st = { 0 }; + st.cbSize = sizeof(st); + mir_sntprintf(st.tszText, TranslateT("%s is typing a message..."), cu->m_tszNick); + + CallService(MS_MSG_SETSTATUSTEXT, (WPARAM)hChatContact, (LPARAM)&st); } Sleep(9500); @@ -943,7 +935,7 @@ void CVkProto::StopChatContactTyping(int iChatId, int iUserId) if (cp != NULL && cp->m_UserId == iUserId) { m_ChatsTyping.remove(cp); - StatusTextData st = { 0 }; + StatusTextData st = { 0 }; st.cbSize = sizeof(st); mir_sntprintf(st.tszText, _T(" ")); @@ -1057,8 +1049,7 @@ void CVkProto::CreateNewChat(LPCSTR uids, LPCTSTR ptszTitle) return; Push(new AsyncHttpRequest(this, REQUEST_GET, "/method/messages.createChat.json", true, &CVkProto::OnCreateNewChat) << TCHAR_PARAM("title", ptszTitle) - << CHAR_PARAM("user_ids", uids) - << VER_API); + << CHAR_PARAM("user_ids", uids)); } void CVkProto::OnCreateNewChat(NETLIBHTTPREQUEST *reply, AsyncHttpRequest *pReq) diff --git a/protocols/VKontakte/src/vk_feed.cpp b/protocols/VKontakte/src/vk_feed.cpp index e78cb3ca5e..629c26eca9 100644 --- a/protocols/VKontakte/src/vk_feed.cpp +++ b/protocols/VKontakte/src/vk_feed.cpp @@ -600,8 +600,7 @@ void CVkProto::RetrieveUnreadNews(time_t tLastNewsTime) << INT_PARAM("max_photos", m_iMaxLoadNewsPhoto) << INT_PARAM("start_time", tLastNewsTime + 1) << CHAR_PARAM("filters", szFilter) - << CHAR_PARAM("source_ids", szSource) - << VER_API); + << CHAR_PARAM("source_ids", szSource)); setDword("LastNewsReqTime", (DWORD)time(NULL)); } @@ -691,8 +690,7 @@ void CVkProto::RetrieveUnreadNotifications(time_t tLastNotificationsTime) m_bNotificationFilterInvites ? _T(",\"groupinvates\":API.groups.getInvites({\"extended\":1})};") : _T("};")); Push(new AsyncHttpRequest(this, REQUEST_GET, "/method/execute.json", true, &CVkProto::OnReceiveUnreadNotifications) - << TCHAR_PARAM("code", code) - << VER_API); + << TCHAR_PARAM("code", code) ); setDword("LastNotificationsReqTime", (DWORD)time(NULL)); } @@ -726,8 +724,7 @@ void CVkProto::NotificationMarkAsViewed() if (!IsOnline()) return; - Push(new AsyncHttpRequest(this, REQUEST_GET, "/method/notifications.markAsViewed.json", true, &CVkProto::OnReceiveSmth) - << VER_API); + Push(new AsyncHttpRequest(this, REQUEST_GET, "/method/notifications.markAsViewed.json", true, &CVkProto::OnReceiveSmth)); } void CVkProto::OnReceiveUnreadNotifications(NETLIBHTTPREQUEST *reply, AsyncHttpRequest *pReq) diff --git a/protocols/VKontakte/src/vk_files.cpp b/protocols/VKontakte/src/vk_files.cpp index 65475e3450..655d7cc3bf 100644 --- a/protocols/VKontakte/src/vk_files.cpp +++ b/protocols/VKontakte/src/vk_files.cpp @@ -112,16 +112,13 @@ void CVkProto::SendFileThread(void *p) AsyncHttpRequest *pReq; switch (fup->GetType()) { case CVkFileUploadParam::typeImg: - pReq = new AsyncHttpRequest(this, REQUEST_GET, "/method/photos.getMessagesUploadServer.json", true, &CVkProto::OnReciveUploadServer) - << VER_API; + pReq = new AsyncHttpRequest(this, REQUEST_GET, "/method/photos.getMessagesUploadServer.json", true, &CVkProto::OnReciveUploadServer); break; case CVkFileUploadParam::typeAudio: - pReq = new AsyncHttpRequest(this, REQUEST_GET, "/method/audio.getUploadServer.json", true, &CVkProto::OnReciveUploadServer) - << VER_API; + pReq = new AsyncHttpRequest(this, REQUEST_GET, "/method/audio.getUploadServer.json", true, &CVkProto::OnReciveUploadServer); break; case CVkFileUploadParam::typeDoc: - pReq = new AsyncHttpRequest(this, REQUEST_GET, "/method/docs.getUploadServer.json", true, &CVkProto::OnReciveUploadServer) - << VER_API; + pReq = new AsyncHttpRequest(this, REQUEST_GET, "/method/docs.getUploadServer.json", true, &CVkProto::OnReciveUploadServer); break; default: SendFileFiled(fup, VKERR_FTYPE_NOT_SUPPORTED); @@ -273,8 +270,7 @@ void CVkProto::OnReciveUpload(NETLIBHTTPREQUEST *reply, AsyncHttpRequest *pReq) pUploadReq = new AsyncHttpRequest(this, REQUEST_GET, "/method/photos.saveMessagesPhoto.json", true, &CVkProto::OnReciveUploadFile) << TCHAR_PARAM("server", server) << TCHAR_PARAM("photo", upload) - << TCHAR_PARAM("hash", hash) - << VER_API; + << TCHAR_PARAM("hash", hash); break; case CVkFileUploadParam::typeAudio: upload = jnRoot["audio"].as_mstring(); @@ -285,8 +281,7 @@ void CVkProto::OnReciveUpload(NETLIBHTTPREQUEST *reply, AsyncHttpRequest *pReq) pUploadReq = new AsyncHttpRequest(this, REQUEST_GET, "/method/audio.save.json", true, &CVkProto::OnReciveUploadFile) << TCHAR_PARAM("server", server) << TCHAR_PARAM("audio", upload) - << TCHAR_PARAM("hash", hash) - << VER_API; + << TCHAR_PARAM("hash", hash); break; case CVkFileUploadParam::typeDoc: upload = jnRoot["file"].as_mstring(); @@ -296,8 +291,7 @@ void CVkProto::OnReciveUpload(NETLIBHTTPREQUEST *reply, AsyncHttpRequest *pReq) } pUploadReq = new AsyncHttpRequest(this, REQUEST_GET, "/method/docs.save.json", true, &CVkProto::OnReciveUploadFile) << CHAR_PARAM("title", fup->fileName()) - << TCHAR_PARAM("file", upload) - << VER_API; + << TCHAR_PARAM("file", upload) ; break; default: SendFileFiled(fup, VKERR_FTYPE_NOT_SUPPORTED); @@ -387,7 +381,7 @@ void CVkProto::OnReciveUploadFile(NETLIBHTTPREQUEST *reply, AsyncHttpRequest *pR } - pMsgReq << TCHAR_PARAM("message", fup->Desc) << TCHAR_PARAM("attachment", Attachment) << VER_API; + pMsgReq << TCHAR_PARAM("message", fup->Desc) << TCHAR_PARAM("attachment", Attachment); pMsgReq->AddHeader("Content-Type", "application/x-www-form-urlencoded"); Push(pMsgReq); diff --git a/protocols/VKontakte/src/vk_history.cpp b/protocols/VKontakte/src/vk_history.cpp index 4e9264fa30..54ecb0e86b 100644 --- a/protocols/VKontakte/src/vk_history.cpp +++ b/protocols/VKontakte/src/vk_history.cpp @@ -135,8 +135,7 @@ void CVkProto::GetServerHistory(MCONTACT hContact, int iOffset, int iCount, int "return{\"count\":index,\"datetime\":iTime,\"items\":ret,\"fwd_users\":FUsers,\"once\":%d,\"rcount\":iReqCount};", iOffset, iCount, userID, iTime, iLastMsgId, (int)once); Push(new AsyncHttpRequest(this, REQUEST_GET, "/method/execute.json", true, &CVkProto::OnReceiveHistoryMessages) - << CHAR_PARAM("code", code) - << VER_API)->pUserInfo = new CVkSendMsgParam(hContact, iLastMsgId, iOffset); + << CHAR_PARAM("code", code))->pUserInfo = new CVkSendMsgParam(hContact, iLastMsgId, iOffset); } void CVkProto::GetHistoryDlg(MCONTACT hContact, int iLastMsg) diff --git a/protocols/VKontakte/src/vk_messages.cpp b/protocols/VKontakte/src/vk_messages.cpp index 94f4db627e..b23804b267 100644 --- a/protocols/VKontakte/src/vk_messages.cpp +++ b/protocols/VKontakte/src/vk_messages.cpp @@ -57,8 +57,7 @@ int CVkProto::SendMsg(MCONTACT hContact, int, const char *szMsg) ULONG uMsgId = ::InterlockedIncrement(&m_msgId); AsyncHttpRequest *pReq = new AsyncHttpRequest(this, REQUEST_POST, "/method/messages.send.json", true, bIsChat? &CVkProto::OnSendChatMsg : &CVkProto::OnSendMessage, AsyncHttpRequest::rpHigh) << INT_PARAM(bIsChat ? "chat_id" : "user_id", iUserID) - << INT_PARAM("random_id", ((LONG) time(NULL)) * 100 + uMsgId % 100) - << VER_API; + << INT_PARAM("random_id", ((LONG) time(NULL)) * 100 + uMsgId % 100); pReq->AddHeader("Content-Type", "application/x-www-form-urlencoded"); if (StickerId) @@ -160,8 +159,7 @@ void CVkProto::MarkMessagesRead(const CMStringA &mids) return; Push(new AsyncHttpRequest(this, REQUEST_GET, "/method/messages.markAsRead.json", true, &CVkProto::OnReceiveSmth, AsyncHttpRequest::rpLow) - << CHAR_PARAM("message_ids", mids) - << VER_API); + << CHAR_PARAM("message_ids", mids)); } void CVkProto::MarkMessagesRead(const MCONTACT hContact) @@ -174,8 +172,7 @@ void CVkProto::MarkMessagesRead(const MCONTACT hContact) return; Push(new AsyncHttpRequest(this, REQUEST_GET, "/method/messages.markAsRead.json", true, &CVkProto::OnReceiveSmth, AsyncHttpRequest::rpLow) - << INT_PARAM("peer_id", userID) - << VER_API); + << INT_PARAM("peer_id", userID)); } void CVkProto::RetrieveMessagesByIds(const CMStringA &mids) @@ -198,8 +195,7 @@ void CVkProto::RetrieveMessagesByIds(const CMStringA &mids) ); Push(new AsyncHttpRequest(this, REQUEST_GET, "/method/execute.json", true, &CVkProto::OnReceiveMessages, AsyncHttpRequest::rpHigh) - << CHAR_PARAM("code", code) - << VER_API); + << CHAR_PARAM("code", code)); } void CVkProto::RetrieveUnreadMessages() @@ -208,8 +204,7 @@ void CVkProto::RetrieveUnreadMessages() if (!IsOnline()) return; Push(new AsyncHttpRequest(this, REQUEST_GET, "/method/messages.getDialogs.json", true, &CVkProto::OnReceiveDlgs) - << INT_PARAM ("count", 200) - << VER_API); + << INT_PARAM ("count", 200)); } void CVkProto::OnReceiveMessages(NETLIBHTTPREQUEST *reply, AsyncHttpRequest *pReq) diff --git a/protocols/VKontakte/src/vk_pollserver.cpp b/protocols/VKontakte/src/vk_pollserver.cpp index e292d5449a..5fe77412e4 100644 --- a/protocols/VKontakte/src/vk_pollserver.cpp +++ b/protocols/VKontakte/src/vk_pollserver.cpp @@ -23,8 +23,7 @@ void CVkProto::RetrievePollingInfo() if (!IsOnline()) return; Push(new AsyncHttpRequest(this, REQUEST_GET, "/method/messages.getLongPollServer.json", true, &CVkProto::OnReceivePollingInfo, AsyncHttpRequest::rpHigh) - << INT_PARAM("use_ssl", 1) - << VER_API); + << INT_PARAM("use_ssl", 1)); } void CVkProto::OnReceivePollingInfo(NETLIBHTTPREQUEST *reply, AsyncHttpRequest *pReq) diff --git a/protocols/VKontakte/src/vk_proto.cpp b/protocols/VKontakte/src/vk_proto.cpp index 165de633b9..fec5c09f06 100644 --- a/protocols/VKontakte/src/vk_proto.cpp +++ b/protocols/VKontakte/src/vk_proto.cpp @@ -606,8 +606,7 @@ int CVkProto::AuthRequest(MCONTACT hContact,const TCHAR* message) Push(new AsyncHttpRequest(this, REQUEST_GET, "/method/friends.add.json", true, &CVkProto::OnReceiveAuthRequest) << INT_PARAM("user_id", userID) - << TCHAR_PARAM("text", msg) - << VER_API)->pUserInfo = new CVkSendMsgParam(hContact); + << TCHAR_PARAM("text", msg))->pUserInfo = new CVkSendMsgParam(hContact); return 0; } @@ -689,8 +688,7 @@ int CVkProto::UserIsTyping(MCONTACT hContact, int type) Push(new AsyncHttpRequest(this, REQUEST_GET, "/method/messages.setActivity.json", true, &CVkProto::OnReceiveSmth, AsyncHttpRequest::rpLow) << INT_PARAM("user_id", userID) - << CHAR_PARAM("type", "typing") - << VER_API); + << CHAR_PARAM("type", "typing")); return 0; } return 1; diff --git a/protocols/VKontakte/src/vk_queue.cpp b/protocols/VKontakte/src/vk_queue.cpp index cc83ceb3b4..2a6bae1e38 100644 --- a/protocols/VKontakte/src/vk_queue.cpp +++ b/protocols/VKontakte/src/vk_queue.cpp @@ -80,8 +80,11 @@ AsyncHttpRequest* CVkProto::Push(AsyncHttpRequest *pReq, int iTimeout) { debugLogA("CVkProto::Push"); pReq->timeout = iTimeout; - if (pReq->m_bApiReq && m_VKLang) - pReq << TCHAR_PARAM("lang", m_VKLang); + if (pReq->m_bApiReq) + { + if (m_VKLang != nullptr) pReq << TCHAR_PARAM("lang", m_VKLang); + pReq << VER_API; + } { mir_cslock lck(m_csRequestsQueue); m_arRequestsQueue.insert(pReq); diff --git a/protocols/VKontakte/src/vk_search.cpp b/protocols/VKontakte/src/vk_search.cpp index 0d9f502727..4385b0ae3a 100644 --- a/protocols/VKontakte/src/vk_search.cpp +++ b/protocols/VKontakte/src/vk_search.cpp @@ -48,8 +48,7 @@ void CVkProto::SearchBasicThread(void* id) return; AsyncHttpRequest *pReq = new AsyncHttpRequest(this, REQUEST_GET, "/method/users.get.json", true, &CVkProto::OnSearch) << TCHAR_PARAM("user_ids", (TCHAR *)id) - << CHAR_PARAM("fields", "nickname, domain") - << VER_API; + << CHAR_PARAM("fields", "nickname, domain"); pReq->pUserInfo = NULL; Push(pReq); } @@ -61,8 +60,7 @@ void CVkProto::SearchByMailThread(void* email) return; AsyncHttpRequest *pReq = new AsyncHttpRequest(this, REQUEST_GET, "/method/account.lookupContacts.json", true, &CVkProto::OnSearchByMail) << TCHAR_PARAM("contacts", (TCHAR *)email) - << CHAR_PARAM("service", "email") - << VER_API; + << CHAR_PARAM("service", "email"); Push(pReq); } @@ -79,8 +77,7 @@ void __cdecl CVkProto::SearchThread(void* p) AsyncHttpRequest *pReq = new AsyncHttpRequest(this, REQUEST_GET, "/method/users.search.json", true, &CVkProto::OnSearch) << TCHAR_PARAM("q", (TCHAR *)arg) << CHAR_PARAM("fields", "nickname, domain") - << INT_PARAM("count", 200) - << VER_API; + << INT_PARAM("count", 200); pReq->pUserInfo = p; Push(pReq); } diff --git a/protocols/VKontakte/src/vk_status.cpp b/protocols/VKontakte/src/vk_status.cpp index 42cf6557c9..e6490fd60a 100644 --- a/protocols/VKontakte/src/vk_status.cpp +++ b/protocols/VKontakte/src/vk_status.cpp @@ -77,16 +77,14 @@ void CVkProto::SetServerStatus(int iNewStatus) } m_iStatus = ID_STATUS_OFFLINE; if (iOldStatus != ID_STATUS_OFFLINE && iOldStatus != ID_STATUS_INVISIBLE) - Push(new AsyncHttpRequest(this, REQUEST_GET, "/method/account.setOffline.json", true, &CVkProto::OnReceiveSmth) - << VER_API); + Push(new AsyncHttpRequest(this, REQUEST_GET, "/method/account.setOffline.json", true, &CVkProto::OnReceiveSmth)); } else if (iNewStatus != ID_STATUS_INVISIBLE) { m_bNeedSendOnline = true; if (iOldStatus == ID_STATUS_ONLINE) return; m_iStatus = ID_STATUS_ONLINE; - Push(new AsyncHttpRequest(this, REQUEST_GET, "/method/account.setOnline.json", true, &CVkProto::OnReceiveSmth) - << VER_API); + Push(new AsyncHttpRequest(this, REQUEST_GET, "/method/account.setOnline.json", true, &CVkProto::OnReceiveSmth)); } else { m_bNeedSendOnline = false; @@ -96,8 +94,7 @@ void CVkProto::SetServerStatus(int iNewStatus) } m_iStatus = ID_STATUS_INVISIBLE; if (iOldStatus == ID_STATUS_ONLINE) - Push(new AsyncHttpRequest(this, REQUEST_GET, "/method/account.setOffline.json", true, &CVkProto::OnReceiveSmth) - << VER_API); + Push(new AsyncHttpRequest(this, REQUEST_GET, "/method/account.setOffline.json", true, &CVkProto::OnReceiveSmth)); } ProtoBroadcastAck(NULL, ACKTYPE_STATUS, ACKRESULT_SUCCESS, (HANDLE)iOldStatus, m_iStatus); @@ -113,8 +110,7 @@ INT_PTR __cdecl CVkProto::SvcSetStatusMsg(WPARAM, LPARAM) MsgPopup(NULL, TranslateT("Loading status message from vk.com.\nThis may take some time."), TranslateT("Waiting...")); - Push(new AsyncHttpRequest(this, REQUEST_GET, "/method/status.get.json", true, &CVkProto::OnReceiveStatusMsg) - << VER_API); + Push(new AsyncHttpRequest(this, REQUEST_GET, "/method/status.get.json", true, &CVkProto::OnReceiveStatusMsg)); return 0; } @@ -173,8 +169,7 @@ void CVkProto::RetrieveStatusMsg(const CMString &StatusMsg) return; Push(new AsyncHttpRequest(this, REQUEST_GET, "/method/status.set.json", true, &CVkProto::OnReceiveSmth) - << TCHAR_PARAM("text", StatusMsg) - << VER_API); + << TCHAR_PARAM("text", StatusMsg)); } void CVkProto::RetrieveStatusMusic(const CMString &StatusMsg) @@ -227,8 +222,7 @@ void CVkProto::RetrieveStatusMusic(const CMString &StatusMsg) m_bSetBroadcast = true; } Push(new AsyncHttpRequest(this, REQUEST_GET, "/method/execute.json", true, &CVkProto::OnReceiveStatus) - << TCHAR_PARAM("code", code) - << VER_API); + << TCHAR_PARAM("code", code)); } INT_PTR __cdecl CVkProto::SvcSetListeningTo(WPARAM, LPARAM lParam) diff --git a/protocols/VKontakte/src/vk_thread.cpp b/protocols/VKontakte/src/vk_thread.cpp index d6932c6dc2..363761a888 100644 --- a/protocols/VKontakte/src/vk_thread.cpp +++ b/protocols/VKontakte/src/vk_thread.cpp @@ -213,8 +213,7 @@ void CVkProto::OnOAuthAuthorize(NETLIBHTTPREQUEST *reply, AsyncHttpRequest *pReq void CVkProto::RetrieveMyInfo() { debugLogA("CVkProto::RetrieveMyInfo"); - Push(new AsyncHttpRequest(this, REQUEST_GET, "/method/users.get.json", true, &CVkProto::OnReceiveMyInfo,AsyncHttpRequest::rpHigh) - << VER_API); + Push(new AsyncHttpRequest(this, REQUEST_GET, "/method/users.get.json", true, &CVkProto::OnReceiveMyInfo,AsyncHttpRequest::rpHigh)); } void CVkProto::OnReceiveMyInfo(NETLIBHTTPREQUEST *reply, AsyncHttpRequest *pReq) @@ -459,8 +458,7 @@ void CVkProto::RetrieveUserInfo(LONG userID) CMString code(FORMAT, _T("var userIDs=\"%i\";var res=API.users.get({\"user_ids\":userIDs,\"fields\":\"%s\",\"name_case\":\"nom\"});return{\"freeoffline\":0,\"norepeat\":1,\"usercount\":res.length,\"users\":res};"), userID, CMString(fieldsName)); Push(new AsyncHttpRequest(this, REQUEST_POST, "/method/execute.json", true, &CVkProto::OnReceiveUserInfo) - << TCHAR_PARAM("code", code) - << VER_API); + << TCHAR_PARAM("code", code)); } void CVkProto::RetrieveUsersInfo(bool bFreeOffline, bool bRepeat) @@ -502,8 +500,7 @@ void CVkProto::RetrieveUsersInfo(bool bFreeOffline, bool bRepeat) code.AppendFormat(codeformat, userIDs, CMString(bFreeOffline ? "online,status" : fieldsName), (int)bRepeat); Push(new AsyncHttpRequest(this, REQUEST_POST, "/method/execute.json", true, &CVkProto::OnReceiveUserInfo) - << TCHAR_PARAM("code", code) - << VER_API); + << TCHAR_PARAM("code", code)); } void CVkProto::OnReceiveUserInfo(NETLIBHTTPREQUEST *reply, AsyncHttpRequest *pReq) @@ -590,8 +587,7 @@ void CVkProto::RetrieveFriends(bool bCleanNonFriendContacts) return; Push(new AsyncHttpRequest(this, REQUEST_GET, "/method/friends.get.json", true, &CVkProto::OnReceiveFriends) << INT_PARAM("count", m_iMaxFriendsCount > 5000 ? 1000 : m_iMaxFriendsCount) - << CHAR_PARAM("fields", fieldsName) - << VER_API)->pUserInfo = new CVkSendMsgParam(NULL, bCleanNonFriendContacts ? 1 : 0); + << CHAR_PARAM("fields", fieldsName))->pUserInfo = new CVkSendMsgParam(NULL, bCleanNonFriendContacts ? 1 : 0); } void CVkProto::OnReceiveFriends(NETLIBHTTPREQUEST *reply, AsyncHttpRequest *pReq) @@ -683,8 +679,7 @@ INT_PTR __cdecl CVkProto::SvcDeleteFriend(WPARAM hContact, LPARAM flag) return 1; } Push(new AsyncHttpRequest(this, REQUEST_GET, "/method/friends.delete.json", true, &CVkProto::OnReceiveDeleteFriend) - << INT_PARAM("user_id", userID) - << VER_API)->pUserInfo = new CVkSendMsgParam(hContact); + << INT_PARAM("user_id", userID))->pUserInfo = new CVkSendMsgParam(hContact); return 0; } @@ -779,8 +774,7 @@ INT_PTR __cdecl CVkProto::SvcBanUser(WPARAM hContact, LPARAM) return 1; Push(new AsyncHttpRequest(this, REQUEST_GET, "/method/execute.json", true, &CVkProto::OnReceiveSmth) - << CHAR_PARAM("code", code) - << VER_API); + << CHAR_PARAM("code", code)); if (m_bRemoveFromClist) CallService(MS_DB_CONTACT_DELETE, (WPARAM)hContact); @@ -802,8 +796,7 @@ INT_PTR __cdecl CVkProto::SvcReportAbuse(WPARAM hContact, LPARAM) Push(new AsyncHttpRequest(this, REQUEST_GET, "/method/users.report.json", true, &CVkProto::OnReceiveSmth) << INT_PARAM("user_id", userID) - << CHAR_PARAM("type", "spam") - << VER_API); + << CHAR_PARAM("type", "spam")); return 0; } diff --git a/protocols/VKontakte/src/vk_wallpost.cpp b/protocols/VKontakte/src/vk_wallpost.cpp index f4fbe65d66..909d167269 100644 --- a/protocols/VKontakte/src/vk_wallpost.cpp +++ b/protocols/VKontakte/src/vk_wallpost.cpp @@ -108,8 +108,7 @@ void CVkProto::WallPost(MCONTACT hContact, TCHAR *ptszMsg, TCHAR *ptszUrl, bool AsyncHttpRequest *pReq = new AsyncHttpRequest(this, REQUEST_POST, "/method/wall.post.json", true, &CVkProto::OnReceiveSmth) << INT_PARAM("owner_id", userID) - << INT_PARAM("friends_only", bFriendsOnly ? 1 : 0) - << VER_API; + << INT_PARAM("friends_only", bFriendsOnly ? 1 : 0); if (!IsEmpty(ptszMsg)) pReq << TCHAR_PARAM("message", ptszMsg); -- cgit v1.2.3