From 13c033c257f6c083b0c46b4fa28601db5a0b6335 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Thu, 27 Feb 2014 20:50:07 +0000 Subject: MS_MC_GETMETACONTACT => db_mc_getMeta git-svn-id: http://svn.miranda-ng.org/main/trunk@8317 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/SecureIM/src/commonheaders.cpp | 2 +- plugins/SecureIM/src/commonheaders.h | 2 +- plugins/SecureIM/src/crypt.h | 1 - plugins/SecureIM/src/crypt_icons.cpp | 2 +- plugins/SecureIM/src/crypt_metacontacts.cpp | 28 ++++++---------------------- plugins/SecureIM/src/main.cpp | 1 - plugins/SecureIM/src/options.cpp | 4 ++-- 7 files changed, 11 insertions(+), 29 deletions(-) (limited to 'plugins/SecureIM') diff --git a/plugins/SecureIM/src/commonheaders.cpp b/plugins/SecureIM/src/commonheaders.cpp index db6ee76cd3..459c34a3b9 100644 --- a/plugins/SecureIM/src/commonheaders.cpp +++ b/plugins/SecureIM/src/commonheaders.cpp @@ -15,7 +15,7 @@ HICON g_hICO[ICO_CNT], g_hPOP[POP_CNT], g_hIEC[1+IEC_CNT*MODE_CNT] = {0}; HANDLE g_IEC[1+IEC_CNT*MODE_CNT]; int iBmpDepth; -BOOL bMetaContacts = false, bPopupExists = false; +BOOL bPopupExists = false; BOOL bPGPloaded = false, bPGPkeyrings = false, bUseKeyrings = false, bPGPprivkey = false; BOOL bGPGloaded = false, bGPGkeyrings = false, bSavePass = false; BOOL bSFT, bSOM, bASI, bMCD, bSCM, bDGP, bAIP, bNOL, bAAK, bMCM; diff --git a/plugins/SecureIM/src/commonheaders.h b/plugins/SecureIM/src/commonheaders.h index 6fe89b1c81..c8c9a1fcb3 100644 --- a/plugins/SecureIM/src/commonheaders.h +++ b/plugins/SecureIM/src/commonheaders.h @@ -90,7 +90,7 @@ extern int iService, iHook; extern HICON g_hICO[ICO_CNT], g_hIEC[1+IEC_CNT*MODE_CNT], g_hPOP[POP_CNT]; extern HANDLE g_IEC[1+IEC_CNT*MODE_CNT]; extern int iBmpDepth; -extern BOOL bMetaContacts, bPopupExists; +extern BOOL bPopupExists; extern BOOL bPGPloaded, bPGPkeyrings, bUseKeyrings, bPGPprivkey; extern BOOL bGPGloaded, bGPGkeyrings, bSavePass; extern BOOL bSFT, bSOM, bASI, bMCD, bSCM, bDGP, bAIP, bNOL, bAAK, bMCM; diff --git a/plugins/SecureIM/src/crypt.h b/plugins/SecureIM/src/crypt.h index e7e9398f69..42bbe51f9b 100644 --- a/plugins/SecureIM/src/crypt.h +++ b/plugins/SecureIM/src/crypt.h @@ -146,7 +146,6 @@ void showPopupRM(MCONTACT); // crypt_meta.cpp BOOL isProtoMetaContacts(MCONTACT); BOOL isDefaultSubContact(MCONTACT); -MCONTACT getMetaContact(MCONTACT); MCONTACT getMostOnline(MCONTACT); void DeinitMetaContact(MCONTACT); diff --git a/plugins/SecureIM/src/crypt_icons.cpp b/plugins/SecureIM/src/crypt_icons.cpp index 1aa8a4f578..97c3631523 100644 --- a/plugins/SecureIM/src/crypt_icons.cpp +++ b/plugins/SecureIM/src/crypt_icons.cpp @@ -64,7 +64,7 @@ HANDLE mode2clicon(int mode, int type) // обновляет иконки в clist и в messagew void ShowStatusIcon(MCONTACT hContact, int mode) { - MCONTACT hMC = getMetaContact(hContact); + MCONTACT hMC = db_mc_getMeta(hContact); // обновить иконки в clist if (mode != -1) { diff --git a/plugins/SecureIM/src/crypt_metacontacts.cpp b/plugins/SecureIM/src/crypt_metacontacts.cpp index e99328f1d6..c104044f87 100644 --- a/plugins/SecureIM/src/crypt_metacontacts.cpp +++ b/plugins/SecureIM/src/crypt_metacontacts.cpp @@ -2,42 +2,26 @@ BOOL isProtoMetaContacts(MCONTACT hContact) { - if (bMetaContacts) { - LPSTR proto = GetContactProto(hContact); - if (proto && !strcmp(proto,"MetaContacts")) - return true; - } + LPSTR proto = GetContactProto(hContact); + if (proto && !strcmp(proto,"MetaContacts")) + return true; return false; } BOOL isDefaultSubContact(MCONTACT hContact) { - if (bMetaContacts) - return (MCONTACT)CallService(MS_MC_GETDEFAULTCONTACT,(WPARAM)CallService(MS_MC_GETMETACONTACT,hContact,0),0) == hContact; - - return false; -} - -MCONTACT getMetaContact(MCONTACT hContact) -{ - if (bMetaContacts) - return (MCONTACT)CallService(MS_MC_GETMETACONTACT, hContact, 0); - - return 0; + return (MCONTACT)CallService(MS_MC_GETDEFAULTCONTACT, db_mc_getMeta(hContact), 0) == hContact; } MCONTACT getMostOnline(MCONTACT hContact) { - if (bMetaContacts) - return (MCONTACT)CallService(MS_MC_GETMOSTONLINECONTACT, hContact, 0); - - return 0; + return (MCONTACT)CallService(MS_MC_GETMOSTONLINECONTACT, hContact, 0); } // remove all secureim connections on subcontacts void DeinitMetaContact(MCONTACT hContact) { - MCONTACT hMetaContact = isProtoMetaContacts(hContact) ? hContact : getMetaContact(hContact); + MCONTACT hMetaContact = isProtoMetaContacts(hContact) ? hContact : db_mc_getMeta(hContact); if (hMetaContact) { for (int i=0; i < CallService(MS_MC_GETNUMCONTACTS,(WPARAM)hMetaContact,0); i++) { MCONTACT hSubContact = (MCONTACT)CallService(MS_MC_GETSUBCONTACT, (WPARAM)hMetaContact, i); diff --git a/plugins/SecureIM/src/main.cpp b/plugins/SecureIM/src/main.cpp index 63f191d663..2822625fbd 100644 --- a/plugins/SecureIM/src/main.cpp +++ b/plugins/SecureIM/src/main.cpp @@ -128,7 +128,6 @@ extern "C" __declspec(dllexport) int __cdecl Unload() int ModuleLoad(WPARAM, LPARAM) { bPopupExists = ServiceExists(MS_POPUP_ADDPOPUP); - bMetaContacts = ServiceExists(MS_MC_GETMETACONTACT); return 0; } diff --git a/plugins/SecureIM/src/options.cpp b/plugins/SecureIM/src/options.cpp index 732b3466a3..219aad76c9 100644 --- a/plugins/SecureIM/src/options.cpp +++ b/plugins/SecureIM/src/options.cpp @@ -1065,7 +1065,7 @@ void RefreshPGPDlg(HWND hDlg, BOOL iInit) for (MCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) { pUinKey ptr = getUinKey(hContact); - if (ptr && ptr->mode == MODE_PGP && isSecureProtocol(hContact) /*&& !getMetaContact(hContact)*/ && !isChatRoom(hContact)) { + if (ptr && ptr->mode == MODE_PGP && isSecureProtocol(hContact) && !isChatRoom(hContact)) { LPSTR szKeyID = db_get_sa(hContact,MODULENAME,"pgp_abbr"); lvi.iItem++; @@ -1125,7 +1125,7 @@ void RefreshGPGDlg(HWND hDlg, BOOL iInit) for (MCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) { pUinKey ptr = getUinKey(hContact); - if (ptr && ptr->mode == MODE_GPG && isSecureProtocol(hContact) /*&& !getMetaContact(hContact)*/ && !isChatRoom(hContact)) { + if (ptr && ptr->mode == MODE_GPG && isSecureProtocol(hContact) && !isChatRoom(hContact)) { if (iInit ) ptr->tgpgMode = ptr->gpgMode; -- cgit v1.2.3