diff options
-rwxr-xr-x | globals.h | 2 | ||||
-rwxr-xr-x | init.cpp | 5 | ||||
-rwxr-xr-x | srmm.cpp | 3 | ||||
-rwxr-xr-x | utilities.cpp | 25 | ||||
-rwxr-xr-x | utilities.h | 1 |
5 files changed, 33 insertions, 3 deletions
@@ -16,7 +16,7 @@ #ifndef GLOBALS_H
#define GLOBALS_H
-extern bool bAppendTags, bStripTags, gpg_valid, gpg_keyexist;
+extern bool bAppendTags, bStripTags, gpg_valid, gpg_keyexist, tabsrmm_used;
extern TCHAR *inopentag, *inclosetag, *outopentag, *outclosetag;
extern logtofile debuglog;
#endif
@@ -17,7 +17,7 @@ #include "commonheaders.h"
//global variables
-bool bAppendTags = false, bDebugLog = false, bJabberAPI = false, bIsMiranda09 = false, bMetaContacts = false, bFileTransfers = false, bAutoExchange = false, bStripTags = false;
+bool bAppendTags = false, bDebugLog = false, bJabberAPI = false, bIsMiranda09 = false, bMetaContacts = false, bFileTransfers = false, bAutoExchange = false, bStripTags = false, tabsrmm_used = false;
TCHAR *inopentag = NULL, *inclosetag = NULL, *outopentag = NULL, *outclosetag = NULL, *password = NULL;
list <JabberAccount*> Accounts;
@@ -110,16 +110,17 @@ void init_vars() new_key_rect.top = DBGetContactSettingDword(NULL, szGPGModuleName, "NewKeyWindowY", 0);
load_existing_key_rect.left = DBGetContactSettingDword(NULL, szGPGModuleName, "LoadExistingKeyWindowX", 0);
load_existing_key_rect.top = DBGetContactSettingDword(NULL, szGPGModuleName, "LoadExistingKeyWindowY", 0);
+ tabsrmm_used = isTabsrmmUsed();
}
extern "C" int __declspec(dllexport) Load(PLUGINLINK *link)
{
pluginLink=link;
- init_vars();
HookEvent(ME_SYSTEM_MODULESLOADED, OnModulesLoaded);
mir_getMMI(&mmi);
mir_getUTFI(&utfi);
mir_getXI(&xi); //TODO: check if we have access to api
+ init_vars();
CreateServiceFunction("/LoadPubKey",(MIRANDASERVICE)LoadKey);
CreateServiceFunction("/ToggleEncryption",(MIRANDASERVICE)ToggleEncryption);
CreateServiceFunction("/SendKey",(MIRANDASERVICE)SendKey);
@@ -36,7 +36,10 @@ int __cdecl onIconPressed(WPARAM wParam, LPARAM lParam) { HANDLE hContact = (HANDLE)wParam;
HANDLE hMeta = NULL;
if(metaIsProtoMetaContacts(hContact))
+ {
+ hMeta = hContact;
hContact = metaGetMostOnline(hContact); // возьмем тот, через который пойдет сообщение
+ }
else if(metaIsSubcontact(hContact))
hMeta = metaGetContact(hContact);
StatusIconClickData *sicd = (StatusIconClickData *)lParam;
diff --git a/utilities.cpp b/utilities.cpp index 67e0238..c52edde 100755 --- a/utilities.cpp +++ b/utilities.cpp @@ -1280,3 +1280,28 @@ string time_str() boost::posix_time::ptime now = boost::posix_time::second_clock::local_time(); return (string)boost::posix_time::to_simple_string(now); } + +int handleEnum(const char *szSetting, LPARAM lParam) +{ + if(szSetting[0] && StriStr(szSetting, "tabsrmm")) + { + bool f = false, *found = (bool*)lParam; + f = !DBGetContactSettingByte(NULL, "PluginDisable", szSetting, 0); + if(f) + *found = f; + } + return 0; +} + +bool isTabsrmmUsed() +{ + DBCONTACTENUMSETTINGS enm = {0}; + bool found = false; + enm.lParam = (LPARAM)&found; + enm.pfnEnumProc = (DBSETTINGENUMPROC)&handleEnum; + enm.szModule = "PluginDisable"; + if(CallService(MS_DB_CONTACT_ENUMSETTINGS, (WPARAM)NULL, (LPARAM)&enm) == -1) + return false; + + return found; +} diff --git a/utilities.h b/utilities.h index f27dfca..30e9f68 100755 --- a/utilities.h +++ b/utilities.h @@ -27,6 +27,7 @@ void storeOutput(HANDLE ahandle, string *output); int ComboBoxAddStringUtf(HWND hCombo, const TCHAR *szString, DWORD data);
bool isContactSecured(HANDLE hContact);
bool isContactHaveKey(HANDLE hContact);
+bool isTabsrmmUsed();
bool isGPGKeyExist();
bool isGPGValid();
const bool StriStr(const char *str, const char *substr);
|