diff options
author | George Hazan <george.hazan@gmail.com> | 2012-11-10 21:36:54 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2012-11-10 21:36:54 +0000 |
commit | 9c2e0c8b025c98cbff2975e6dd9c86e03cd04244 (patch) | |
tree | bd95b8ef2753ef3f2b3701bfe350eb7682794319 | |
parent | f22d8982b41614d703b0db98264e01ef7049a4a0 (diff) |
code cleaning for ME_DB_CONTACT_SETTINGCHANGED in plugins
git-svn-id: http://svn.miranda-ng.org/main/trunk@2283 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
-rw-r--r-- | plugins/AVS/src/main.cpp | 11 | ||||
-rw-r--r-- | plugins/Clist_modern/src/modern_clc.cpp | 7 | ||||
-rw-r--r-- | plugins/Clist_modern/src/modern_clcopts.cpp | 25 | ||||
-rw-r--r-- | plugins/Clist_mw/src/clc.cpp | 4 | ||||
-rw-r--r-- | plugins/Db3x_mmap/src/dbsettings.cpp | 12 | ||||
-rw-r--r-- | plugins/MenuItemEx/src/main.cpp | 9 | ||||
-rw-r--r-- | plugins/Scriver/src/msgs.cpp | 4 | ||||
-rw-r--r-- | plugins/TabSRMM/src/globals.cpp | 3 | ||||
-rw-r--r-- | plugins/UserInfoEx/src/Flags/svc_flags.cpp | 60 | ||||
-rw-r--r-- | plugins/UserInfoEx/src/svc_gender.cpp | 3 | ||||
-rw-r--r-- | plugins/UserInfoEx/src/svc_homepage.cpp | 3 | ||||
-rw-r--r-- | plugins/UserInfoEx/src/svc_phone.cpp | 3 | ||||
-rw-r--r-- | plugins/UserInfoEx/src/svc_reminder.cpp | 7 | ||||
-rw-r--r-- | src/core/stdurl/url.cpp | 6 | ||||
-rw-r--r-- | src/modules/clist/clc.cpp | 5 | ||||
-rw-r--r-- | src/modules/extraicons/DefaultExtraIcons.cpp | 30 | ||||
-rw-r--r-- | src/modules/protocols/protoaccs.cpp | 11 |
17 files changed, 87 insertions, 116 deletions
diff --git a/plugins/AVS/src/main.cpp b/plugins/AVS/src/main.cpp index 8a7e5d75ea..91ba752a27 100644 --- a/plugins/AVS/src/main.cpp +++ b/plugins/AVS/src/main.cpp @@ -2132,21 +2132,16 @@ static INT_PTR ReportMyAvatarChanged(WPARAM wParam, LPARAM lParam) static int ContactSettingChanged(WPARAM wParam, LPARAM lParam)
{
DBCONTACTWRITESETTING *cws = (DBCONTACTWRITESETTING *) lParam;
-
if (cws == NULL || g_shutDown)
return 0;
if (wParam == 0) {
- if (!strcmp(cws->szSetting, "AvatarFile")
- || !strcmp(cws->szSetting, "PictObject")
- || !strcmp(cws->szSetting, "AvatarHash")
- || !strcmp(cws->szSetting, "AvatarSaved"))
- {
+ if (!strcmp(cws->szSetting, "AvatarFile") || !strcmp(cws->szSetting, "PictObject") || !strcmp(cws->szSetting, "AvatarHash") || !strcmp(cws->szSetting, "AvatarSaved"))
ReportMyAvatarChanged((WPARAM) cws->szModule, 0);
- }
return 0;
}
- else if (g_MetaAvail && !strcmp(cws->szModule, g_szMetaName)) {
+
+ if (g_MetaAvail && !strcmp(cws->szModule, g_szMetaName)) {
if (lstrlenA(cws->szSetting) > 6 && !strncmp(cws->szSetting, "Status", 5))
MetaChanged(wParam, 0);
}
diff --git a/plugins/Clist_modern/src/modern_clc.cpp b/plugins/Clist_modern/src/modern_clc.cpp index 76289e97d9..6d5e14d957 100644 --- a/plugins/Clist_modern/src/modern_clc.cpp +++ b/plugins/Clist_modern/src/modern_clc.cpp @@ -186,10 +186,11 @@ static int clcHookIconsChanged(WPARAM wParam, LPARAM lParam) static int clcHookSettingChanged(WPARAM wParam,LPARAM lParam)
{
+ if (MirandaExiting())
+ return 0;
+
DBCONTACTWRITESETTING *cws = (DBCONTACTWRITESETTING*)lParam;
- if (MirandaExiting()) return 0;
- if ((HANDLE)wParam == NULL)
- {
+ if ((HANDLE)wParam == NULL) {
if (g_szMetaModuleName && !mir_strcmp(cws->szModule, g_szMetaModuleName))
{
if ( !mir_strcmp(cws->szSetting, "Enabled"))
diff --git a/plugins/Clist_modern/src/modern_clcopts.cpp b/plugins/Clist_modern/src/modern_clcopts.cpp index 675bcd942e..8d8570bc1a 100644 --- a/plugins/Clist_modern/src/modern_clcopts.cpp +++ b/plugins/Clist_modern/src/modern_clcopts.cpp @@ -737,21 +737,19 @@ static INT_PTR CALLBACK DlgProcClistOpts(HWND hwndDlg, UINT msg, WPARAM wParam, {
switch (msg) {
case WM_INITDIALOG:
- {
- TranslateDialogDefault(hwndDlg);
- SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (LONG_PTR)HookEventMessage(ME_DB_CONTACT_SETTINGCHANGED,hwndDlg,WM_USER+1));
-
- CheckDlgButton(hwndDlg, IDC_HIDEOFFLINE, db_get_b(NULL,"CList","HideOffline",SETTING_HIDEOFFLINE_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_HIDEEMPTYGROUPS, db_get_b(NULL,"CList","HideEmptyGroups",SETTING_HIDEEMPTYGROUPS_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_DISABLEGROUPS, db_get_b(NULL,"CList","UseGroups",SETTING_USEGROUPS_DEFAULT) ? BST_UNCHECKED : BST_CHECKED);
- CheckDlgButton(hwndDlg, IDC_CONFIRMDELETE, db_get_b(NULL,"CList","ConfirmDelete",SETTING_CONFIRMDELETE_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
+ TranslateDialogDefault(hwndDlg);
- CheckDlgButton(hwndDlg,IDC_GAMMACORRECT,db_get_b(NULL,"CLC","GammaCorrect",CLCDEFAULT_GAMMACORRECT)?BST_CHECKED:BST_UNCHECKED);
- CheckDlgButton(hwndDlg,IDC_HILIGHTMODE,db_get_b(NULL,"CLC","HiLightMode",SETTING_HILIGHTMODE_DEFAULT) == 0?BST_CHECKED:BST_UNCHECKED);
- CheckDlgButton(hwndDlg,IDC_HILIGHTMODE1,db_get_b(NULL,"CLC","HiLightMode",SETTING_HILIGHTMODE_DEFAULT) == 1?BST_CHECKED:BST_UNCHECKED);
- CheckDlgButton(hwndDlg,IDC_HILIGHTMODE2,db_get_b(NULL,"CLC","HiLightMode",SETTING_HILIGHTMODE_DEFAULT) == 2?BST_CHECKED:BST_UNCHECKED);
- CheckDlgButton(hwndDlg,IDC_HILIGHTMODE3,db_get_b(NULL,"CLC","HiLightMode",SETTING_HILIGHTMODE_DEFAULT) == 3?BST_CHECKED:BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_HIDEOFFLINE, db_get_b(NULL,"CList","HideOffline",SETTING_HIDEOFFLINE_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_HIDEEMPTYGROUPS, db_get_b(NULL,"CList","HideEmptyGroups",SETTING_HIDEEMPTYGROUPS_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_DISABLEGROUPS, db_get_b(NULL,"CList","UseGroups",SETTING_USEGROUPS_DEFAULT) ? BST_UNCHECKED : BST_CHECKED);
+ CheckDlgButton(hwndDlg, IDC_CONFIRMDELETE, db_get_b(NULL,"CList","ConfirmDelete",SETTING_CONFIRMDELETE_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg,IDC_GAMMACORRECT,db_get_b(NULL,"CLC","GammaCorrect",CLCDEFAULT_GAMMACORRECT)?BST_CHECKED:BST_UNCHECKED);
+ CheckDlgButton(hwndDlg,IDC_HILIGHTMODE,db_get_b(NULL,"CLC","HiLightMode",SETTING_HILIGHTMODE_DEFAULT) == 0?BST_CHECKED:BST_UNCHECKED);
+ CheckDlgButton(hwndDlg,IDC_HILIGHTMODE1,db_get_b(NULL,"CLC","HiLightMode",SETTING_HILIGHTMODE_DEFAULT) == 1?BST_CHECKED:BST_UNCHECKED);
+ CheckDlgButton(hwndDlg,IDC_HILIGHTMODE2,db_get_b(NULL,"CLC","HiLightMode",SETTING_HILIGHTMODE_DEFAULT) == 2?BST_CHECKED:BST_UNCHECKED);
+ CheckDlgButton(hwndDlg,IDC_HILIGHTMODE3,db_get_b(NULL,"CLC","HiLightMode",SETTING_HILIGHTMODE_DEFAULT) == 3?BST_CHECKED:BST_UNCHECKED);
+ {
int i, item;
int s1, s2, s3;
for (i=0; i < SIZEOF(sortby); i++)
@@ -782,6 +780,7 @@ static INT_PTR CALLBACK DlgProcClistOpts(HWND hwndDlg, UINT msg, WPARAM wParam, CheckDlgButton(hwndDlg, IDC_OFFLINETOROOT, db_get_b(NULL,"CList","PlaceOfflineToRoot",SETTING_PLACEOFFLINETOROOT_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
}
return TRUE;
+
case WM_COMMAND:
SendMessage(GetParent(hwndDlg), PSM_CHANGED, (WPARAM)hwndDlg, 0);
break;
diff --git a/plugins/Clist_mw/src/clc.cpp b/plugins/Clist_mw/src/clc.cpp index fe30336531..8735d1c2bd 100644 --- a/plugins/Clist_mw/src/clc.cpp +++ b/plugins/Clist_mw/src/clc.cpp @@ -99,7 +99,7 @@ static int ClcSettingChanged(WPARAM wParam, LPARAM lParam) if ((HANDLE)wParam != NULL && !strcmp(cws->szModule,"MetaContacts") && !strcmp(cws->szSetting,"Handle"))
pcli->pfnClcBroadcast( INTM_NAMEORDERCHANGED, 0, 0 );
- if ((HANDLE)wParam != NULL&&!strcmp(cws->szModule,"CList")) {
+ if ((HANDLE)wParam != NULL && !strcmp(cws->szModule,"CList")) {
if ( !strcmp( cws->szSetting, "noOffline" ))
pcli->pfnClcBroadcast( INTM_NAMEORDERCHANGED, wParam, lParam );
else if (!strcmp(cws->szSetting,"StatusMsg"))
@@ -289,7 +289,7 @@ int LoadCLCModule(void) himlCListClc = (HIMAGELIST)CallService(MS_CLIST_GETICONSIMAGELIST,0,0);
HookEvent(ME_SYSTEM_MODULESLOADED,ClcModulesLoaded);
- hSettingChanged1 = HookEvent(ME_DB_CONTACT_SETTINGCHANGED,ClcSettingChanged);
+ hSettingChanged1 = HookEvent(ME_DB_CONTACT_SETTINGCHANGED, ClcSettingChanged);
HookEvent(ME_OPT_INITIALISE,ClcOptInit);
HookEvent(ME_SYSTEM_SHUTDOWN,ClcShutdown);
return 0;
diff --git a/plugins/Db3x_mmap/src/dbsettings.cpp b/plugins/Db3x_mmap/src/dbsettings.cpp index 47bfef5e08..d52fbe8ee2 100644 --- a/plugins/Db3x_mmap/src/dbsettings.cpp +++ b/plugins/Db3x_mmap/src/dbsettings.cpp @@ -435,7 +435,8 @@ STDMETHODIMP_(BOOL) CDb3Base::WriteContactSetting(HANDLE hContact, DBCONTACTWRIT }
if ( szCachedSettingName[-1] != 0 ) {
lck.unlock();
- NotifyEventHooks(hSettingChangeEvent, (WPARAM)hContact, (LPARAM)&tmp);
+ if ( NotifyEventHooks(hSettingChangeEvent, (WPARAM)hContact, (LPARAM)&tmp))
+ DebugBreak();
return 0;
}
}
@@ -526,7 +527,8 @@ STDMETHODIMP_(BOOL) CDb3Base::WriteContactSetting(HANDLE hContact, DBCONTACTWRIT DBFlush(1);
lck.unlock();
//notify
- NotifyEventHooks(hSettingChangeEvent, (WPARAM)hContact, (LPARAM)&tmp);
+ if ( NotifyEventHooks(hSettingChangeEvent, (WPARAM)hContact, (LPARAM)&tmp))
+ DebugBreak();
return 0;
}
}
@@ -612,7 +614,8 @@ STDMETHODIMP_(BOOL) CDb3Base::WriteContactSetting(HANDLE hContact, DBCONTACTWRIT lck.unlock();
//notify
- NotifyEventHooks(hSettingChangeEvent, (WPARAM)hContact, (LPARAM)&tmp );
+ if ( NotifyEventHooks(hSettingChangeEvent, (WPARAM)hContact, (LPARAM)&tmp ))
+ DebugBreak();
return 0;
}
@@ -704,7 +707,8 @@ STDMETHODIMP_(BOOL) CDb3Base::DeleteContactSetting(HANDLE hContact, DBCONTACTGET dbcws.szModule = dbcgs->szModule;
dbcws.szSetting = dbcgs->szSetting;
dbcws.value.type = DBVT_DELETED;
- NotifyEventHooks(hSettingChangeEvent,saveWparam,(LPARAM)&dbcws);
+ if ( NotifyEventHooks(hSettingChangeEvent,saveWparam,(LPARAM)&dbcws))
+ DebugBreak();
return 0;
}
diff --git a/plugins/MenuItemEx/src/main.cpp b/plugins/MenuItemEx/src/main.cpp index c96512f956..ce2d7349c4 100644 --- a/plugins/MenuItemEx/src/main.cpp +++ b/plugins/MenuItemEx/src/main.cpp @@ -1162,8 +1162,7 @@ static int ContactSettingChanged( WPARAM wParam, LPARAM lParam ) if (DBGetContactSettingByte(hContact, lpzProto, "ChatRoom", 0))
return 0;
- if (oldStatus == ID_STATUS_OFFLINE)
- {
+ if (oldStatus == ID_STATUS_OFFLINE) {
// set logon timestamp for this contact, only when not set already
if (!DBGetContactSettingDword(hContact, lpzProto, "LogonTS", FALSE))
DBWriteContactSettingDword(hContact, lpzProto, "LogonTS", ( DWORD )time(NULL));
@@ -1172,15 +1171,13 @@ static int ContactSettingChanged( WPARAM wParam, LPARAM lParam ) DBDeleteContactSetting(hContact, lpzProto, "LogoffTS");
// TESTING: updating user's details
- if (DBGetContactSettingDword(NULL, VISPLG, "flags", vf_default) & VF_REFRESH)
- {
+ if (DBGetContactSettingDword(NULL, VISPLG, "flags", vf_default) & VF_REFRESH) {
// don't refresh Hidden or NotOnList contact's details
if (!DBGetContactSettingByte(hContact, "CList", "Hidden", 0) && !DBGetContactSettingByte((HANDLE)wParam, "CList", "NotOnList", 0))
CallContactService(hContact, PSS_GETINFO, 0, 0 );
}
}
- if (newStatus == ID_STATUS_OFFLINE)
- {
+ if (newStatus == ID_STATUS_OFFLINE) {
// set logoff timestamp for this contact
DBWriteContactSettingDword(hContact, lpzProto, "LogoffTS", ( DWORD )time(NULL));
// reset logon timestamp
diff --git a/plugins/Scriver/src/msgs.cpp b/plugins/Scriver/src/msgs.cpp index 67997b9fee..7708b6c1c0 100644 --- a/plugins/Scriver/src/msgs.cpp +++ b/plugins/Scriver/src/msgs.cpp @@ -284,9 +284,7 @@ static int TypingMessage(WPARAM wParam, LPARAM lParam) static int MessageSettingChanged(WPARAM wParam, LPARAM lParam)
{
DBCONTACTWRITESETTING *cws = (DBCONTACTWRITESETTING *) lParam;
- char *szProto;
-
- szProto = (char *) CallService(MS_PROTO_GETCONTACTBASEPROTO, wParam, 0);
+ char *szProto = (char *) CallService(MS_PROTO_GETCONTACTBASEPROTO, wParam, 0);
if (lstrcmpA(cws->szModule, "CList") && (szProto == NULL || lstrcmpA(cws->szModule, szProto)))
return 0;
WindowList_Broadcast(g_dat->hMessageWindowList, DM_CLISTSETTINGSCHANGED, wParam, lParam);
diff --git a/plugins/TabSRMM/src/globals.cpp b/plugins/TabSRMM/src/globals.cpp index 364eef5b68..32705d2388 100644 --- a/plugins/TabSRMM/src/globals.cpp +++ b/plugins/TabSRMM/src/globals.cpp @@ -503,10 +503,9 @@ int CGlobals::DBSettingChanged(WPARAM wParam, LPARAM lParam) if (lstrcmpA(cws->szModule, "CList") && (szProto == NULL || lstrcmpA(cws->szModule, szProto)))
return 0;
- if (PluginConfig.g_MetaContactsAvail && !lstrcmpA(cws->szModule, PluginConfig.szMetaName)) {
+ if (PluginConfig.g_MetaContactsAvail && !lstrcmpA(cws->szModule, PluginConfig.szMetaName))
if (wParam != 0 && !lstrcmpA(setting, "Nick")) // filter out this setting to avoid infinite loops while trying to obtain the most online contact
return 0;
- }
if (hwnd) {
if (c) {
diff --git a/plugins/UserInfoEx/src/Flags/svc_flags.cpp b/plugins/UserInfoEx/src/Flags/svc_flags.cpp index e1f4b700f0..c864e0bca8 100644 --- a/plugins/UserInfoEx/src/Flags/svc_flags.cpp +++ b/plugins/UserInfoEx/src/Flags/svc_flags.cpp @@ -284,34 +284,34 @@ static int OnCListApplyIcons(WPARAM wParam,LPARAM lParam) static int OnExtraIconSvcChanged(WPARAM wParam,LPARAM lParam)
{
DBCONTACTWRITESETTING *dbcws=(DBCONTACTWRITESETTING*)lParam;
- if ((HANDLE)wParam!=NULL)return 0;
- if (!lstrcmpA(dbcws->szModule, "ExtraIcons") &&
- !lstrcmpA(dbcws->szSetting,"Slot_Flags")) {
- BOOL bEnable;
- switch (dbcws->value.type) {
- case DBVT_BYTE:
- bEnable = dbcws->value.bVal != (BYTE)-1;
- break;
- case DBVT_WORD:
- bEnable = dbcws->value.wVal != (WORD)-1;
- break;
- case DBVT_DWORD:
- bEnable = dbcws->value.dVal != (DWORD)-1;
- break;
- default:
- bEnable = -1;
- break;
- }
- if(bEnable == -1) {
- return 0;
- }
- else if(bEnable && !hApplyIconHook) {
- hApplyIconHook = HookEvent(ME_CLIST_EXTRA_IMAGE_APPLY, OnCListApplyIcons);
- }
- else if (!bEnable && hApplyIconHook) {
- UnhookEvent(hApplyIconHook); hApplyIconHook = NULL;
- }
- CallFunctionBuffered(UpdateExtraImages,(LPARAM)bEnable,FALSE,EXTRAIMAGE_REFRESHDELAY);
+ if ((HANDLE)wParam != NULL)
+ return 0;
+
+ if (!lstrcmpA(dbcws->szModule, "ExtraIcons") && !lstrcmpA(dbcws->szSetting,"Slot_Flags")) {
+ BOOL bEnable;
+ switch (dbcws->value.type) {
+ case DBVT_BYTE:
+ bEnable = dbcws->value.bVal != (BYTE)-1;
+ break;
+ case DBVT_WORD:
+ bEnable = dbcws->value.wVal != (WORD)-1;
+ break;
+ case DBVT_DWORD:
+ bEnable = dbcws->value.dVal != (DWORD)-1;
+ break;
+ default:
+ bEnable = -1;
+ break;
+ }
+ if(bEnable == -1)
+ return 0;
+
+ if(bEnable && !hApplyIconHook)
+ hApplyIconHook = HookEvent(ME_CLIST_EXTRA_IMAGE_APPLY, OnCListApplyIcons);
+ else if (!bEnable && hApplyIconHook)
+ UnhookEvent(hApplyIconHook); hApplyIconHook = NULL;
+
+ CallFunctionBuffered(UpdateExtraImages,(LPARAM)bEnable,FALSE,EXTRAIMAGE_REFRESHDELAY);
}
return 0;
}
@@ -347,10 +347,10 @@ VOID SvcFlagsEnableExtraIcons(BYTE bColumn, BOOLEAN bUpdateDB) //init hooks
if (!hApplyIconHook)
- hApplyIconHook = HookEvent(ME_CLIST_EXTRA_IMAGE_APPLY, OnCListApplyIcons);
+ hApplyIconHook = HookEvent(ME_CLIST_EXTRA_IMAGE_APPLY, OnCListApplyIcons);
if (!hSettingChangedHook)
- hSettingChangedHook = HookEvent(ME_DB_CONTACT_SETTINGCHANGED, OnContactSettingChanged);
+ hSettingChangedHook = HookEvent(ME_DB_CONTACT_SETTINGCHANGED, OnContactSettingChanged);
}
}
diff --git a/plugins/UserInfoEx/src/svc_gender.cpp b/plugins/UserInfoEx/src/svc_gender.cpp index 6ac632e6af..68d6f5b8ec 100644 --- a/plugins/UserInfoEx/src/svc_gender.cpp +++ b/plugins/UserInfoEx/src/svc_gender.cpp @@ -108,9 +108,8 @@ static INT OnCListApplyIcons(HANDLE hContact, LPARAM) static INT OnContactSettingChanged(HANDLE hContact, DBCONTACTWRITESETTING* pdbcws)
{
if (hContact && pdbcws && (pdbcws->value.type <= DBVT_BYTE) && !mir_stricmp(pdbcws->szSetting, SET_CONTACT_GENDER))
- {
OnCListApplyIcons(hContact, 0);
- }
+
return 0;
}
diff --git a/plugins/UserInfoEx/src/svc_homepage.cpp b/plugins/UserInfoEx/src/svc_homepage.cpp index b6a6f9ee46..8c3cf5ff3d 100644 --- a/plugins/UserInfoEx/src/svc_homepage.cpp +++ b/plugins/UserInfoEx/src/svc_homepage.cpp @@ -132,9 +132,8 @@ static INT OnContactSettingChanged(HANDLE hContact, DBCONTACTWRITESETTING* pdbcw ((pdbcws->value.type & DBVTF_VARIABLELENGTH) || (pdbcws->value.type == DBVT_DELETED)) &&
(!strncmp(pdbcws->szSetting, SET_CONTACT_HOMEPAGE, 8) ||
!strncmp(pdbcws->szSetting, SET_CONTACT_COMPANY_HOMEPAGE, 15)))
- {
OnCListApplyIcons(hContact, 0);
- }
+
return 0;
}
diff --git a/plugins/UserInfoEx/src/svc_phone.cpp b/plugins/UserInfoEx/src/svc_phone.cpp index 5d4e2f13d1..941003716b 100644 --- a/plugins/UserInfoEx/src/svc_phone.cpp +++ b/plugins/UserInfoEx/src/svc_phone.cpp @@ -134,9 +134,8 @@ static INT OnContactSettingChanged(HANDLE hContact, DBCONTACTWRITESETTING* pdbcw !strcmp(pdbcws->szSetting, SET_CONTACT_COMPANY_PHONE) ||
!strcmp(pdbcws->szSetting, SET_CONTACT_COMPANY_CELLULAR) ||
!strncmp(pdbcws->szSetting, "MyPhone0", 8)))
- {
OnCListApplyIcons(hContact, 0);
- }
+
return 0;
}
diff --git a/plugins/UserInfoEx/src/svc_reminder.cpp b/plugins/UserInfoEx/src/svc_reminder.cpp index 3781145d11..91f19eb804 100644 --- a/plugins/UserInfoEx/src/svc_reminder.cpp +++ b/plugins/UserInfoEx/src/svc_reminder.cpp @@ -766,18 +766,13 @@ static INT OnContactSettingChanged(HANDLE hContact, DBCONTACTWRITESETTING* pdbcw // check metacontact instead of subcontact
if (hMeta)
- {
hContact = hMeta;
- }
+
now.GetLocalTime();
if (!strcmp(pdbcws->szModule, SvcReminderGetMyBirthdayModule()))
- {
CheckContact(hContact, now, evt, FALSE, &LastAnswer);
- }
else
- {
CheckContact(hContact, now, evt, FALSE, 0);
- }
}
return 0;
}
diff --git a/src/core/stdurl/url.cpp b/src/core/stdurl/url.cpp index 0245468725..f1751d74c1 100644 --- a/src/core/stdurl/url.cpp +++ b/src/core/stdurl/url.cpp @@ -105,10 +105,10 @@ static void RestoreUnreadUrlAlerts(void) static int ContactSettingChanged(WPARAM wParam, LPARAM lParam)
{
DBCONTACTWRITESETTING *cws = (DBCONTACTWRITESETTING*)lParam;
- char *szProto;
+ char *szProto = (char*)CallService(MS_PROTO_GETCONTACTBASEPROTO, wParam, 0);
+ if (lstrcmpA(cws->szModule, "CList") && (szProto == NULL || lstrcmpA(cws->szModule, szProto)))
+ return 0;
- szProto = (char*)CallService(MS_PROTO_GETCONTACTBASEPROTO, wParam, 0);
- if (lstrcmpA(cws->szModule, "CList") && (szProto == NULL || lstrcmpA(cws->szModule, szProto))) return 0;
WindowList_Broadcast(hUrlWindowList, DM_UPDATETITLE, 0, 0);
return 0;
}
diff --git a/src/modules/clist/clc.cpp b/src/modules/clist/clc.cpp index ea1e92877e..8f44d7bf5e 100644 --- a/src/modules/clist/clc.cpp +++ b/src/modules/clist/clc.cpp @@ -95,15 +95,14 @@ static int ClcSettingChanged(WPARAM wParam, LPARAM lParam) else {
char *szProto = (char *) CallService(MS_PROTO_GETCONTACTBASEPROTO, wParam, 0);
if (szProto != NULL) {
- char *id = NULL;
if ( !strcmp(cws->szModule, "Protocol") && !strcmp(cws->szSetting, "p"))
cli.pfnClcBroadcast(INTM_PROTOCHANGED, wParam, lParam);
// something is being written to a protocol module
if ( !strcmp(szProto, cws->szModule)) {
// was a unique setting key written?
- id = (char *) CallProtoServiceInt(NULL,szProto, PS_GETCAPS, PFLAG_UNIQUEIDSETTING, 0);
- if ((INT_PTR) id != CALLSERVICE_NOTFOUND && id != NULL && !strcmp(id, cws->szSetting))
+ char *id = (char *) CallProtoServiceInt(NULL,szProto, PS_GETCAPS, PFLAG_UNIQUEIDSETTING, 0);
+ if ((INT_PTR)id != CALLSERVICE_NOTFOUND && id != NULL && !strcmp(id, cws->szSetting))
cli.pfnClcBroadcast(INTM_PROTOCHANGED, wParam, lParam);
}
}
diff --git a/src/modules/extraicons/DefaultExtraIcons.cpp b/src/modules/extraicons/DefaultExtraIcons.cpp index 46262f877d..8115e50b07 100644 --- a/src/modules/extraicons/DefaultExtraIcons.cpp +++ b/src/modules/extraicons/DefaultExtraIcons.cpp @@ -215,24 +215,20 @@ static int SettingChanged(WPARAM wParam, LPARAM lParam) bool isProto = (strcmp(cws->szModule, proto) == 0);
- if (isProto && strcmp(cws->szSetting, "ApparentMode") == 0)
- {
+ if (isProto && strcmp(cws->szSetting, "ApparentMode") == 0) {
SetVisibility(hContact, cws->value.type == DBVT_DELETED ? 0 : cws->value.wVal, TRUE);
return 0;
}
- if (strcmp(cws->szSetting, "Gender") == 0 && (isProto || strcmp(cws->szModule, "UserInfo") == 0))
- {
+ if (strcmp(cws->szSetting, "Gender") == 0 && (isProto || strcmp(cws->szModule, "UserInfo") == 0)) {
SetGender(hContact, cws->value.type == DBVT_DELETED ? 0 : cws->value.bVal, TRUE);
return 0;
}
- for (unsigned int i = 0; i < SIZEOF(infos); i++)
- {
+ for (unsigned int i = 0; i < SIZEOF(infos); i++) {
Info &info = infos[i];
- for (unsigned int j = 0; j < SIZEOF(info.db); j += 2)
- {
+ for (unsigned int j = 0; j < SIZEOF(info.db); j += 2) {
if (info.db[j + 1] == NULL)
break;
if (info.db[j] == NULL && !isProto)
@@ -267,16 +263,13 @@ static int DefaultOnClick(WPARAM wParam, LPARAM lParam, LPARAM param) return 0;
bool found = false;
- for (unsigned int j = 0; !found && j < SIZEOF(info->db); j += 2)
- {
+ for (unsigned int j = 0; !found && j < SIZEOF(info->db); j += 2) {
if (info->db[j + 1] == NULL)
break;
DBVARIANT dbv = { 0 };
- if (!DBGetContactSettingString(hContact, info->db[j] == NULL ? proto : info->db[j], info->db[j+1], &dbv))
- {
- if (!IsEmpty(dbv.pszVal))
- {
+ if (!DBGetContactSettingString(hContact, info->db[j] == NULL ? proto : info->db[j], info->db[j+1], &dbv)) {
+ if (!IsEmpty(dbv.pszVal)) {
info->OnClick(info, dbv.pszVal);
found = true;
}
@@ -293,8 +286,7 @@ static void DBExtraIconsInit() hExtraChat = ExtraIcon_Register("chat_activity", "Chat activity", "ChatActivity");
hExtraVisibility = ExtraIcon_Register("visibility", "Visibility", "AlwaysVis");
hExtraGender = ExtraIcon_Register("gender", "Gender", "gender_male");
- for (unsigned int i = 0; i < SIZEOF(infos); i++)
- {
+ for (unsigned int i = 0; i < SIZEOF(infos); i++) {
Info &info = infos[i];
if (info.OnClick)
info.hExtraIcon = ExtraIcon_Register(info.name, info.desc, info.icon, DefaultOnClick, (LPARAM) &info);
@@ -303,8 +295,7 @@ static void DBExtraIconsInit() }
HANDLE hContact = db_find_first();
- while (hContact != NULL)
- {
+ while (hContact != NULL) {
SetExtraIcons(hContact);
SetVisibility(hContact, -1, FALSE);
SetGender(hContact, -1, FALSE);
@@ -335,8 +326,7 @@ static int ProtocolRebuildIcons(WPARAM wParam, LPARAM lParam) static ProtoInfo *FindProto(const char * proto)
{
- for (unsigned int i = 0; i < protos.size(); i++)
- {
+ for (unsigned int i = 0; i < protos.size(); i++) {
ProtoInfo *pi = &protos[i];
if (strcmp(pi->proto.c_str(), proto) == 0)
return pi;
diff --git a/src/modules/protocols/protoaccs.cpp b/src/modules/protocols/protoaccs.cpp index 49c8a87765..b753f78963 100644 --- a/src/modules/protocols/protoaccs.cpp +++ b/src/modules/protocols/protoaccs.cpp @@ -196,11 +196,9 @@ void WriteDbAccounts() /////////////////////////////////////////////////////////////////////////////////////////
static int OnContactDeleted(WPARAM wParam, LPARAM lParam)
{
- const HANDLE hContact = (HANDLE)wParam;
- if (hContact)
- {
+ HANDLE hContact = (HANDLE)wParam;
+ if (hContact) {
PROTOACCOUNT* pa = Proto_GetAccount(hContact);
-
if (Proto_IsAccountEnabled(pa) && pa->ppro)
pa->ppro->OnEvent(EV_PROTO_ONCONTACTDELETED, wParam, lParam);
}
@@ -209,9 +207,8 @@ static int OnContactDeleted(WPARAM wParam, LPARAM lParam) static int OnDbSettingsChanged(WPARAM wParam, LPARAM lParam)
{
- const HANDLE hContact = (HANDLE)wParam;
- if (hContact)
- {
+ HANDLE hContact = (HANDLE)wParam;
+ if (hContact) {
PROTOACCOUNT* pa = Proto_GetAccount(hContact);
if (Proto_IsAccountEnabled(pa) && pa->ppro)
pa->ppro->OnEvent(EV_PROTO_DBSETTINGSCHANGED, wParam, lParam);
|