From e08b24a95a58cfeb390aae331b068b956f62722d Mon Sep 17 00:00:00 2001 From: George Hazan Date: Wed, 30 Jan 2019 20:49:03 +0300 Subject: m_icq.h removed --- plugins/BasicHistory/src/stdafx.h | 1 - plugins/HistoryStats/src/stdafx.h | 2 - plugins/Msg_Export/src/stdafx.h | 1 - plugins/NewAwaySysMod/src/stdafx.h | 1 - plugins/NewEventNotify/src/stdafx.h | 1 - plugins/New_GPG/src/main.cpp | 22 ------ plugins/New_GPG/src/messages.cpp | 115 +++++++++++-------------------- plugins/New_GPG/src/stdafx.h | 1 - plugins/New_GPG/src/utilities.cpp | 45 +++++------- plugins/SimpleStatusMsg/src/stdafx.h | 1 - plugins/TipperYM/src/popwin.cpp | 5 -- plugins/TipperYM/src/stdafx.h | 1 - plugins/UserInfoEx/src/dlg_propsheet.cpp | 31 +-------- plugins/UserInfoEx/src/stdafx.h | 2 +- 14 files changed, 61 insertions(+), 168 deletions(-) (limited to 'plugins') diff --git a/plugins/BasicHistory/src/stdafx.h b/plugins/BasicHistory/src/stdafx.h index 9672419c66..34be3373c7 100644 --- a/plugins/BasicHistory/src/stdafx.h +++ b/plugins/BasicHistory/src/stdafx.h @@ -48,7 +48,6 @@ #include #include #include -#include #include #include #include diff --git a/plugins/HistoryStats/src/stdafx.h b/plugins/HistoryStats/src/stdafx.h index fcf0d2c131..3b1764e595 100644 --- a/plugins/HistoryStats/src/stdafx.h +++ b/plugins/HistoryStats/src/stdafx.h @@ -63,8 +63,6 @@ #include #include -#include // depends on m_protosvc.h - #include #include // our own header diff --git a/plugins/Msg_Export/src/stdafx.h b/plugins/Msg_Export/src/stdafx.h index 5c870fd621..3b69f6885b 100755 --- a/plugins/Msg_Export/src/stdafx.h +++ b/plugins/Msg_Export/src/stdafx.h @@ -43,7 +43,6 @@ using namespace std; #include #include #include -#include #include #include #include diff --git a/plugins/NewAwaySysMod/src/stdafx.h b/plugins/NewAwaySysMod/src/stdafx.h index 359a612d63..4f522729b1 100644 --- a/plugins/NewAwaySysMod/src/stdafx.h +++ b/plugins/NewAwaySysMod/src/stdafx.h @@ -52,7 +52,6 @@ #include "m_icolib.h" #include "m_message.h" #include "m_userinfo.h" -#include "m_icq.h" #include "win2k.h" #include "resource.h" diff --git a/plugins/NewEventNotify/src/stdafx.h b/plugins/NewEventNotify/src/stdafx.h index beb2e3555d..5119a674c8 100644 --- a/plugins/NewEventNotify/src/stdafx.h +++ b/plugins/NewEventNotify/src/stdafx.h @@ -42,7 +42,6 @@ #include #include #include -#include #include diff --git a/plugins/New_GPG/src/main.cpp b/plugins/New_GPG/src/main.cpp index 13018fd698..218aa936f4 100755 --- a/plugins/New_GPG/src/main.cpp +++ b/plugins/New_GPG/src/main.cpp @@ -243,28 +243,6 @@ void InitCheck() } mir_free(path); } - if (globals.bAutoExchange) { - ICQ_CUSTOMCAP cap; - cap.cbSize = sizeof(ICQ_CUSTOMCAP); - cap.hIcon = nullptr; - strncpy(cap.name, "GPG Key AutoExchange", MAX_CAPNAME); - strncpy(cap.caps, "GPGAutoExchange", sizeof(cap.caps)); - - for (auto &pa : Accounts()) - if (ProtoServiceExists(pa->szProtoName, PS_ICQ_ADDCAPABILITY)) - CallProtoService(pa->szProtoName, PS_ICQ_ADDCAPABILITY, 0, (LPARAM)&cap); - } - if (globals.bFileTransfers) { - ICQ_CUSTOMCAP cap; - cap.cbSize = sizeof(ICQ_CUSTOMCAP); - cap.hIcon = nullptr; - strncpy(cap.name, "GPG Encrypted FileTransfers", MAX_CAPNAME); - strncpy(cap.caps, "GPGFileTransfer", sizeof(cap.caps)); - - for (auto &pa : Accounts()) - if (ProtoServiceExists(pa->szProtoName, PS_ICQ_ADDCAPABILITY)) - CallProtoService(pa->szProtoName, PS_ICQ_ADDCAPABILITY, 0, (LPARAM)&cap); - } } void ImportKey(MCONTACT hContact, std::wstring new_key) diff --git a/plugins/New_GPG/src/messages.cpp b/plugins/New_GPG/src/messages.cpp index fa5ebc3e63..f512e57b11 100755 --- a/plugins/New_GPG/src/messages.cpp +++ b/plugins/New_GPG/src/messages.cpp @@ -557,41 +557,29 @@ INT_PTR RecvMsgSvc(WPARAM w, LPARAM l) } else if (!isContactHaveKey(ccs->hContact) && globals.bAutoExchange && globals.gpg_valid && globals.gpg_keyexist) { char *proto = GetContactProto(ccs->hContact); - DWORD uin = db_get_dw(ccs->hContact, proto, "UIN", 0); - if (uin) { - if (ProtoServiceExists(proto, PS_ICQ_CHECKCAPABILITY)) { - ICQ_CUSTOMCAP cap = { 0 }; - strncpy(cap.caps, "GPGAutoExchange", sizeof(cap.caps)); - if (CallProtoService(proto, PS_ICQ_CHECKCAPABILITY, (WPARAM)ccs->hContact, (LPARAM)&cap)) { - ProtoChainSend(ccs->hContact, PSS_MESSAGE, 0, (LPARAM)"-----PGP KEY REQUEST-----"); - return 0; - } - } - } - else { - wchar_t *jid = db_get_wsa(ccs->hContact, proto, "jid", L""); - if (jid[0]) { - for (auto p : globals.Accounts) { - wchar_t *caps = p->getJabberInterface()->GetResourceFeatures(jid); - if (caps) { - wstring str1; - for (int i = 0;; i++) { - str1.push_back(caps[i]); - if (caps[i] == '\0') - if (caps[i + 1] == '\0') - break; - } - mir_free(caps); - if (str1.find(L"GPG_Key_Auto_Exchange:0") != string::npos) { - ProtoChainSend(ccs->hContact, PSS_MESSAGE, 0, (LPARAM)"-----PGP KEY REQUEST-----"); - return 0; - } + wchar_t *jid = db_get_wsa(ccs->hContact, proto, "jid", L""); + if (jid[0]) { + for (auto p : globals.Accounts) { + wchar_t *caps = p->getJabberInterface()->GetResourceFeatures(jid); + if (caps) { + wstring str1; + for (int i = 0;; i++) { + str1.push_back(caps[i]); + if (caps[i] == '\0') + if (caps[i + 1] == '\0') + break; + } + mir_free(caps); + if (str1.find(L"GPG_Key_Auto_Exchange:0") != string::npos) { + ProtoChainSend(ccs->hContact, PSS_MESSAGE, 0, (LPARAM)"-----PGP KEY REQUEST-----"); + return 0; } } } - mir_free(jid); } + mir_free(jid); } + if (!strstr(msg, "-----BEGIN PGP MESSAGE-----")) return Proto_ChainRecv(w, ccs); @@ -857,56 +845,33 @@ int HookSendMsg(WPARAM w, LPARAM l) globals.debuglog << std::string(time_str() + ": info: checking for autoexchange possibility, name: " + toUTF8(Clist_GetContactDisplayName(hContact))); LPSTR proto = GetContactProto(hContact); - DWORD uin = db_get_dw(hContact, proto, "UIN", 0); - if (uin) { + wchar_t *jid = db_get_wsa(hContact, proto, "jid", L""); + if (jid[0]) { if (globals.bDebugLog) - globals.debuglog << std::string(time_str() + ": info(autoexchange): protocol looks like icq, name: " + toUTF8(Clist_GetContactDisplayName(hContact))); - - char *proto2 = GetContactProto(hContact); - if (ProtoServiceExists(proto2, PS_ICQ_CHECKCAPABILITY)) { - if (globals.bDebugLog) - globals.debuglog << std::string(time_str() + ": info(autoexchange, icq): checking for autoexchange icq capability, name: " + toUTF8(Clist_GetContactDisplayName(hContact))); - ICQ_CUSTOMCAP cap = { 0 }; - strncpy(cap.caps, "GPGAutoExchange", sizeof(cap.caps)); - if (CallProtoService(proto2, PS_ICQ_CHECKCAPABILITY, hContact, (LPARAM)&cap)) { - if (globals.bDebugLog) - globals.debuglog << std::string(time_str() + ": info(autoexchange, icq): sending key requiest, name: " + toUTF8(Clist_GetContactDisplayName(hContact))); - ProtoChainSend(hContact, PSS_MESSAGE, 0, (LPARAM)"-----PGP KEY REQUEST-----"); - globals.hcontact_data[hContact].msgs_to_send.push_back((char*)dbei->pBlob); - mir_forkthread(send_encrypted_msgs_thread, (void*)hContact); - return 0; - } - } - } - else { - wchar_t *jid = db_get_wsa(hContact, proto, "jid", L""); - if (jid[0]) { - if (globals.bDebugLog) - globals.debuglog << std::string(time_str() + ": info(autoexchange): protocol looks like jabber, name: " + toUTF8(Clist_GetContactDisplayName(hContact))); - for (auto p : globals.Accounts) { - wchar_t *caps = p->getJabberInterface()->GetResourceFeatures(jid); - if (caps) { - wstring str; - for (int i = 0;; i++) { - str.push_back(caps[i]); - if (caps[i] == '\0') - if (caps[i + 1] == '\0') - break; - } - mir_free(caps); - if (str.find(L"GPG_Key_Auto_Exchange:0") != string::npos) { - if (globals.bDebugLog) - globals.debuglog << std::string(time_str() + ": info(autoexchange, jabber): autoexchange capability found, sending key request, name: " + toUTF8(Clist_GetContactDisplayName(hContact))); - ProtoChainSend(hContact, PSS_MESSAGE, 0, (LPARAM)"-----PGP KEY REQUEST-----"); - globals.hcontact_data[hContact].msgs_to_send.push_back((char*)dbei->pBlob); - mir_forkthread(send_encrypted_msgs_thread, (void*)hContact); - return 0; - } + globals.debuglog << std::string(time_str() + ": info(autoexchange): protocol looks like jabber, name: " + toUTF8(Clist_GetContactDisplayName(hContact))); + for (auto p : globals.Accounts) { + wchar_t *caps = p->getJabberInterface()->GetResourceFeatures(jid); + if (caps) { + wstring str; + for (int i = 0;; i++) { + str.push_back(caps[i]); + if (caps[i] == '\0') + if (caps[i + 1] == '\0') + break; + } + mir_free(caps); + if (str.find(L"GPG_Key_Auto_Exchange:0") != string::npos) { + if (globals.bDebugLog) + globals.debuglog << std::string(time_str() + ": info(autoexchange, jabber): autoexchange capability found, sending key request, name: " + toUTF8(Clist_GetContactDisplayName(hContact))); + ProtoChainSend(hContact, PSS_MESSAGE, 0, (LPARAM)"-----PGP KEY REQUEST-----"); + globals.hcontact_data[hContact].msgs_to_send.push_back((char*)dbei->pBlob); + mir_forkthread(send_encrypted_msgs_thread, (void*)hContact); + return 0; } } } - mir_free(jid); } + mir_free(jid); } else return 0; } diff --git a/plugins/New_GPG/src/stdafx.h b/plugins/New_GPG/src/stdafx.h index 9a39ad4ea5..927f2610d0 100755 --- a/plugins/New_GPG/src/stdafx.h +++ b/plugins/New_GPG/src/stdafx.h @@ -56,7 +56,6 @@ using std::fstream; #include #include #include -#include #include #include #include diff --git a/plugins/New_GPG/src/utilities.cpp b/plugins/New_GPG/src/utilities.cpp index 5baf42a2e8..1854cb4d4a 100755 --- a/plugins/New_GPG/src/utilities.cpp +++ b/plugins/New_GPG/src/utilities.cpp @@ -453,39 +453,28 @@ INT_PTR onSendFile(WPARAM w, LPARAM l) if (isContactSecured(ccs->hContact)) { char *proto = GetContactProto(ccs->hContact); - DWORD uin = db_get_dw(ccs->hContact, proto, "UIN", 0); bool cap_found = false, supported_proto = false; - if (uin) { - if (ProtoServiceExists(proto, PS_ICQ_CHECKCAPABILITY)) { - supported_proto = true; - ICQ_CUSTOMCAP cap = { 0 }; - strncpy(cap.caps, "GPGFileTransfer", sizeof(cap.caps)); - if (CallProtoService(proto, PS_ICQ_CHECKCAPABILITY, (WPARAM)ccs->hContact, (LPARAM)&cap)) - cap_found = true; - } - } - else { - wchar_t *jid = db_get_wsa(ccs->hContact, proto, "jid", L""); - if (jid[0]) { - for (auto p : globals.Accounts) { - wchar_t *caps = p->getJabberInterface()->GetResourceFeatures(jid); - if (caps) { - supported_proto = true; - wstring str; - for (int i = 0;; i++) { - str.push_back(caps[i]); - if (caps[i] == '\0') - if (caps[i + 1] == '\0') - break; - } - mir_free(caps); - if (str.find(L"GPG_Encrypted_FileTransfers:0") != string::npos) - cap_found = true; + wchar_t *jid = db_get_wsa(ccs->hContact, proto, "jid", L""); + if (jid[0]) { + for (auto p : globals.Accounts) { + wchar_t *caps = p->getJabberInterface()->GetResourceFeatures(jid); + if (caps) { + supported_proto = true; + wstring str; + for (int i = 0;; i++) { + str.push_back(caps[i]); + if (caps[i] == '\0') + if (caps[i + 1] == '\0') + break; } + mir_free(caps); + if (str.find(L"GPG_Encrypted_FileTransfers:0") != string::npos) + cap_found = true; } } - mir_free(jid); } + mir_free(jid); + if (supported_proto && !cap_found) { if (MessageBox(nullptr, TranslateT("Capability to decrypt file not found on other side.\nRecipient may be unable to decrypt file(s).\nDo you want to encrypt file(s) anyway?"), TranslateT("File transfer warning"), MB_YESNO) == IDNO) return Proto_ChainSend(w, ccs); diff --git a/plugins/SimpleStatusMsg/src/stdafx.h b/plugins/SimpleStatusMsg/src/stdafx.h index 108697be74..967308dedd 100644 --- a/plugins/SimpleStatusMsg/src/stdafx.h +++ b/plugins/SimpleStatusMsg/src/stdafx.h @@ -36,7 +36,6 @@ with this program; if not, write to the Free Software Foundation, Inc., #include #include #include -#include #include #include diff --git a/plugins/TipperYM/src/popwin.cpp b/plugins/TipperYM/src/popwin.cpp index 79fa139f47..d57cc4885f 100644 --- a/plugins/TipperYM/src/popwin.cpp +++ b/plugins/TipperYM/src/popwin.cpp @@ -382,11 +382,6 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa } } } - - //request xstatus details - if (opt.bRetrieveXstatus) - if (!db_get_b(0, szProto, "XStatusAuto", 1) && ProtoServiceExists(szProto, PS_ICQ_REQUESTCUSTOMSTATUS)) - CallProtoService(szProto, PS_ICQ_REQUESTCUSTOMSTATUS, pwd->hContact, 0); } SendMessage(hwnd, PUM_REFRESH_VALUES, FALSE, 0); diff --git a/plugins/TipperYM/src/stdafx.h b/plugins/TipperYM/src/stdafx.h index 201f651745..0804c9e2af 100644 --- a/plugins/TipperYM/src/stdafx.h +++ b/plugins/TipperYM/src/stdafx.h @@ -45,7 +45,6 @@ Boston, MA 02111-1307, USA. #include #include #include -#include #include #include diff --git a/plugins/UserInfoEx/src/dlg_propsheet.cpp b/plugins/UserInfoEx/src/dlg_propsheet.cpp index 75bacd9cf0..60f544b937 100644 --- a/plugins/UserInfoEx/src/dlg_propsheet.cpp +++ b/plugins/UserInfoEx/src/dlg_propsheet.cpp @@ -124,21 +124,8 @@ private: TranslateT("You are not currently connected to the ICQ network.\nYou must be online in order to update your information on the server.\n\nYour changes will be saved to database only.")); // start uploading process - else { - _hUploading = (HANDLE)CallProtoService((*_pPd)->szModuleName, PS_CHANGEINFOEX, CIXT_FULL, NULL); - if (_hUploading && _hUploading != (HANDLE)CALLSERVICE_NOTFOUND) { - EnableWindow(_pPs->pTree->Window(), FALSE); - if (CPsTreeItem *pti = _pPs->pTree->CurrentItem()) - EnableWindow(pti->Wnd(), FALSE); - - EnableWindow(GetDlgItem(_pPs->hDlg, IDOK), FALSE); - EnableWindow(GetDlgItem(_pPs->hDlg, IDAPPLY), FALSE); - mir_snprintf(_pPs->szUpdating, "%s (%s)", Translate("Uploading"), (*_pPd)->szModuleName); - ShowWindow(GetDlgItem(_pPs->hDlg, TXT_UPDATING), SW_SHOW); - SetTimer(_pPs->hDlg, TIMERID_UPDATING, 100, nullptr); - return 0; - } - } + else _hUploading = 0; + return 1; } @@ -194,13 +181,6 @@ public: int UploadNext() { - while (_pPd && *_pPd && _numProto-- > 0) { - if (ProtoServiceExists((*_pPd)->szModuleName, PS_CHANGEINFOEX) && !Upload()) { - _pPd++; - return UPLOAD_CONTINUE; - } - _pPd++; - } return _bExitAfterUploading ? UPLOAD_FINISH_CLOSE : UPLOAD_FINISH; } }; @@ -1426,12 +1406,7 @@ void DlgContactInfoLoadModule() g_hWindowList = WindowList_Create(); // check whether changing my details via UserInfoEx is basically possible - myGlobals.CanChangeDetails = FALSE; - - for (auto &pa : Accounts()) - if (IsProtoAccountEnabled(pa)) // update my contact information on icq server - if (myGlobals.CanChangeDetails = MIREXISTS(CallProtoService(pa->szModuleName, PS_CHANGEINFOEX, NULL, NULL))) - break; + myGlobals.CanChangeDetails = false; } ///////////////////////////////////////////////////////////////////////////////////////// diff --git a/plugins/UserInfoEx/src/stdafx.h b/plugins/UserInfoEx/src/stdafx.h index e3e8f5e21d..7812332a92 100644 --- a/plugins/UserInfoEx/src/stdafx.h +++ b/plugins/UserInfoEx/src/stdafx.h @@ -60,9 +60,9 @@ using namespace std; #include #include #include +#include #include #include -#include #include #include #include -- cgit v1.2.3