From 829c3778ac700f2d64e7032d0727f860196e4417 Mon Sep 17 00:00:00 2001 From: Gluzskiy Alexandr Date: Mon, 21 May 2012 00:38:28 +0300 Subject: fixed another metacontacts problem --- utilities.cpp | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'utilities.cpp') 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; +} -- cgit v1.2.3