summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2013-04-11 16:47:12 +0000
committerGeorge Hazan <george.hazan@gmail.com>2013-04-11 16:47:12 +0000
commit52fe3f7be13509bd336c5efa28b8310a23211034 (patch)
tree70e0948e92b71cd09367545f9655dc343c5cc862 /plugins
parentfa837bfbc2a705947b14f1ce8ba36d996bb11104 (diff)
- Srmm_ModifyIcon helper applied instead of CallService(MS_MSG_MODIFYICON)
- various fixes related to SRMM icons; - code cleaning git-svn-id: http://svn.miranda-ng.org/main/trunk@4426 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins')
-rw-r--r--plugins/CountryFlags/src/extraimg.cpp9
-rw-r--r--plugins/FavContacts/src/main.cpp78
-rw-r--r--plugins/HistorySweeperLight/src/historysweeperlight.h4
-rw-r--r--plugins/HistorySweeperLight/src/main.cpp14
-rw-r--r--plugins/HistorySweeperLight/src/options.cpp31
-rw-r--r--plugins/MirOTR/MirOTR/src/dbfilter.cpp1
-rw-r--r--plugins/MirOTR/MirOTR/src/dllmain.cpp14
-rw-r--r--plugins/MirOTR/MirOTR/src/options.cpp9
-rw-r--r--plugins/MirOTR/MirOTR/src/options.h2
-rw-r--r--plugins/MirOTR/MirOTR/src/svcs_srmm.cpp304
-rwxr-xr-xplugins/New_GPG/src/icons.cpp36
-rw-r--r--plugins/NoHistory/src/dllmain.cpp36
-rw-r--r--plugins/Popup/src/srmm_menu.cpp2
-rw-r--r--plugins/Scriver/src/chat/window.cpp2
-rw-r--r--plugins/Scriver/src/msgdialog.cpp6
-rw-r--r--plugins/Scriver/src/msgs.cpp6
-rw-r--r--plugins/SecureIM/src/crypt_icons.cpp22
-rw-r--r--plugins/SpellChecker/src/spellchecker.cpp30
-rw-r--r--plugins/SpellChecker/src/utils.cpp21
-rw-r--r--plugins/UserInfoEx/src/Flags/svc_flags.cpp44
-rw-r--r--plugins/UserInfoEx/src/Flags/svc_flagsicons.cpp52
-rw-r--r--plugins/UserInfoEx/src/classMAnnivDate.cpp4
-rw-r--r--plugins/UserInfoEx/src/classPsTree.cpp2
-rw-r--r--plugins/UserInfoEx/src/classPsTreeItem.cpp6
-rw-r--r--plugins/UserInfoEx/src/commonheaders.h1
-rw-r--r--plugins/UserInfoEx/src/ctrl_tzcombo.cpp8
-rw-r--r--plugins/UserInfoEx/src/ex_import/classExImContactBase.cpp4
-rw-r--r--plugins/UserInfoEx/src/ex_import/classExImContactXML.cpp12
-rw-r--r--plugins/UserInfoEx/src/ex_import/dlg_ExImProgress.cpp4
-rw-r--r--plugins/UserInfoEx/src/init.cpp5
-rw-r--r--plugins/UserInfoEx/src/mir_db.cpp14
-rw-r--r--plugins/UserInfoEx/src/mir_string.cpp4
-rw-r--r--plugins/UserInfoEx/src/psp_contact.cpp4
-rw-r--r--plugins/UserInfoEx/src/psp_options.cpp6
-rw-r--r--plugins/UserInfoEx/src/psp_origin.cpp2
-rw-r--r--plugins/UserInfoEx/src/svc_contactinfo.cpp8
-rw-r--r--plugins/UserInfoEx/src/svc_refreshci.cpp2
37 files changed, 309 insertions, 500 deletions
diff --git a/plugins/CountryFlags/src/extraimg.cpp b/plugins/CountryFlags/src/extraimg.cpp
index 4300276f53..a2c162ad48 100644
--- a/plugins/CountryFlags/src/extraimg.cpp
+++ b/plugins/CountryFlags/src/extraimg.cpp
@@ -107,7 +107,7 @@ static void __fastcall SetStatusIcon(HANDLE hContact,int countryNumber)
}
else sid.flags = MBF_HIDDEN;
- CallService(MS_MSG_MODIFYICON, (WPARAM)hContact, (LPARAM)&sid);
+ Srmm_ModifyIcon(hContact, &sid);
if (sid.hIcon)
Skin_ReleaseIcon(sid.hIcon);
@@ -119,7 +119,7 @@ static void __fastcall UnsetStatusIcon(HANDLE hContact)
StatusIconData sid = { sizeof(sid) };
sid.szModule = MODULENAME;
sid.flags = MBF_HIDDEN;
- CallService(MS_MSG_MODIFYICON, (WPARAM)hContact, (LPARAM)&sid);
+ Srmm_ModifyIcon(hContact, &sid);
}
static int MsgWndEvent(WPARAM wParam,LPARAM lParam)
@@ -165,9 +165,8 @@ static void CALLBACK UpdateStatusIcons(LPARAM lParam)
static int StatusIconsChanged(WPARAM wParam,LPARAM lParam)
{
- if (ServiceExists(MS_MSG_MODIFYICON))
- if ( db_get_b(NULL, MODULENAME, "ShowStatusIconFlag", SETTING_SHOWSTATUSICONFLAG_DEFAULT))
- CallFunctionBuffered(UpdateStatusIcons, 0, FALSE, STATUSICON_REFRESHDELAY);
+ if ( db_get_b(NULL, MODULENAME, "ShowStatusIconFlag", SETTING_SHOWSTATUSICONFLAG_DEFAULT))
+ CallFunctionBuffered(UpdateStatusIcons, 0, FALSE, STATUSICON_REFRESHDELAY);
return 0;
}
diff --git a/plugins/FavContacts/src/main.cpp b/plugins/FavContacts/src/main.cpp
index 5c09f9363b..f49a580c55 100644
--- a/plugins/FavContacts/src/main.cpp
+++ b/plugins/FavContacts/src/main.cpp
@@ -793,9 +793,8 @@ static LRESULT CALLBACK MenuHostWndProc(HWND hwnd, UINT message, WPARAM wParam,
{
static HANDLE hContact = NULL;
- switch (message)
- {
- case WM_MEASUREITEM:
+ switch (message) {
+ case WM_MEASUREITEM:
{
LPMEASUREITEMSTRUCT lpmis = (LPMEASUREITEMSTRUCT)lParam;
@@ -807,7 +806,7 @@ static LRESULT CALLBACK MenuHostWndProc(HWND hwnd, UINT message, WPARAM wParam,
return sttMeasureItem(lpmis);
}
- case WM_DRAWITEM:
+ case WM_DRAWITEM:
{
LPDRAWITEMSTRUCT lpdis = (LPDRAWITEMSTRUCT)lParam;
@@ -819,20 +818,17 @@ static LRESULT CALLBACK MenuHostWndProc(HWND hwnd, UINT message, WPARAM wParam,
return sttDrawItem(lpdis);
}
- case WM_MENUCHAR:
+ case WM_MENUCHAR:
{
while (GetMenuItemCount((HMENU)lParam) > 1)
RemoveMenu((HMENU)lParam, 1, MF_BYPOSITION);
- if (LOWORD(wParam) == VK_BACK)
- {
+ if (LOWORD(wParam) == VK_BACK) {
if (int l = lstrlen(g_filter))
g_filter[l-1] = 0;
- } else
- if (_istalnum(LOWORD(wParam)))
- {
- if (lstrlen(g_filter) < SIZEOF(g_filter)-1)
- {
+ }
+ else if (_istalnum(LOWORD(wParam))) {
+ if (lstrlen(g_filter) < SIZEOF(g_filter)-1) {
TCHAR s[] = { LOWORD(wParam), 0 };
lstrcat(g_filter, s);
}
@@ -840,8 +836,7 @@ static LRESULT CALLBACK MenuHostWndProc(HWND hwnd, UINT message, WPARAM wParam,
int nRecent = 0;
int maxRecent = g_Options.wMaxRecent ? g_Options.wMaxRecent : 10;
- for (int i = 0; nRecent < maxRecent; ++i)
- {
+ for (int i = 0; nRecent < maxRecent; ++i) {
HANDLE hContact = g_contactCache->get(i);
if (!hContact) break;
if (!g_contactCache->filter(i, g_filter)) continue;
@@ -852,10 +847,9 @@ static LRESULT CALLBACK MenuHostWndProc(HWND hwnd, UINT message, WPARAM wParam,
return MAKELRESULT(1, MNC_SELECT);
}
- case WM_MENURBUTTONUP:
+ case WM_MENURBUTTONUP:
{
- MENUITEMINFO mii = {0};
- mii.cbSize = sizeof(mii);
+ MENUITEMINFO mii = { sizeof(mii) };
mii.fMask = MIIM_DATA;
GetMenuItemInfo((HMENU)lParam, wParam, TRUE, &mii);
HANDLE hContact = (HANDLE)mii.dwItemData;
@@ -897,18 +891,15 @@ int sttShowMenu(bool centered)
if (g_Options.bUseColumns) g_maxItemWidth /= favList.groupCount();
prevGroup = NULL;
- for (i = 0; i < favList.getCount(); ++i)
- {
+ for (i = 0; i < favList.getCount(); ++i) {
hContact = favList[i]->getHandle();
MEASUREITEMSTRUCT mis = {0};
mis.CtlID = 0;
mis.CtlType = ODT_MENU;
- if (!prevGroup || lstrcmp(prevGroup, favList[i]->getGroup()))
- {
- if (prevGroup && g_Options.bUseColumns)
- {
+ if (!prevGroup || lstrcmp(prevGroup, favList[i]->getGroup())) {
+ if (prevGroup && g_Options.bUseColumns) {
szMenu.cx += szColumn.cx;
szMenu.cy = max(szMenu.cy, szColumn.cy);
szColumn.cx = szColumn.cy = 0;
@@ -948,25 +939,18 @@ int sttShowMenu(bool centered)
}
POINT pt;
-
-// RECT rc;
-// GetMenuItemRect(g_hwndMenuHost, hMenu, 1, &rc);
-
- if (centered)
- {
+ if (centered) {
if ((pt.x = (GetSystemMetrics(SM_CXSCREEN) - szMenu.cx) / 2) < 0) pt.x = 0;
if ((pt.y = (GetSystemMetrics(SM_CYSCREEN) - szMenu.cy) / 2) < 0) pt.y = 0;
- } else
- {
- GetCursorPos(&pt);
}
+ else GetCursorPos(&pt);
HWND hwndSave = GetForegroundWindow();
SetForegroundWindow(g_hwndMenuHost);
hContact = NULL;
g_filter[0] = 0;
- if (int res = TrackPopupMenu(hMenu, TPM_RETURNCMD, pt.x, pt.y, 0, g_hwndMenuHost, NULL))
- {
+
+ if (int res = TrackPopupMenu(hMenu, TPM_RETURNCMD, pt.x, pt.y, 0, g_hwndMenuHost, NULL)) {
MENUITEMINFO mii = {0};
mii.cbSize = sizeof(mii);
mii.fMask = MIIM_DATA;
@@ -1008,8 +992,7 @@ int ProcessSrmmEvent( WPARAM wParam, LPARAM lParam )
{
MessageWindowEventData *event = (MessageWindowEventData *)lParam;
- if ( event->uType == MSG_WINDOW_EVT_OPEN )
- {
+ if (event->uType == MSG_WINDOW_EVT_OPEN) {
if ( !hDialogsList )
hDialogsList = (HANDLE)CallService(MS_UTILS_ALLOCWINDOWLIST, 0, 0);
WindowList_Add(hDialogsList, event->hwndWindow, event->hContact);
@@ -1019,10 +1002,9 @@ int ProcessSrmmEvent( WPARAM wParam, LPARAM lParam )
sid.cbSize = sizeof(sid);
sid.szModule = "FavContacts";
sid.flags = fav ? 0 : MBF_DISABLED;
- CallService(MS_MSG_MODIFYICON, (WPARAM)event->hContact, (LPARAM)&sid);
+ Srmm_ModifyIcon(event->hContact, &sid);
- if (event->hContact == hContactToActivate)
- {
+ if (event->hContact == hContactToActivate) {
HWND hwndRoot = event->hwndWindow;
while (HWND hwndParent = GetParent(hwndRoot))
hwndRoot = hwndParent;
@@ -1051,23 +1033,20 @@ int ProcessSrmmIconClick( WPARAM wParam, LPARAM lParam )
if (lstrcmpA(sicd->szModule, "FavContacts")) return 0;
HANDLE hContact = (HANDLE)wParam;
- if (!hContact) return 0;
+ if (!hContact)
+ return 0;
- if (sicd->flags & MBCF_RIGHTBUTTON)
- {
+ if (sicd->flags & MBCF_RIGHTBUTTON) {
BYTE fav = !db_get_b(hContact, "FavContacts", "IsFavourite", 0);
db_set_b(hContact, "FavContacts", "IsFavourite", fav);
if (fav) CallService(MS_AV_GETAVATARBITMAP, (WPARAM)hContact, 0);
- StatusIconData sid = {0};
- sid.cbSize = sizeof(sid);
+ StatusIconData sid = { sizeof(sid) };
sid.szModule = "FavContacts";
sid.flags = fav ? 0 : MBF_DISABLED;
- CallService(MS_MSG_MODIFYICON, (WPARAM)hContact, (LPARAM)&sid);
- } else
- {
- sttShowMenu(false);
+ Srmm_ModifyIcon(hContact, &sid);
}
+ else sttShowMenu(false);
return 0;
}
@@ -1076,7 +1055,6 @@ int ProcessSrmmIconClick( WPARAM wParam, LPARAM lParam )
// Options
static void sttResetListOptions(HWND hwndList)
{
- int i;
SendMessage(hwndList,CLM_SETBKBITMAP,0,(LPARAM)(HBITMAP)NULL);
SendMessage(hwndList,CLM_SETBKCOLOR,GetSysColor(COLOR_WINDOW),0);
SendMessage(hwndList,CLM_SETGREYOUTFLAGS,0,0);
@@ -1084,7 +1062,7 @@ static void sttResetListOptions(HWND hwndList)
SendMessage(hwndList,CLM_SETINDENT,10,0);
SendMessage(hwndList,CLM_SETHIDEEMPTYGROUPS,1,0);
SendMessage(hwndList,CLM_SETHIDEOFFLINEROOT,1,0);
- for (i = 0; i <= FONTID_MAX; ++i)
+ for (int i = 0; i <= FONTID_MAX; ++i)
SendMessage(hwndList, CLM_SETTEXTCOLOR, i, GetSysColor(COLOR_WINDOWTEXT));
}
diff --git a/plugins/HistorySweeperLight/src/historysweeperlight.h b/plugins/HistorySweeperLight/src/historysweeperlight.h
index 407f3973d2..9f820ec439 100644
--- a/plugins/HistorySweeperLight/src/historysweeperlight.h
+++ b/plugins/HistorySweeperLight/src/historysweeperlight.h
@@ -49,8 +49,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
extern HINSTANCE hInst;
// options.c
-extern const char* time_stamp_strings[];
-extern const char* keep_strings[];
+extern char* time_stamp_strings[];
+extern char* keep_strings[];
int HSOptInitialise(WPARAM wParam, LPARAM lParam);
void InitIcons(void);
void ReleaseIconEx(const char* name);
diff --git a/plugins/HistorySweeperLight/src/main.cpp b/plugins/HistorySweeperLight/src/main.cpp
index b3653d8a9a..75f8d65143 100644
--- a/plugins/HistorySweeperLight/src/main.cpp
+++ b/plugins/HistorySweeperLight/src/main.cpp
@@ -59,14 +59,14 @@ int OnIconPressed(WPARAM wParam, LPARAM lParam)
sid.szModule = ModuleName;
sid.dwId = nh;
sid.flags = MBF_HIDDEN;
- CallService(MS_MSG_MODIFYICON, (WPARAM)hContact, (LPARAM)&sid);
+ Srmm_ModifyIcon(hContact, &sid);
nh = (nh + 1) % 4;
db_set_b((HANDLE)wParam, ModuleName, "SweepHistory", (BYTE)nh);
sid.dwId = nh;
sid.flags = 0;
- CallService(MS_MSG_MODIFYICON, (WPARAM)hContact, (LPARAM)&sid);
+ Srmm_ModifyIcon(hContact, &sid);
}
return 0;
}
@@ -84,9 +84,9 @@ int OnModulesLoaded(WPARAM wParam, LPARAM lParam)
if (sweep == 0)
sid.szTooltip = LPGEN("Keep all events");
else if (sweep == 1)
- sid.szTooltip = (char*)time_stamp_strings[db_get_b(NULL, ModuleName, "StartupShutdownOlder", 0)];
+ sid.szTooltip = time_stamp_strings[db_get_b(NULL, ModuleName, "StartupShutdownOlder", 0)];
else if (sweep == 2)
- sid.szTooltip = (char*)keep_strings[db_get_b(NULL, ModuleName, "StartupShutdownKeep", 0)];
+ sid.szTooltip = keep_strings[db_get_b(NULL, ModuleName, "StartupShutdownKeep", 0)];
else if (sweep == 3)
sid.szTooltip = LPGEN("Delete all events");
@@ -95,13 +95,13 @@ int OnModulesLoaded(WPARAM wParam, LPARAM lParam)
sid.dwId = 1;
sid.hIcon = LoadIconEx("act1");
- sid.szTooltip = (char*)time_stamp_strings[db_get_b(NULL, ModuleName, "StartupShutdownOlder", 0)];
+ sid.szTooltip = time_stamp_strings[db_get_b(NULL, ModuleName, "StartupShutdownOlder", 0)];
sid.flags = MBF_HIDDEN;
Srmm_AddIcon(&sid);
sid.dwId = 2;
sid.hIcon = LoadIconEx("act2");
- sid.szTooltip = (char*)keep_strings[db_get_b(NULL, ModuleName, "StartupShutdownKeep", 0)];
+ sid.szTooltip = keep_strings[db_get_b(NULL, ModuleName, "StartupShutdownKeep", 0)];
sid.flags = MBF_HIDDEN;
Srmm_AddIcon(&sid);
@@ -123,7 +123,7 @@ int OnModulesLoaded(WPARAM wParam, LPARAM lParam)
for(i = 0; i < 4; i++) {
sid.dwId = i;
sid.flags = (sweep == i) ? 0 : MBF_HIDDEN;
- CallService(MS_MSG_MODIFYICON, (WPARAM)hContact, (LPARAM)&sid);
+ Srmm_ModifyIcon(hContact, &sid);
}
}
diff --git a/plugins/HistorySweeperLight/src/options.cpp b/plugins/HistorySweeperLight/src/options.cpp
index 06686fe2d6..436fecd86f 100644
--- a/plugins/HistorySweeperLight/src/options.cpp
+++ b/plugins/HistorySweeperLight/src/options.cpp
@@ -22,7 +22,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "historysweeperlight.h"
// Time Stamps strings
-const char* time_stamp_strings[] =
+char* time_stamp_strings[] =
{
LPGEN("Delete older than 1 day"),
LPGEN("Delete older than 3 days"),
@@ -34,7 +34,7 @@ const char* time_stamp_strings[] =
LPGEN("Delete older than 1 year (365 days)")
};
-const char* keep_strings[] =
+char* keep_strings[] =
{
LPGEN("Keep 1 last event"),
LPGEN("Keep 2 last events"),
@@ -179,14 +179,13 @@ void SaveSettings(HWND hwndDlg)
st = SendMessage(hwndList, CLM_GETEXTRAIMAGE, (WPARAM)hItem, 0);
if ( st != 0 ) db_set_b(hContact, ModuleName, "SweepHistory", (BYTE)st);
- else db_unset(hContact, ModuleName, "SweepHistory");
+ else db_unset(hContact, ModuleName, "SweepHistory");
// set per-contact icons in status bar
- for(i = 0; i < 4; i++)
- {
+ for(i = 0; i < 4; i++) {
sid.dwId = i;
sid.flags = (st == i) ? 0 : MBF_HIDDEN;
- CallService(MS_MSG_MODIFYICON, (WPARAM)hContact, (LPARAM)&sid);
+ Srmm_ModifyIcon(hContact, &sid);
}
}
@@ -194,20 +193,20 @@ void SaveSettings(HWND hwndDlg)
st = db_get_b(NULL, ModuleName, "SweepHistory", 0);
sid.dwId = 0;
- if (st == 0) sid.szTooltip = Translate("Keep all events");
- else if (st == 1) sid.szTooltip = Translate(time_stamp_strings[db_get_b(NULL, ModuleName, "StartupShutdownOlder", 0)]);
- else if (st == 2) sid.szTooltip = Translate(keep_strings[db_get_b(NULL, ModuleName, "StartupShutdownKeep", 0)]);
- else if (st == 3) sid.szTooltip = Translate("Delete all events");
- CallService(MS_MSG_MODIFYICON, 0, (LPARAM)&sid);
+ if (st == 0) sid.szTooltip = LPGEN("Keep all events");
+ else if (st == 1) sid.szTooltip = LPGEN(time_stamp_strings[db_get_b(NULL, ModuleName, "StartupShutdownOlder", 0)]);
+ else if (st == 2) sid.szTooltip = LPGEN(keep_strings[db_get_b(NULL, ModuleName, "StartupShutdownKeep", 0)]);
+ else if (st == 3) sid.szTooltip = LPGEN("Delete all events");
+ Srmm_ModifyIcon(NULL, &sid);
sid.dwId = 1;
- sid.szTooltip = Translate(time_stamp_strings[db_get_b(NULL, ModuleName, "StartupShutdownOlder", 0)]);
- CallService(MS_MSG_MODIFYICON, 0, (LPARAM)&sid);
+ sid.szTooltip = time_stamp_strings[db_get_b(NULL, ModuleName, "StartupShutdownOlder", 0)];
+ Srmm_ModifyIcon(NULL, &sid);
sid.dwId = 2;
- sid.szTooltip = Translate(keep_strings[db_get_b(NULL, ModuleName, "StartupShutdownKeep", 0)]);
- CallService(MS_MSG_MODIFYICON, 0, (LPARAM)&sid);
-}//SaveSettings
+ sid.szTooltip = keep_strings[db_get_b(NULL, ModuleName, "StartupShutdownKeep", 0)];
+ Srmm_ModifyIcon(NULL, &sid);
+}
INT_PTR CALLBACK DlgProcHSOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
{
diff --git a/plugins/MirOTR/MirOTR/src/dbfilter.cpp b/plugins/MirOTR/MirOTR/src/dbfilter.cpp
index 790de635c6..e3d992817a 100644
--- a/plugins/MirOTR/MirOTR/src/dbfilter.cpp
+++ b/plugins/MirOTR/MirOTR/src/dbfilter.cpp
@@ -246,7 +246,6 @@ int WindowEvent(WPARAM wParam, LPARAM lParam) {
}
if(mwd->uType != MSG_WINDOW_EVT_OPEN) return 0;
- if (!options.bHaveSRMMIcons) return 0;
HANDLE hContact = mwd->hContact, hTemp;
if(options.bHaveMetaContacts && (hTemp = (HANDLE)CallService(MS_MC_GETMOSTONLINECONTACT, (WPARAM)hContact, 0)) != 0)
diff --git a/plugins/MirOTR/MirOTR/src/dllmain.cpp b/plugins/MirOTR/MirOTR/src/dllmain.cpp
index 84499c11c6..f8eb373fec 100644
--- a/plugins/MirOTR/MirOTR/src/dllmain.cpp
+++ b/plugins/MirOTR/MirOTR/src/dllmain.cpp
@@ -60,20 +60,6 @@ int ModulesLoaded(WPARAM wParam, LPARAM lParam) {
SaveOptions();
MessageBox(0, TranslateT(LANG_OTR_SECUREIM_TEXT), TranslateT(LANG_OTR_SECUREIM_TITLE), 0x30);
}
- if (!options.bHaveSRMMIcons) {
- MessageBox(NULL, TranslateT("OTR Info"), TranslateT("Your SRMM plugin does not support status icons. Not all OTR-functions are available!"), 0x30);
- }
-
- // HookEvent(ME_OPT_INITIALISE, OptInit);
-
- // hook setting changed to monitor status
- //hSettingChanged = HookEvent(ME_DB_CONTACT_SETTINGCHANGED, SettingChanged);
-
- // hook status mode changes to terminate sessions when we go offline
- // (this would be hooked as the ME_CLIST_STATUSMODECHANGE handler except that event is sent *after* the proto goes offline)
- // (instead, it's called from the SettingChanged handler for protocol status db setting changes)
- //HookEvent(ME_CLIST_STATUSMODECHANGE, StatusModeChange);
-
return 0;
}
diff --git a/plugins/MirOTR/MirOTR/src/options.cpp b/plugins/MirOTR/MirOTR/src/options.cpp
index 41ea5f8209..f4a04006f3 100644
--- a/plugins/MirOTR/MirOTR/src/options.cpp
+++ b/plugins/MirOTR/MirOTR/src/options.cpp
@@ -89,11 +89,10 @@ void LoadOptions() {
options.end_offline = (db_get_b(0, MODULENAME, "EndOffline", 1) == 1);
options.end_window_close = (db_get_b(0, MODULENAME, "EndWindowClose", 0) == 1);
- options.bHaveMetaContacts = 0!=ServiceExists(MS_MC_GETMETACONTACT);
- options.bHavePopups = 0!=ServiceExists(MS_POPUP_ADDPOPUPT) && ServiceExists(MS_POPUP_SHOWMESSAGE);
- options.bHaveSRMMIcons = 0!=ServiceExists(MS_MSG_MODIFYICON);
- options.bHaveSecureIM = 0!=ServiceExists("SecureIM/IsContactSecured");
- options.bHaveButtonsBar = 0!=ServiceExists(MS_BB_ADDBUTTON);
+ options.bHaveMetaContacts = 0 != ServiceExists(MS_MC_GETMETACONTACT);
+ options.bHavePopups = 0 != ServiceExists(MS_POPUP_ADDPOPUPT) && ServiceExists(MS_POPUP_SHOWMESSAGE);
+ options.bHaveSecureIM = 0 != ServiceExists("SecureIM/IsContactSecured");
+ options.bHaveButtonsBar = 0 != ServiceExists(MS_BB_ADDBUTTON);
LoadFilenames();
}
diff --git a/plugins/MirOTR/MirOTR/src/options.h b/plugins/MirOTR/MirOTR/src/options.h
index e849f50581..7625eef247 100644
--- a/plugins/MirOTR/MirOTR/src/options.h
+++ b/plugins/MirOTR/MirOTR/src/options.h
@@ -32,7 +32,7 @@ typedef struct {
bool end_offline, end_window_close;
// temporary options
- bool bHaveMetaContacts, bHavePopups, bHaveSRMMIcons, bHaveSecureIM, bHaveButtonsBar;
+ bool bHaveMetaContacts, bHavePopups, bHaveSecureIM, bHaveButtonsBar;
} Options;
diff --git a/plugins/MirOTR/MirOTR/src/svcs_srmm.cpp b/plugins/MirOTR/MirOTR/src/svcs_srmm.cpp
index 854619d689..f203f7d246 100644
--- a/plugins/MirOTR/MirOTR/src/svcs_srmm.cpp
+++ b/plugins/MirOTR/MirOTR/src/svcs_srmm.cpp
@@ -1,38 +1,10 @@
#include "stdafx.h"
-HANDLE hEventIconPressed;
HICON hIconNotSecure, hIconFinished, hIconPrivate, hIconUnverified;
BBButton OTRButton;
-/* Plugin init and deinit */
-// int WindowEvent(WPARAM wParam, LPARAM lParam) {
-// MessageWindowEventData *mwd = (MessageWindowEventData *)lParam;
-//
-// if(mwd->uType == MSG_WINDOW_EVT_CLOSE && options.end_window_close) {
-// FinishSession(mwd->hContact);
-// return 0;
-// }
-//
-// if(mwd->uType != MSG_WINDOW_EVT_OPEN) return 0;
-// if (!options.bHaveSRMMIcons) return 0;
-//
-// HANDLE hContact = mwd->hContact, hTemp;
-// if(options.bHaveMetaContacts && (hTemp = (HANDLE)CallService(MS_MC_GETMOSTONLINECONTACT, (WPARAM)hContact, 0)) != 0)
-// hContact = hTemp;
-//
-// if (!CallService(MS_PROTO_ISPROTOONCONTACT, (WPARAM)hContact, (LPARAM)MODULENAME))
-// return 0;
-//
-// lib_cs_lock();
-// ConnContext *context = otrl_context_find_miranda(otr_user_state, hContact);
-// lib_cs_unlock();
-//
-// SetEncryptionStatus(hContact, otr_context_get_trust(context));
-//
-// return 0;
-// }
-
-int SVC_IconPressed(WPARAM wParam, LPARAM lParam) {
+int SVC_IconPressed(WPARAM wParam, LPARAM lParam)
+{
HANDLE hContact = (HANDLE)wParam;
StatusIconClickData *sicd = (StatusIconClickData *)lParam;
if(sicd->cbSize < (int)sizeof(StatusIconClickData))
@@ -43,184 +15,84 @@ int SVC_IconPressed(WPARAM wParam, LPARAM lParam) {
if(proto && db_get_b(hContact, proto, "ChatRoom", 0))
return 0;
ShowOTRMenu(hContact, sicd->clickLocation);
- /*
- HMENU hMenu = LoadMenu(hInst, MAKEINTRESOURCE(IDR_CONTEXT));
- CallService(MS_LANGPACK_TRANSLATEMENU, (WPARAM)hMenu, 0);
- TrustLevel level = (TrustLevel) db_get_dw(hContact, MODULENAME, "TrustLevel", TRUST_NOT_PRIVATE);
- MENUITEMINFO minfo = {0};
- minfo.cbSize = sizeof(MENUITEMINFO);
- minfo.fMask = MIIM_STRING|MIIM_STATE|MIIM_BITMAP;
- minfo.fState = MF_DISABLED;
-
- HWND wnd = GetFocus();
- HDC dc = GetDC(wnd), hdc = CreateCompatibleDC(dc);
- HBITMAP bmpIconPrivate = CreateCompatibleBitmap(dc, 16, 16);
- HGDIOBJ old = SelectObject(hdc, bmpIconPrivate);
- DrawIconEx(hdc, 0, 0, hIconPrivate,16, 16, 0, GetSysColorBrush(COLOR_MENU), DI_NORMAL);
-
- HBITMAP bmpIconUnverified = CreateCompatibleBitmap(dc, 16, 16);
- SelectObject(hdc, bmpIconUnverified);
- DrawIconEx(hdc, 0, 0, hIconUnverified,16, 16, 0, GetSysColorBrush(COLOR_MENU), DI_NORMAL);
-
- HBITMAP bmpIconFinished = CreateCompatibleBitmap(dc, 16, 16);
- SelectObject(hdc, bmpIconFinished);
- DrawIconEx(hdc, 0, 0, hIconFinished,16, 16, 0, GetSysColorBrush(COLOR_MENU), DI_NORMAL);
-
- HBITMAP bmpIconNotSecure = CreateCompatibleBitmap(dc, 16, 16);
- SelectObject(hdc, bmpIconNotSecure);
- DrawIconEx(hdc, 0, 0, hIconNotSecure,16, 16, 0, GetSysColorBrush(COLOR_MENU), DI_NORMAL);
-
- switch (level) {
- case TRUST_PRIVATE:
- minfo.hbmpItem = bmpIconPrivate;
- minfo.dwTypeData = TranslateT(LANG_STATUS_PRIVATE);
- break;
- case TRUST_UNVERIFIED:
- minfo.hbmpItem = bmpIconUnverified;
- minfo.dwTypeData = TranslateT(LANG_STATUS_UNVERIFIED);
- break;
- case TRUST_FINISHED:
- minfo.hbmpItem = bmpIconFinished;
- minfo.dwTypeData = TranslateT(LANG_STATUS_FINISHED);
- break;
- default:
- minfo.hbmpItem = bmpIconNotSecure;
- minfo.dwTypeData = TranslateT(LANG_STATUS_DISABLED);
- }
-
- SelectObject(hdc, old);
- DeleteDC(hdc);
- ReleaseDC(wnd, dc);
-
- SetMenuItemInfo(hMenu, IDM_OTR_STATUS, FALSE, &minfo);
-
- minfo.fMask = MIIM_STATE|MIIM_BITMAP;
- minfo.fState = (level==TRUST_NOT_PRIVATE)?MF_ENABLED:MF_GRAYED;
- minfo.hbmpItem = bmpIconUnverified;
- SetMenuItemInfo(hMenu, IDM_OTR_START, FALSE, &minfo);
-
- minfo.fState = (level==TRUST_NOT_PRIVATE)?MF_GRAYED:MF_ENABLED;
- minfo.hbmpItem = bmpIconNotSecure;
- SetMenuItemInfo(hMenu, IDM_OTR_STOP, FALSE, &minfo);
-
- minfo.fState = (level==TRUST_NOT_PRIVATE)?MF_GRAYED:MF_ENABLED;
- minfo.hbmpItem = bmpIconFinished;
- SetMenuItemInfo(hMenu, IDM_OTR_REFRESH, FALSE, &minfo);
-
- minfo.fState = (level==TRUST_NOT_PRIVATE||level==TRUST_FINISHED)?MF_GRAYED:MF_ENABLED;
- minfo.hbmpItem = bmpIconPrivate;
- SetMenuItemInfo(hMenu, IDM_OTR_VERIFY, FALSE, &minfo);
-
- switch ( (DWORD) TrackPopupMenu(GetSubMenu(hMenu, 0), TPM_NONOTIFY|TPM_RETURNCMD, sicd->clickLocation.x, sicd->clickLocation.y, 0, GetFocus(), 0) )
- {
- case IDM_OTR_START:
- SVC_StartOTR(wParam, 0);
- break;
- case IDM_OTR_REFRESH:
- SVC_RefreshOTR(wParam, 0);
- break;
- case IDM_OTR_STOP:
- SVC_StopOTR(wParam, 0);
- break;
- case IDM_OTR_VERIFY:
- ConnContext *context = otrl_context_find_miranda(otr_user_state, (HANDLE)wParam);
- if (context) VerifyContextDialog(context);
- break;
- }
- DeleteObject(bmpIconPrivate);
- DeleteObject(bmpIconFinished);
- DeleteObject(bmpIconNotSecure);
- DeleteObject(bmpIconUnverified);
- */
}
return 0;
}
// set SRMM icon status, if applicable
-void SetEncryptionStatus(HANDLE hContact, TrustLevel level) {
- //char dbg_msg[2048];
- //dbg_msg[0] = 0;
-
- //strcat(dbg_msg, "Set encyption status: ");
- //strcat(dbg_msg, (encrypted ? "true" : "false"));
-
+void SetEncryptionStatus(HANDLE hContact, TrustLevel level)
+{
char *proto = GetContactProto(hContact);
bool chat_room = (proto && db_get_b(hContact, proto, "ChatRoom", 0));
- // if (!chat_room) db_set_b(hContact, MODULENAME, "Encrypted", (encrypted ? 1 : 0));
+ BBButton button = OTRButton;
- if(options.bHaveSRMMIcons || options.bHaveButtonsBar) {
- //strcat(dbg_msg, "\nchanging icon");
- BBButton button = OTRButton;
- StatusIconData sid = {0}, sid2={0};
- sid.cbSize = sizeof(sid);
- sid.szModule = MODULENAME;
- sid.dwId = 0;
- sid.flags = MBF_HIDDEN;
+ StatusIconData sid = { sizeof(sid) }, sid2 = { sizeof(sid) };
+ sid.szModule = MODULENAME;
+ sid.dwId = 0;
+ sid.flags = MBF_HIDDEN;
- sid2.cbSize = sid.cbSize;
- sid2.szModule = MODULENAME;
- sid2.dwId = 1;
- sid2.flags = MBF_HIDDEN;
- if (!chat_room) {
- switch (level) {
- case TRUST_FINISHED:
- sid.flags = 0;
- button.ptszTooltip = TranslateT(LANG_STATUS_FINISHED);
- button.hIcon = GetIconHandle(ICON_FINISHED);
- break;
- case TRUST_UNVERIFIED:
- sid2.flags = MBF_DISABLED;
- button.ptszTooltip = TranslateT(LANG_STATUS_UNVERIFIED);
- button.hIcon = GetIconHandle(ICON_UNVERIFIED);
- break;
- case TRUST_PRIVATE:
- sid2.flags = 0;
- button.ptszTooltip = TranslateT(LANG_STATUS_PRIVATE);
- button.hIcon = GetIconHandle(ICON_PRIVATE);
- break;
- default:
- sid.flags = MBF_DISABLED;
- button.ptszTooltip = TranslateT(LANG_STATUS_DISABLED);
- button.hIcon = GetIconHandle(ICON_NOT_PRIVATE);
- break;
- }
- button.bbbFlags = 0;
- } else {
- button.bbbFlags = BBSF_HIDDEN;
- }
- if (options.bHaveSRMMIcons) {
- CallService(MS_MSG_MODIFYICON, (WPARAM)hContact, (LPARAM)&sid);
- CallService(MS_MSG_MODIFYICON, (WPARAM)hContact, (LPARAM)&sid2);
+ sid2.szModule = MODULENAME;
+ sid2.dwId = 1;
+ sid2.flags = MBF_HIDDEN;
+
+ if (!chat_room) {
+ switch (level) {
+ case TRUST_FINISHED:
+ sid.flags = 0;
+ button.ptszTooltip = TranslateT(LANG_STATUS_FINISHED);
+ button.hIcon = GetIconHandle(ICON_FINISHED);
+ break;
+ case TRUST_UNVERIFIED:
+ sid2.flags = MBF_DISABLED;
+ button.ptszTooltip = TranslateT(LANG_STATUS_UNVERIFIED);
+ button.hIcon = GetIconHandle(ICON_UNVERIFIED);
+ break;
+ case TRUST_PRIVATE:
+ sid2.flags = 0;
+ button.ptszTooltip = TranslateT(LANG_STATUS_PRIVATE);
+ button.hIcon = GetIconHandle(ICON_PRIVATE);
+ break;
+ default:
+ sid.flags = MBF_DISABLED;
+ button.ptszTooltip = TranslateT(LANG_STATUS_DISABLED);
+ button.hIcon = GetIconHandle(ICON_NOT_PRIVATE);
+ break;
}
- if (options.bHaveButtonsBar) CallService(MS_BB_SETBUTTONSTATE, (WPARAM)hContact, (LPARAM)&button);
- db_set_dw(hContact, MODULENAME, "TrustLevel", level);
+ button.bbbFlags = 0;
+ }
+ else button.bbbFlags = BBSF_HIDDEN;
+
+ Srmm_ModifyIcon(hContact, &sid);
+ Srmm_ModifyIcon(hContact, &sid2);
+
+ if (options.bHaveButtonsBar) CallService(MS_BB_SETBUTTONSTATE, (WPARAM)hContact, (LPARAM)&button);
+ db_set_dw(hContact, MODULENAME, "TrustLevel", level);
- if (!chat_room && options.bHaveMetaContacts) {
- HANDLE hMeta = (HANDLE)CallService(MS_MC_GETMETACONTACT, (WPARAM)hContact, 0);
- HANDLE hMostOnline = (HANDLE)CallService(MS_MC_GETMOSTONLINECONTACT, (WPARAM)hMeta, 0);
- if(hMeta && hContact == hMostOnline) {
- //strcat(dbg_msg, "\nrecursing for meta");
- SetEncryptionStatus(hMeta, level);
- }
- else if(hMeta) {
+ if (!chat_room && options.bHaveMetaContacts) {
+ HANDLE hMeta = (HANDLE)CallService(MS_MC_GETMETACONTACT, (WPARAM)hContact, 0);
+ HANDLE hMostOnline = (HANDLE)CallService(MS_MC_GETMOSTONLINECONTACT, (WPARAM)hMeta, 0);
+ if(hMeta && hContact == hMostOnline)
+ SetEncryptionStatus(hMeta, level);
+ else if(hMeta) {
/* in case the new most online contact has changed
- (e.g. when the otr subcontact goes offline) */
+ (e.g. when the otr subcontact goes offline) */
ConnContext *context = otrl_context_find_miranda(otr_user_state, hMostOnline);
TrustLevel encrypted = otr_context_get_trust(context);
SetEncryptionStatus(hMeta, encrypted);
- }
}
}
- //PUShowMessage(dbg_msg, SM_NOTIFY);
}
-int SVC_ButtonsBarLoaded(WPARAM, LPARAM) {
+int SVC_ButtonsBarLoaded(WPARAM, LPARAM)
+{
CallService(MS_BB_ADDBUTTON, 0, (LPARAM)&OTRButton);
return 0;
}
-int SVC_ButtonsBarPressed(WPARAM w, LPARAM l) {
+
+int SVC_ButtonsBarPressed(WPARAM w, LPARAM l)
+{
CustomButtonClickData* cbcd = (CustomButtonClickData *)l;
if (cbcd->cbSize == (int)sizeof(CustomButtonClickData) && cbcd->dwButtonId == 0 && strcmp(cbcd->pszModule, MODULENAME)==0) {
HANDLE hContact = (HANDLE)w;
@@ -234,34 +106,33 @@ int SVC_ButtonsBarPressed(WPARAM w, LPARAM l) {
return 0;
}
-void InitSRMM() {
+void InitSRMM()
+{
// add icon to srmm status icons
InitMirOTRMenu();
- if(options.bHaveSRMMIcons) {
- hIconNotSecure = LoadIcon(ICON_NOT_PRIVATE, 0);
- hIconFinished = LoadIcon(ICON_FINISHED, 0);
- hIconPrivate = LoadIcon(ICON_PRIVATE, 0);
- hIconUnverified = LoadIcon(ICON_UNVERIFIED, 0);
-
- StatusIconData sid = {0};
- sid.cbSize = sizeof(sid);
- sid.szModule = MODULENAME;
- sid.dwId = 0;
- sid.hIcon = hIconFinished;
- sid.hIconDisabled = hIconNotSecure;
- sid.flags = MBF_DISABLED | MBF_HIDDEN;
- sid.szTooltip = LANG_OTR_TOOLTIP;
- Srmm_AddIcon(&sid);
- sid.dwId = 1;
- sid.hIcon = hIconPrivate;
- sid.hIconDisabled = hIconUnverified;
- Srmm_AddIcon(&sid);
+ hIconNotSecure = LoadIcon(ICON_NOT_PRIVATE, 0);
+ hIconFinished = LoadIcon(ICON_FINISHED, 0);
+ hIconPrivate = LoadIcon(ICON_PRIVATE, 0);
+ hIconUnverified = LoadIcon(ICON_UNVERIFIED, 0);
+
+ StatusIconData sid = { sizeof(sid) };
+ sid.szModule = MODULENAME;
+ sid.dwId = 0;
+ sid.hIcon = hIconFinished;
+ sid.hIconDisabled = hIconNotSecure;
+ sid.flags = MBF_DISABLED | MBF_HIDDEN;
+ sid.szTooltip = LANG_OTR_TOOLTIP;
+ Srmm_AddIcon(&sid);
+
+ sid.dwId = 1;
+ sid.hIcon = hIconPrivate;
+ sid.hIconDisabled = hIconUnverified;
+ Srmm_AddIcon(&sid);
- // hook the window events so that we can can change the status of the icon
-
- hEventIconPressed = HookEvent(ME_MSG_ICONPRESSED, SVC_IconPressed);
- }
+ // hook the window events so that we can can change the status of the icon
+ HookEvent(ME_MSG_ICONPRESSED, SVC_IconPressed);
+
if (options.bHaveButtonsBar) {
ZeroMemory(&OTRButton, sizeof(OTRButton));
OTRButton.cbSize = sizeof(OTRButton);
@@ -275,14 +146,13 @@ void InitSRMM() {
HookEvent(ME_MSG_BUTTONPRESSED, SVC_ButtonsBarPressed);
}
}
-void DeinitSRMM() {
- if(options.bHaveSRMMIcons) {
- UnhookEvent(hEventIconPressed);
- ReleaseIcon(ICON_NOT_PRIVATE, 0);
- ReleaseIcon(ICON_FINISHED, 0);
- ReleaseIcon(ICON_PRIVATE, 0);
- ReleaseIcon(ICON_UNVERIFIED, 0);
- hIconNotSecure = hIconFinished = hIconPrivate = hIconUnverified =0;
- }
+void DeinitSRMM()
+{
+ ReleaseIcon(ICON_NOT_PRIVATE, 0);
+ ReleaseIcon(ICON_FINISHED, 0);
+ ReleaseIcon(ICON_PRIVATE, 0);
+ ReleaseIcon(ICON_UNVERIFIED, 0);
+ hIconNotSecure = hIconFinished = hIconPrivate = hIconUnverified =0;
+
UninitMirOTRMenu();
} \ No newline at end of file
diff --git a/plugins/New_GPG/src/icons.cpp b/plugins/New_GPG/src/icons.cpp
index ef236d16b4..0f436b53cc 100755
--- a/plugins/New_GPG/src/icons.cpp
+++ b/plugins/New_GPG/src/icons.cpp
@@ -68,27 +68,21 @@ void setSrmmIcon(HANDLE h)
hMC = metaGetContact(hContact);
else if(metaIsProtoMetaContacts(hContact))
hMC = metaGetContact(hContact);
- if(ServiceExists(MS_MSG_MODIFYICON))
- {
- StatusIconData sid = {0};
- sid.cbSize = sizeof(sid);
- sid.szModule = szGPGModuleName;
- sid.hIcon = IconLibGetIcon("secured");
- sid.dwId = 0x00000001;
- sid.flags = enabled?0:MBF_HIDDEN;
- CallService(MS_MSG_MODIFYICON, (WPARAM)hContact, (LPARAM)&sid);
- if( hMC )
- CallService(MS_MSG_MODIFYICON, (WPARAM)hMC, (LPARAM)&sid);
- ZeroMemory(&sid, sizeof(sid));
- sid.cbSize = sizeof(sid);
- sid.szModule = szGPGModuleName;
- sid.hIcon = IconLibGetIcon("unsecured");
- sid.dwId = 0x00000002;
- sid.flags = enabled?MBF_HIDDEN:0;
- CallService(MS_MSG_MODIFYICON, (WPARAM)hContact, (LPARAM)&sid);
- if( hMC )
- CallService(MS_MSG_MODIFYICON, (WPARAM)hMC, (LPARAM)&sid);
- }
+
+ StatusIconData sid = { sizeof(sid) };
+ sid.szModule = szGPGModuleName;
+ sid.hIcon = IconLibGetIcon("secured");
+ sid.dwId = 1;
+ sid.flags = enabled ? 0 : MBF_HIDDEN;
+ Srmm_ModifyIcon(hContact, &sid);
+ if(hMC)
+ Srmm_ModifyIcon(hMC, &sid);
+
+ sid.hIcon = IconLibGetIcon("unsecured");
+ sid.dwId = 2;
+ Srmm_ModifyIcon(hContact, &sid);
+ if(hMC)
+ Srmm_ModifyIcon(hMC, &sid);
}
diff --git a/plugins/NoHistory/src/dllmain.cpp b/plugins/NoHistory/src/dllmain.cpp
index a579c599a2..1e676bca57 100644
--- a/plugins/NoHistory/src/dllmain.cpp
+++ b/plugins/NoHistory/src/dllmain.cpp
@@ -183,7 +183,7 @@ INT_PTR ServiceToggle(WPARAM wParam, LPARAM lParam)
for (int i = 0; i < 2; ++i) {
sid.dwId = i;
sid.flags = (i == remove) ? 0 : MBF_HIDDEN;
- CallService(MS_MSG_MODIFYICON, (WPARAM)hContact, (LPARAM)&sid);
+ Srmm_ModifyIcon(hContact, &sid);
}
return 0;
}
@@ -193,25 +193,23 @@ int WindowEvent(WPARAM wParam, LPARAM lParam)
MessageWindowEventData *mwd = (MessageWindowEventData *)lParam;
HANDLE hContact = mwd->hContact;
- if (mwd->uType == MSG_WINDOW_EVT_CLOSE) {
+ switch(mwd->uType) {
+ case MSG_WINDOW_EVT_CLOSE:
RemoveReadEvents(hContact);
- return 0;
- }
-
- if (mwd->uType != MSG_WINDOW_EVT_OPEN || !ServiceExists(MS_MSG_MODIFYICON))
- return 0;
-
- char *proto = GetContactProto(hContact);
- bool chat_room = (proto && db_get_b(hContact, proto, "ChatRoom", 0) != 0);
- int remove = db_get_b(hContact, MODULE, DBSETTING_REMOVE, 0) != 0;
-
- StatusIconData sid = {0};
- sid.cbSize = sizeof(sid);
- sid.szModule = MODULE;
- for (int i=0; i < 2; ++i) {
- sid.dwId = i;
- sid.flags = (chat_room ? MBF_HIDDEN : (i == remove) ? 0 : MBF_HIDDEN);
- CallService(MS_MSG_MODIFYICON, (WPARAM)hContact, (LPARAM)&sid);
+ break;
+
+ case MSG_WINDOW_EVT_OPEN:
+ char *proto = GetContactProto(hContact);
+ bool chat_room = (proto && db_get_b(hContact, proto, "ChatRoom", 0) != 0);
+ int remove = db_get_b(hContact, MODULE, DBSETTING_REMOVE, 0) != 0;
+
+ StatusIconData sid = { sizeof(sid) };
+ sid.szModule = MODULE;
+ for (int i=0; i < 2; ++i) {
+ sid.dwId = i;
+ sid.flags = (chat_room ? MBF_HIDDEN : (i == remove) ? 0 : MBF_HIDDEN);
+ Srmm_ModifyIcon(hContact, &sid);
+ }
}
return 0;
diff --git a/plugins/Popup/src/srmm_menu.cpp b/plugins/Popup/src/srmm_menu.cpp
index e3c52ca69c..ed6e3a2952 100644
--- a/plugins/Popup/src/srmm_menu.cpp
+++ b/plugins/Popup/src/srmm_menu.cpp
@@ -78,7 +78,7 @@ static void SrmmMenu_UpdateIcon(HANDLE hContact)
for (int i=0; i < 4; ++i) {
sid.dwId = i;
sid.flags = (i == mode) ? 0 : MBF_HIDDEN;
- CallService(MS_MSG_MODIFYICON, (WPARAM)hContact, (LPARAM)&sid);
+ Srmm_ModifyIcon(hContact, &sid);
}
}
diff --git a/plugins/Scriver/src/chat/window.cpp b/plugins/Scriver/src/chat/window.cpp
index 8802af4fc6..97f6ab1afd 100644
--- a/plugins/Scriver/src/chat/window.cpp
+++ b/plugins/Scriver/src/chat/window.cpp
@@ -1264,7 +1264,7 @@ INT_PTR CALLBACK RoomWndProc(HWND hwndDlg,UINT uMsg,WPARAM wParam,LPARAM lParam)
StatusIconData sid = { sizeof(sid) };
sid.szModule = SRMMMOD;
- CallService(MS_MSG_MODIFYICON, (WPARAM)si->windowData.hContact, (LPARAM)&sid);
+ Srmm_ModifyIcon(si->windowData.hContact, &sid);
}
break;
diff --git a/plugins/Scriver/src/msgdialog.cpp b/plugins/Scriver/src/msgdialog.cpp
index 25652a8c7e..0149cbd1a5 100644
--- a/plugins/Scriver/src/msgdialog.cpp
+++ b/plugins/Scriver/src/msgdialog.cpp
@@ -1266,7 +1266,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP
db_get_b(NULL, SRMMMOD, SRMSGSET_TYPINGNEW, SRMSGDEFSET_TYPINGNEW)));
db_set_b(dat->windowData.hContact, SRMMMOD, SRMSGSET_TYPING, (BYTE)!typingNotify);
sid.flags = typingNotify ? MBF_DISABLED : 0;
- CallService(MS_MSG_MODIFYICON, (WPARAM)dat->windowData.hContact, (LPARAM)&sid);
+ Srmm_ModifyIcon(dat->windowData.hContact, &sid);
}
break;
@@ -1503,7 +1503,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP
sid.cbSize = sizeof(sid);
sid.szModule = SRMMMOD;
sid.flags = MBF_DISABLED;
- CallService(MS_MSG_MODIFYICON, (WPARAM)dat->windowData.hContact, (LPARAM)&sid);
+ Srmm_ModifyIcon(dat->windowData.hContact, &sid);
sid.dwId = 1;
if (IsTypingNotificationSupported(dat) && g_dat.flags2 & SMF2_SHOWTYPINGSWITCH)
sid.flags = (db_get_b(dat->windowData.hContact, SRMMMOD, SRMSGSET_TYPING,
@@ -1511,7 +1511,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP
else
sid.flags = MBF_HIDDEN;
- CallService(MS_MSG_MODIFYICON, (WPARAM)dat->windowData.hContact, (LPARAM)&sid);
+ Srmm_ModifyIcon(dat->windowData.hContact, &sid);
}
break;
diff --git a/plugins/Scriver/src/msgs.cpp b/plugins/Scriver/src/msgs.cpp
index 7b58fba856..a3d99babb8 100644
--- a/plugins/Scriver/src/msgs.cpp
+++ b/plugins/Scriver/src/msgs.cpp
@@ -383,15 +383,11 @@ void ChangeStatusIcons()
{
StatusIconData sid = { sizeof(sid) };
sid.szModule = SRMMMOD;
- sid.hIcon = CopyIcon(GetCachedIcon("scriver_UNICODEON"));
- sid.hIconDisabled = CopyIcon(GetCachedIcon("scriver_UNICODEOFF"));
- CallService(MS_MSG_MODIFYICON, 0, (LPARAM)&sid);
-
sid.dwId = 1;
sid.hIcon = CopyIcon(GetCachedIcon("scriver_TYPING"));
sid.hIconDisabled = CopyIcon(GetCachedIcon("scriver_TYPINGOFF"));
sid.flags = MBF_HIDDEN;
- CallService(MS_MSG_MODIFYICON, 0, (LPARAM)&sid);
+ Srmm_ModifyIcon(NULL, &sid);
}
int StatusIconPressed(WPARAM wParam, LPARAM lParam)
diff --git a/plugins/SecureIM/src/crypt_icons.cpp b/plugins/SecureIM/src/crypt_icons.cpp
index 5907fb5b62..9131583586 100644
--- a/plugins/SecureIM/src/crypt_icons.cpp
+++ b/plugins/SecureIM/src/crypt_icons.cpp
@@ -75,18 +75,16 @@ void ShowStatusIcon(HANDLE hContact, int mode)
ExtraIcon_Clear(g_hCLIcon, hMC);
}
- if (ServiceExists(MS_MSG_MODIFYICON)) { // обновить иконки в srmm
- StatusIconData sid = {sizeof(sid) };
- sid.szModule = (char*)MODULENAME;
- for (int i = MODE_NATIVE; i < MODE_CNT; i++) {
- sid.dwId = i;
- sid.flags = (mode & SECURED) ? 0 : MBF_DISABLED;
- if (mode == -1 || (mode & 0x0f) != i || isChatRoom(hContact))
- sid.flags |= MBF_HIDDEN; // отключаем все ненужные иконки
- CallService(MS_MSG_MODIFYICON, (WPARAM)hContact, (LPARAM)&sid);
- if (hMC )
- CallService(MS_MSG_MODIFYICON, (WPARAM)hMC, (LPARAM)&sid);
- }
+ StatusIconData sid = {sizeof(sid) };
+ sid.szModule = (char*)MODULENAME;
+ for (int i = MODE_NATIVE; i < MODE_CNT; i++) {
+ sid.dwId = i;
+ sid.flags = (mode & SECURED) ? 0 : MBF_DISABLED;
+ if (mode == -1 || (mode & 0x0f) != i || isChatRoom(hContact))
+ sid.flags |= MBF_HIDDEN; // отключаем все ненужные иконки
+ Srmm_ModifyIcon(hContact, &sid);
+ if (hMC)
+ Srmm_ModifyIcon(hMC, &sid);
}
}
diff --git a/plugins/SpellChecker/src/spellchecker.cpp b/plugins/SpellChecker/src/spellchecker.cpp
index 3a0d162706..f932eac92b 100644
--- a/plugins/SpellChecker/src/spellchecker.cpp
+++ b/plugins/SpellChecker/src/spellchecker.cpp
@@ -71,26 +71,24 @@ extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD miranda
static int IconsChanged(WPARAM wParam, LPARAM lParam)
{
- if ( ServiceExists(MS_MSG_MODIFYICON)) {
- StatusIconData sid = { sizeof(sid) };
- sid.szModule = MODULE_NAME;
- sid.hIconDisabled = Skin_GetIcon("spellchecker_disabled");
- sid.flags = MBF_HIDDEN;
+ StatusIconData sid = { sizeof(sid) };
+ sid.szModule = MODULE_NAME;
+ sid.hIconDisabled = Skin_GetIcon("spellchecker_disabled");
+ sid.flags = MBF_HIDDEN;
- for (int i = 0; i < languages.getCount(); i++) {
- sid.dwId = i;
+ for (int i = 0; i < languages.getCount(); i++) {
+ sid.dwId = i;
- char tmp[128];
- mir_snprintf(tmp, SIZEOF(tmp), "%s - %S",
- Translate("Spell Checker"), languages[i]->full_name);
- sid.szTooltip = tmp;
+ char tmp[128];
+ mir_snprintf(tmp, SIZEOF(tmp), "%s - %S",
+ Translate("Spell Checker"), languages[i]->full_name);
+ sid.szTooltip = tmp;
- HICON hIcon = (opts.use_flags) ? Skin_GetIconByHandle(languages[i]->hIcolib) : Skin_GetIcon("spellchecker_enabled");
- sid.hIcon = CopyIcon(hIcon);
- Skin_ReleaseIcon(hIcon);
+ HICON hIcon = (opts.use_flags) ? Skin_GetIconByHandle(languages[i]->hIcolib) : Skin_GetIcon("spellchecker_enabled");
+ sid.hIcon = CopyIcon(hIcon);
+ Skin_ReleaseIcon(hIcon);
- CallService(MS_MSG_MODIFYICON, 0, (LPARAM) &sid);
- }
+ Srmm_ModifyIcon(NULL, &sid);
}
return 0;
diff --git a/plugins/SpellChecker/src/utils.cpp b/plugins/SpellChecker/src/utils.cpp
index 06a82da925..9d956eaa65 100644
--- a/plugins/SpellChecker/src/utils.cpp
+++ b/plugins/SpellChecker/src/utils.cpp
@@ -860,21 +860,18 @@ void GetContactLanguage(Dialog *dlg)
void ModifyIcon(Dialog *dlg)
{
- if ( ServiceExists(MS_MSG_MODIFYICON)) {
- StatusIconData sid = {0};
- sid.cbSize = sizeof(sid);
- sid.szModule = MODULE_NAME;
+ StatusIconData sid = { sizeof(sid) };
+ sid.szModule = MODULE_NAME;
- for (int i = 0; i < languages.getCount(); i++) {
- sid.dwId = i;
+ for (int i = 0; i < languages.getCount(); i++) {
+ sid.dwId = i;
- if (languages[i] == dlg->lang)
- sid.flags = (dlg->enabled ? 0 : MBF_DISABLED);
- else
- sid.flags = MBF_HIDDEN;
+ if (languages[i] == dlg->lang)
+ sid.flags = (dlg->enabled ? 0 : MBF_DISABLED);
+ else
+ sid.flags = MBF_HIDDEN;
- CallService(MS_MSG_MODIFYICON, (WPARAM) dlg->hContact, (LPARAM) &sid);
- }
+ Srmm_ModifyIcon(dlg->hContact, &sid);
}
}
diff --git a/plugins/UserInfoEx/src/Flags/svc_flags.cpp b/plugins/UserInfoEx/src/Flags/svc_flags.cpp
index 19375c7fb7..55c56e2bdc 100644
--- a/plugins/UserInfoEx/src/Flags/svc_flags.cpp
+++ b/plugins/UserInfoEx/src/Flags/svc_flags.cpp
@@ -89,9 +89,9 @@ static void CALLBACK BufferedProcTimer(HWND hwnd, UINT msg, UINT idTimer, DWORD
MoveMemory(&callList[i],&callList[i+1],((nCallListCount-i-1)*sizeof(struct BufferedCallData)));
--nCallListCount;
--i; /* reiterate current */
- if(nCallListCount) {
+ if (nCallListCount) {
buf=(struct BufferedCallData*)mir_realloc(callList,nCallListCount*sizeof(struct BufferedCallData));
- if(buf!=NULL) callList=buf;
+ if (buf!=NULL) callList=buf;
} else {
mir_free(callList);
callList=NULL;
@@ -108,7 +108,7 @@ static void CALLBACK BufferedProcTimer(HWND hwnd, UINT msg, UINT idTimer, DWORD
}
/* set next timer */
- if(nCallListCount) {
+ if (nCallListCount) {
#ifdef _DEBUG
mir_snprintf(szDbgLine,sizeof(szDbgLine),"next buffered timeout: %ums\n",uElapseNext); /* all ascii */
OutputDebugStringA(szDbgLine);
@@ -135,16 +135,16 @@ void _CallFunctionBuffered(BUFFEREDPROC pfnBuffProc,LPARAM lParam,BOOL fAccumula
/* find existing */
for(i=0;i<nCallListCount;++i)
- if(callList[i].pfnBuffProc==pfnBuffProc)
+ if (callList[i].pfnBuffProc==pfnBuffProc)
if (!fAccumulateSameParam || callList[i].lParam==lParam) {
data=&callList[i];
break;
}
/* append new */
- if(data==NULL) {
+ if (data==NULL) {
/* resize storage array */
data=(struct BufferedCallData*)mir_realloc(callList,(nCallListCount+1)*sizeof(struct BufferedCallData));
- if(data==NULL) return;
+ if (data==NULL) return;
callList=data;
data=&callList[nCallListCount];
++nCallListCount;
@@ -166,7 +166,7 @@ void _CallFunctionBuffered(BUFFEREDPROC pfnBuffProc,LPARAM lParam,BOOL fAccumula
}
#endif
/* set next timer */
- if(idBufferedTimer) uElapse=USER_TIMER_MINIMUM; /* will get recalculated */
+ if (idBufferedTimer) uElapse=USER_TIMER_MINIMUM; /* will get recalculated */
idBufferedTimer=SetTimer(NULL,idBufferedTimer,uElapse,(TIMERPROC)BufferedProcTimer);
}
@@ -181,7 +181,7 @@ void PrepareBufferedFunctions()
// assumes to be called in context of main thread
void KillBufferedFunctions()
{
- if(idBufferedTimer) KillTimer(NULL,idBufferedTimer);
+ if (idBufferedTimer) KillTimer(NULL,idBufferedTimer);
nCallListCount=0;
mir_free(callList); /* does NULL check */
}
@@ -207,7 +207,7 @@ static INT_PTR ServiceDetectContactOriginCountry(WPARAM wParam,LPARAM lParam)
else if (countryNumber = (int)DB::Setting::GetWord((HANDLE)wParam,pszProto,"CompanyCountry",0))
return (INT_PTR)countryNumber;
/* fallback ip detect
- else if(countryNumber==0xFFFF && db_get_b(NULL,"Flags","UseIpToCountry",SETTING_USEIPTOCOUNTRY_DEFAULT)) {
+ else if (countryNumber==0xFFFF && db_get_b(NULL,"Flags","UseIpToCountry",SETTING_USEIPTOCOUNTRY_DEFAULT)) {
countryNumber=ServiceIpToCountry(db_get_dw((HANDLE)wParam,pszProto,"RealIP",0),0);
}*/
@@ -275,10 +275,10 @@ static int OnExtraIconSvcChanged(WPARAM wParam,LPARAM lParam)
bEnable = -1;
break;
}
- if(bEnable == -1)
+ if (bEnable == -1)
return 0;
- if(bEnable && !hApplyIconHook)
+ if (bEnable && !hApplyIconHook)
hApplyIconHook = HookEvent(ME_CLIST_EXTRA_IMAGE_APPLY, OnCListApplyIcons);
else if (!bEnable && hApplyIconHook)
UnhookEvent(hApplyIconHook); hApplyIconHook = NULL;
@@ -350,7 +350,7 @@ void MsgWndData::FlagsIconSet()
sid.szModule = MODNAMEFLAGS;
sid.hIconDisabled = sid.hIcon = LoadFlagIcon(m_countryID);
sid.szTooltip = Translate((char*)CallService(MS_UTILS_GETCOUNTRYBYNUMBER,m_countryID,0));
- CallService(MS_MSG_MODIFYICON, (WPARAM)m_hContact, (LPARAM)&sid);
+ Srmm_ModifyIcon(m_hContact, &sid);
}
}
@@ -359,7 +359,7 @@ void MsgWndData::FlagsIconUnset()
StatusIconData sid = { sizeof(sid) };
sid.szModule = MODNAMEFLAGS;
sid.flags = MBF_HIDDEN;
- CallService(MS_MSG_MODIFYICON,(WPARAM)m_hContact,(LPARAM)&sid);
+ Srmm_ModifyIcon(m_hContact, &sid);
}
static int CompareMsgWndData(const MsgWndData* p1, const MsgWndData* p2)
@@ -413,7 +413,7 @@ static __inline int MessageAPI_AddIcon(const char* pszName, const char* szModul/
IconList* p = new IconList(&sid);
if (!p->m_ID)delete p;
else res = gIListMW.insert(p);
- if(res == -1)delete p;
+ if (res == -1)delete p;
return res;
}
@@ -433,14 +433,14 @@ void CALLBACK UpdateStatusIcons(LPARAM lParam) {
static int OnMsgWndEvent(WPARAM wParam,LPARAM lParam) {
MessageWindowEventData *msgwe=(MessageWindowEventData*)lParam;
/* sanity check */
- if(msgwe->hContact==NULL)
+ if (msgwe->hContact==NULL)
return 0;
switch(msgwe->uType) {
case MSG_WINDOW_EVT_OPENING:
{
MsgWndData* msgwnd = gMsgWndList.find((MsgWndData*)&msgwe->hContact);
- if(msgwnd == NULL) {
+ if (msgwnd == NULL) {
msgwnd = new MsgWndData(msgwe->hwndWindow, msgwe->hContact);
gMsgWndList.insert(msgwnd);
}
@@ -461,8 +461,9 @@ static int OnMsgWndEvent(WPARAM wParam,LPARAM lParam) {
}
//hookProc ME_SKIN2_ICONSCHANGED
-static int OnStatusIconsChanged(WPARAM wParam,LPARAM lParam) {
- if(myGlobals.MsgAddIconExist && gFlagsOpts.bShowStatusIconFlag)
+static int OnStatusIconsChanged(WPARAM wParam,LPARAM lParam)
+{
+ if (gFlagsOpts.bShowStatusIconFlag)
CallFunctionBuffered(UpdateStatusIcons,0,FALSE,STATUSICON_REFRESHDELAY);
return 0;
}
@@ -499,7 +500,7 @@ static int OnContactSettingChanged(WPARAM wParam,LPARAM lParam) {
/* Extra Image */
CallFunctionBuffered(SetExtraImage,(LPARAM)wParam,TRUE,EXTRAIMAGE_REFRESHDELAY);
/* Status Icon */
- if(hMsgWndEventHook) {
+ if (hMsgWndEventHook) {
int i = gMsgWndList.getIndex((MsgWndData*)&wParam);
if (i != -1) {
gMsgWndList[i]->ContryIDchange((int)ServiceDetectContactOriginCountry(wParam,0));
@@ -525,7 +526,7 @@ static int OnContactSettingChanged(WPARAM wParam,LPARAM lParam) {
void SvcFlagsLoadModule()
{
PrepareBufferedFunctions();
- if(CallService(MS_UTILS_GETCOUNTRYLIST,(WPARAM)&nCountriesCount,(LPARAM)&countries))
+ if (CallService(MS_UTILS_GETCOUNTRYLIST,(WPARAM)&nCountriesCount,(LPARAM)&countries))
nCountriesCount=0;
InitIcons(); /* load in iconlib */
//InitIpToCountry(); /* not implementet */
@@ -551,8 +552,7 @@ void SvcFlagsOnModulesLoaded()
SvcFlagsEnableExtraIcons(DB::Setting::GetByte(SET_CLIST_EXTRAICON_FLAGS2, 0), FALSE);
/* Status Icon */
- if(myGlobals.MsgAddIconExist)
- hMsgWndEventHook = HookEvent(ME_MSG_WINDOWEVENT, OnMsgWndEvent);
+ hMsgWndEventHook = HookEvent(ME_MSG_WINDOWEVENT, OnMsgWndEvent);
}
/**
diff --git a/plugins/UserInfoEx/src/Flags/svc_flagsicons.cpp b/plugins/UserInfoEx/src/Flags/svc_flagsicons.cpp
index 2dd4b1ce73..7bc1e5a0ba 100644
--- a/plugins/UserInfoEx/src/Flags/svc_flagsicons.cpp
+++ b/plugins/UserInfoEx/src/Flags/svc_flagsicons.cpp
@@ -106,17 +106,17 @@ static int CountryNumberToBitmapIndex(int countryNumber)
int i,high/*,low=0*/;
high=SIZEOF(BitmapIndexMap);
/*old code need sortet BitmapIndexMap*/
- /*if(countryNumber<=BitmapIndexMap[high])
+ /*if (countryNumber<=BitmapIndexMap[high])
while(low<=high) {
i=low+((high-low)/2);
// never happens
- if(i<0 || i>=SIZEOF(BitmapIndexMap)) DebugBreak();
- if(BitmapIndexMap[i]==countryNumber) return i;
- if(countryNumber>BitmapIndexMap[i]) low=i+1;
+ if (i<0 || i>=SIZEOF(BitmapIndexMap)) DebugBreak();
+ if (BitmapIndexMap[i]==countryNumber) return i;
+ if (countryNumber>BitmapIndexMap[i]) low=i+1;
else high=i-1;
}*/
for ( i=0; i < high; i++ ) {
- if(BitmapIndexMap[i]==countryNumber) return i;
+ if (BitmapIndexMap[i]==countryNumber) return i;
}
}
/* Other,Unknown,Unspecified */
@@ -149,8 +149,8 @@ int CountryNumberToIndex(int countryNumber)
{
int nf=0;
for(int i=0; i < nCountriesCount; i++) {
- if(countries[i].id == countryNumber) return i;
- if(countries[i].id == 0xFFFF) nf=i;
+ if (countries[i].id == countryNumber) return i;
+ if (countries[i].id == 0xFFFF) nf=i;
}
return nf; /* Unknown */
}
@@ -161,12 +161,12 @@ FIBITMAP* ConvertTo(FIBITMAP* dib, UINT destBits, bool greyscale)
switch (destBits) {
case 8:
// convert to 8Bits
- if(greyscale) {
+ if (greyscale) {
dib_res = FIP->FI_ConvertTo8Bits(dib);
}
else {
FIBITMAP* dib_tmp = FIP->FI_ConvertTo24Bits(dib);
- if(dib_tmp) {
+ if (dib_tmp) {
dib_res = FIP->FI_ColorQuantize(dib_tmp, FIQ_WUQUANT/*FIQ_NNQUANT*/);
FIP->FI_Unload(dib_tmp);
}
@@ -193,7 +193,7 @@ FIBITMAP* ConvertTo(FIBITMAP* dib, UINT destBits, bool greyscale)
FIBITMAP* LoadResource(UINT ID, LPTSTR lpType)
{
FIBITMAP *dib = NULL;
- if(lpType) {
+ if (lpType) {
HRSRC hResInfo = FindResource(ghInst,MAKEINTRESOURCE(ID),lpType);
DWORD ResSize = SizeofResource(ghInst,hResInfo);
HGLOBAL hRes = LoadResource(ghInst,hResInfo);
@@ -215,7 +215,7 @@ FIBITMAP* LoadResource(UINT ID, LPTSTR lpType)
}
else {
HBITMAP hScrBM = 0;
- if(NULL == (hScrBM = (HBITMAP)LoadImage(ghInst,MAKEINTRESOURCE(ID), IMAGE_BITMAP, 0, 0,LR_SHARED)))
+ if (NULL == (hScrBM = (HBITMAP)LoadImage(ghInst,MAKEINTRESOURCE(ID), IMAGE_BITMAP, 0, 0,LR_SHARED)))
return dib;
dib = FIP->FI_CreateDIBFromHBITMAP(hScrBM);
DeleteObject(hScrBM);
@@ -229,7 +229,7 @@ static INT_PTR ServiceLoadFlagIcon(WPARAM wParam,LPARAM lParam)
{
/* return handle */
if ((BOOL)lParam) {
- if(phIconHandles==NULL) return NULL;
+ if (phIconHandles==NULL) return NULL;
return (INT_PTR)phIconHandles[CountryNumberToIndex((int)wParam)];
}
/* return icon */
@@ -248,24 +248,24 @@ static INT_PTR ServiceCreateMergedFlagIcon(WPARAM wParam,LPARAM lParam)
HRGN hrgn;
HBITMAP hbmPrev;
/* load both icons */
- if(NULL == (hLowerIcon=(HICON)ServiceLoadFlagIcon((WPARAM)lParam,0))) return NULL;
+ if (NULL == (hLowerIcon=(HICON)ServiceLoadFlagIcon((WPARAM)lParam,0))) return NULL;
hUpperIcon=(HICON)ServiceLoadFlagIcon(wParam,0);
/* merge them */
- if(GetIconInfo(hLowerIcon,&icoi)) {
- if(hUpperIcon!=NULL && GetObject(icoi.hbmColor,sizeof(bm),&bm)) {
+ if (GetIconInfo(hLowerIcon,&icoi)) {
+ if (hUpperIcon!=NULL && GetObject(icoi.hbmColor,sizeof(bm),&bm)) {
hdc=CreateCompatibleDC(NULL);
- if(hdc!=NULL) {
+ if (hdc!=NULL) {
ZeroMemory(&aptTriangle,sizeof(aptTriangle));
aptTriangle[1].y=bm.bmHeight-1;
aptTriangle[2].x=bm.bmWidth-1;
hrgn=CreatePolygonRgn(aptTriangle,SIZEOF(aptTriangle),WINDING);
- if(hrgn!=NULL) {
+ if (hrgn!=NULL) {
SelectClipRgn(hdc,hrgn);
DeleteObject(hrgn);
hbmPrev=(HBITMAP)SelectObject(hdc,icoi.hbmColor);
- if(hbmPrev!=NULL) { /* error on select? */
- if(DrawIconEx(hdc,0,0,hUpperIcon,bm.bmWidth,bm.bmHeight,0,NULL,DI_NOMIRROR|DI_IMAGE)) {
- if(SelectObject(hdc,icoi.hbmMask)!=NULL) /* error on select? */
+ if (hbmPrev!=NULL) { /* error on select? */
+ if (DrawIconEx(hdc,0,0,hUpperIcon,bm.bmWidth,bm.bmHeight,0,NULL,DI_NOMIRROR|DI_IMAGE)) {
+ if (SelectObject(hdc,icoi.hbmMask)!=NULL) /* error on select? */
DrawIconEx(hdc,0,0,hUpperIcon,bm.bmWidth,bm.bmHeight,0,NULL,DI_NOMIRROR|DI_MASK);
}
SelectObject(hdc,hbmPrev);
@@ -299,7 +299,7 @@ void InitIcons()
// FREE_IMAGE_FORMAT fif = FIP->FI_GetFIFFromFilename("dummy.bmp");
/* all those flag icons storing in a large 24bit opaque bitmap to reduce file size */
- if(NULL == (dib = LoadResource(IDB_FLAGSPNG,_T("PNG"))))
+ if (NULL == (dib = LoadResource(IDB_FLAGSPNG,_T("PNG"))))
return;
if (IsWinVerXPPlus()) bitDest = bit = ILC_COLOR32;
@@ -321,7 +321,7 @@ void InitIcons()
}
// res = FIP->FI_IsTransparent(dib_ico);
- if(bit<32) {
+ if (bit<32) {
//disable transparency
FIP->FI_SetTransparent(dib, FALSE);
FIP->FI_SetTransparent(dib_ico, FALSE);
@@ -333,7 +333,7 @@ void InitIcons()
UINT b = t + FIP->FI_GetHeight(dib);
//copy dib to new dib_ico (centered)
- if(FIP->FI_Paste(dib_ico, dib, 0, t-1, 255+1)) {
+ if (FIP->FI_Paste(dib_ico, dib, 0, t-1, 255+1)) {
FIP->FI_Unload(dib); dib = NULL;
switch (bitDest) {
case 8:
@@ -342,7 +342,7 @@ void InitIcons()
{//transparency by 1bit monocrome icon mask (for bit < 32)
BYTE value;
FIBITMAP *dib_mask;
- if(NULL == (dib_mask = FIP->FI_Allocate(w, h, 1, 0, 0, 0))) {
+ if (NULL == (dib_mask = FIP->FI_Allocate(w, h, 1, 0, 0, 0))) {
FIP->FI_Unload(dib_ico);
return;
}
@@ -357,7 +357,7 @@ void InitIcons()
//convert to target resolution
if (!hbmMask || !(dib_ico = ConvertTo(dib_ico, bitDest, 0))) {
FIP->FI_Unload(dib_ico);
- if(hbmMask) DeleteObject(hbmMask);
+ if (hbmMask) DeleteObject(hbmMask);
return;
}
} break;
@@ -421,7 +421,7 @@ void InitIcons()
index = CountryNumberToIndex(countries[i].id);
phIconHandles[index] = Skin_AddIcon(&sid);
- if(sid.hDefaultIcon!=NULL) DestroyIcon(sid.hDefaultIcon);
+ if (sid.hDefaultIcon!=NULL) DestroyIcon(sid.hDefaultIcon);
mir_free(sid.ptszDescription); sid.ptszDescription = NULL;
}
}
diff --git a/plugins/UserInfoEx/src/classMAnnivDate.cpp b/plugins/UserInfoEx/src/classMAnnivDate.cpp
index bce176197d..1325b86958 100644
--- a/plugins/UserInfoEx/src/classMAnnivDate.cpp
+++ b/plugins/UserInfoEx/src/classMAnnivDate.cpp
@@ -537,7 +537,7 @@ int MAnnivDate::DBMoveBirthDate(HANDLE hContact, BYTE bOld, BYTE bNew) {
switch(bOld) {
case 0: //MOD_MBIRTHDAY
if (!DBGetDate(hContact, MOD_MBIRTHDAY, SET_CONTACT_BIRTHDAY, SET_CONTACT_BIRTHMONTH, SET_CONTACT_BIRTHYEAR)) {
- if(DBWriteDate(hContact, USERINFO, SET_CONTACT_BIRTHDAY, SET_CONTACT_BIRTHMONTH, SET_CONTACT_BIRTHYEAR))
+ if (DBWriteDate(hContact, USERINFO, SET_CONTACT_BIRTHDAY, SET_CONTACT_BIRTHMONTH, SET_CONTACT_BIRTHYEAR))
return 1;
DBDeleteDate(hContact, MOD_MBIRTHDAY, SET_CONTACT_BIRTHDAY, SET_CONTACT_BIRTHMONTH, SET_CONTACT_BIRTHYEAR);
DB::Setting::Delete(hContact, MOD_MBIRTHDAY, "BirthMode");
@@ -545,7 +545,7 @@ int MAnnivDate::DBMoveBirthDate(HANDLE hContact, BYTE bOld, BYTE bNew) {
break;
case 1: //USERINFO
if (!DBGetDate(hContact, USERINFO, SET_CONTACT_BIRTHDAY, SET_CONTACT_BIRTHMONTH, SET_CONTACT_BIRTHYEAR)) {
- if(DBWriteDate(hContact, MOD_MBIRTHDAY, SET_CONTACT_BIRTHDAY, SET_CONTACT_BIRTHMONTH, SET_CONTACT_BIRTHYEAR))
+ if (DBWriteDate(hContact, MOD_MBIRTHDAY, SET_CONTACT_BIRTHDAY, SET_CONTACT_BIRTHMONTH, SET_CONTACT_BIRTHYEAR))
return 1;
DB::Setting::WriteByte(hContact, MOD_MBIRTHDAY, "BirthMode", 2);
DBDeleteDate(hContact, USERINFO, SET_CONTACT_BIRTHDAY, SET_CONTACT_BIRTHMONTH, SET_CONTACT_BIRTHYEAR);
diff --git a/plugins/UserInfoEx/src/classPsTree.cpp b/plugins/UserInfoEx/src/classPsTree.cpp
index b1564eb650..2a26926a35 100644
--- a/plugins/UserInfoEx/src/classPsTree.cpp
+++ b/plugins/UserInfoEx/src/classPsTree.cpp
@@ -663,7 +663,7 @@ int CPsTree::BeginLabelEdit(HTREEITEM hItem)
NULL,
ghInst,
NULL );
- if(_hLabelEdit)
+ if (_hLabelEdit)
{
_hDragItem = hItem;
SetUserData(_hLabelEdit, this);
diff --git a/plugins/UserInfoEx/src/classPsTreeItem.cpp b/plugins/UserInfoEx/src/classPsTreeItem.cpp
index 348f468031..513bfa3d7f 100644
--- a/plugins/UserInfoEx/src/classPsTreeItem.cpp
+++ b/plugins/UserInfoEx/src/classPsTreeItem.cpp
@@ -226,12 +226,12 @@ BYTE CPsTreeItem::HasName(const LPCSTR pszName) const
**/
void CPsTreeItem::Rename(const LPTSTR pszLabel)
{
- if(pszLabel && *pszLabel)
+ if (pszLabel && *pszLabel)
{
LPTSTR pszDup = mir_tcsdup(pszLabel);
- if(pszDup)
+ if (pszDup)
{
- if(_ptszLabel)
+ if (_ptszLabel)
{
mir_free(_ptszLabel);
}
diff --git a/plugins/UserInfoEx/src/commonheaders.h b/plugins/UserInfoEx/src/commonheaders.h
index 8baa7f1eb9..32d50e43c9 100644
--- a/plugins/UserInfoEx/src/commonheaders.h
+++ b/plugins/UserInfoEx/src/commonheaders.h
@@ -173,7 +173,6 @@ typedef struct _MGLOBAL
{
DWORD mirandaVersion; // mirandaVersion
BYTE CanChangeDetails : 1; // is service to upload own contact information for icq present?
- BYTE MsgAddIconExist : 1; // Messsage Window support status Icon
BYTE TzIndexExist : 1; // Win Reg has Timzone Index Info
BYTE PopUpActionsExist : 1; // Popup++ or MS_POPUP_REGISTERACTIONS exist
BYTE ShowPropsheetColours : 1; // cached SET_PROPSHEET_SHOWCOLOURS database value
diff --git a/plugins/UserInfoEx/src/ctrl_tzcombo.cpp b/plugins/UserInfoEx/src/ctrl_tzcombo.cpp
index b9ac970183..ee20dd2bbd 100644
--- a/plugins/UserInfoEx/src/ctrl_tzcombo.cpp
+++ b/plugins/UserInfoEx/src/ctrl_tzcombo.cpp
@@ -55,7 +55,7 @@ CBaseCtrl* CTzCombo::CreateObj(HWND hDlg, WORD idCtrl, LPCSTR pszSetting)
ctrl = new CTzCombo(hDlg, idCtrl, pszSetting);
if (ctrl) {
//use new core tz interface
- if(tmi.prepareList) {
+ if (tmi.prepareList) {
//set the adress of our timezone handle as itemdata
//caller can obtain the handle htz to extract all relevant information
ctrl->_curSel = 0;
@@ -161,7 +161,7 @@ BOOL CTzCombo::OnInfoChanged(HANDLE hContact, LPCSTR pszProto)
{
if (!_Flags.B.hasChanged) {
//use new core tz interface to change the cbbox
- if(tmi.storeListResults) {
+ if (tmi.storeListResults) {
_curSel = CB_ERR;
// _curSel = tmi.selectListItem(hContact, _hwnd, TZF_PLF_CB);
//dident work well, coz no fallback to proto setting.
@@ -205,7 +205,7 @@ void CTzCombo::OnApply(HANDLE hContact, LPCSTR pszProto)
const char* pszModule = hContact ? USERINFO : pszProto;
if (_Flags.B.hasCustom || !hContact) {
//use new core tz interface
- if(tmi.storeListResults) {
+ if (tmi.storeListResults) {
tmi.storeListResults(hContact, _hwnd, TZF_PLF_CB);
if (!hContact) {
_Flags.B.hasCustom = 0;
@@ -276,7 +276,7 @@ void CTzCombo::OnChangedByUser(WORD wChangedMsg)
void CTzCombo::GetTime(LPTSTR szTime, WORD cchTime)
{
//use new core tz interface
- if(tmi.printDateTime) {
+ if (tmi.printDateTime) {
tmi.printDateTime((HANDLE)ComboBox_GetItemData(_hwnd, _curSel), _T("t"), szTime, cchTime, 0);
}
//fallback use old UIEX method
diff --git a/plugins/UserInfoEx/src/ex_import/classExImContactBase.cpp b/plugins/UserInfoEx/src/ex_import/classExImContactBase.cpp
index 16cd75e6d7..aea0d35064 100644
--- a/plugins/UserInfoEx/src/ex_import/classExImContactBase.cpp
+++ b/plugins/UserInfoEx/src/ex_import/classExImContactBase.cpp
@@ -250,7 +250,7 @@ HANDLE CExImContactBase::toDB()
// create new contact if none exists
if (_hContact == INVALID_HANDLE_VALUE && _pszProto && _pszUIDKey && _dbvUID.type != DBVT_DELETED) {
PROTOACCOUNT* pszAccount = 0;
- if(NULL == (pszAccount = ProtoGetAccount( _pszProto ))) {
+ if (NULL == (pszAccount = ProtoGetAccount( _pszProto ))) {
//account does not exist
_hContact = INVALID_HANDLE_VALUE;
return INVALID_HANDLE_VALUE;
@@ -394,7 +394,7 @@ BYTE CExImContactBase::compareUID(DBVARIANT *dbv)
hash = hashSettingW_M2((const char *)tmp);
mir_free(tmp);
}
- if(hash == _dbvUIDHash) return TRUE;
+ if (hash == _dbvUIDHash) return TRUE;
break;
case DBVT_BLOB: //'n' cpbVal and pbVal are valid
if (_dbvUID.type == dbv->type &&
diff --git a/plugins/UserInfoEx/src/ex_import/classExImContactXML.cpp b/plugins/UserInfoEx/src/ex_import/classExImContactXML.cpp
index 6ec7ac7bdd..04ac62cb3b 100644
--- a/plugins/UserInfoEx/src/ex_import/classExImContactXML.cpp
+++ b/plugins/UserInfoEx/src/ex_import/classExImContactXML.cpp
@@ -376,7 +376,7 @@ int CExImContactXML::ExportSetting(TiXmlElement *xmlModule, LPCSTR pszModule, LP
break;
case DBVT_ASCIIZ: //'s' pszVal is valid
{
- if(mir_IsEmptyA(dbv.pszVal)) break;
+ if (mir_IsEmptyA(dbv.pszVal)) break;
DB::Variant::ConvertString(&dbv, DBVT_UTF8);
if (str = (LPSTR)mir_alloc(mir_strlen(dbv.pszVal) + 2)) {
str[0] = 's';
@@ -388,7 +388,7 @@ int CExImContactXML::ExportSetting(TiXmlElement *xmlModule, LPCSTR pszModule, LP
}
case DBVT_UTF8: //'u' pszVal is valid
{
- if(mir_IsEmptyA(dbv.pszVal)) break;
+ if (mir_IsEmptyA(dbv.pszVal)) break;
if (str = (LPSTR)mir_alloc(mir_strlen(dbv.pszVal) + 2)) {
str[0] = 'u';
mir_strcpy(&str[1], dbv.pszVal);
@@ -399,7 +399,7 @@ int CExImContactXML::ExportSetting(TiXmlElement *xmlModule, LPCSTR pszModule, LP
}
case DBVT_WCHAR: //'u' pwszVal is valid
{
- if(mir_IsEmptyW(dbv.pwszVal)) break;
+ if (mir_IsEmptyW(dbv.pwszVal)) break;
DB::Variant::ConvertString(&dbv, DBVT_UTF8);
if (str = (LPSTR)mir_alloc(mir_strlen(dbv.pszVal) + 2)) {
str[0] = 'u';
@@ -912,7 +912,7 @@ int CExImContactXML::ImportModule(TiXmlNode* xmlModule)
continue;
}
// just ignore MetaModule on Meta to avoid errors (only import spetial keys)
- else if(isProtoModule && isMetaModule) {
+ else if (isProtoModule && isMetaModule) {
if (!mir_stricmp(xKey->Attribute("key"),"Nick") ||
!mir_stricmp(xKey->Attribute("key"),"TzName") ||
!mir_stricmp(xKey->Attribute("key"),"Timezone")) {
@@ -1030,12 +1030,12 @@ int CExImContactXML::ImportSetting(LPCSTR pszModule, TiXmlElement *xmlEntry)
if (CallService(MS_DB_CONTACT_WRITESETTING, (WPARAM)_hContact, (LPARAM)&cws)) {
//if (cws.value.pbVal>0)
mir_free(cws.value.pbVal);
- if(cws.value.type == DBVT_ASCIIZ || cws.value.type == DBVT_UTF8) mir_free(cws.value.pszVal);
+ if (cws.value.type == DBVT_ASCIIZ || cws.value.type == DBVT_UTF8) mir_free(cws.value.pszVal);
return ERROR_NOT_ADDED;
}
//if (cws.value.pbVal>0)
mir_free(cws.value.pbVal);
- if(cws.value.type == DBVT_ASCIIZ || cws.value.type == DBVT_UTF8) mir_free(cws.value.pszVal);
+ if (cws.value.type == DBVT_ASCIIZ || cws.value.type == DBVT_UTF8) mir_free(cws.value.pszVal);
return ERROR_OK;
}
diff --git a/plugins/UserInfoEx/src/ex_import/dlg_ExImProgress.cpp b/plugins/UserInfoEx/src/ex_import/dlg_ExImProgress.cpp
index e3a1ecdf8d..6899903e3e 100644
--- a/plugins/UserInfoEx/src/ex_import/dlg_ExImProgress.cpp
+++ b/plugins/UserInfoEx/src/ex_import/dlg_ExImProgress.cpp
@@ -104,7 +104,7 @@ CProgress::CProgress()
**/
CProgress::~CProgress()
{
- if(IsWindow(_hDlg)) DestroyWindow(_hDlg);
+ if (IsWindow(_hDlg)) DestroyWindow(_hDlg);
}
/**
@@ -224,7 +224,7 @@ BYTE CProgress::UpdateSetting(LPCTSTR pszFormat, ...)
mir_vsntprintf(buf, SIZEOF(buf), TranslateTS(pszFormat), vl);
va_end(vl);
GetDlgItemText(_hDlg, TXT_SETTING, tmp, SIZEOF(tmp));
- if(mir_tcsicmp(tmp,buf))
+ if (mir_tcsicmp(tmp,buf))
SetDlgItemText(_hDlg, TXT_SETTING, buf);
}
SendMessage(hProg, PBM_SETPOS, (int)SendMessage(hProg, PBM_GETPOS, 0, 0) + 1, 0);
diff --git a/plugins/UserInfoEx/src/init.cpp b/plugins/UserInfoEx/src/init.cpp
index d353c585a8..ea02f62a8e 100644
--- a/plugins/UserInfoEx/src/init.cpp
+++ b/plugins/UserInfoEx/src/init.cpp
@@ -70,7 +70,6 @@ static int OnTopToolBarLoaded(WPARAM wParam, LPARAM lParam)
static int OnModulesLoaded(WPARAM wParam, LPARAM lParam)
{
myGlobals.PopUpActionsExist = ServiceExists(MS_POPUP_REGISTERACTIONS);
- myGlobals.MsgAddIconExist = ServiceExists(MS_MSG_MODIFYICON);
// init meta contacts
INT_PTR ptr = CallService(MS_MC_GETPROTOCOLNAME, 0, 0);
@@ -187,10 +186,10 @@ extern "C" int __declspec(dllexport) Load(void)
// init freeimage interface
INT_PTR result = CALLSERVICE_NOTFOUND;
- if(ServiceExists(MS_IMG_GETINTERFACE))
+ if (ServiceExists(MS_IMG_GETINTERFACE))
result = CallService(MS_IMG_GETINTERFACE, FI_IF_VERSION, (LPARAM)&FIP);
- if(FIP == NULL || result != S_OK) {
+ if (FIP == NULL || result != S_OK) {
MessageBoxEx(NULL, TranslateT("Fatal error, image services not found. Flags Module will be disabled."), _T("Error"), MB_OK | MB_ICONERROR | MB_APPLMODAL, 0);
return 1;
}
diff --git a/plugins/UserInfoEx/src/mir_db.cpp b/plugins/UserInfoEx/src/mir_db.cpp
index 9f9d3b8ed6..c41df9076b 100644
--- a/plugins/UserInfoEx/src/mir_db.cpp
+++ b/plugins/UserInfoEx/src/mir_db.cpp
@@ -254,7 +254,7 @@ BYTE IsEmpty(HANDLE hContact, LPCSTR pszModule)
**/
BYTE IsMeta(LPCSTR pszModule)
{
- if(myGlobals.szMetaProto)
+ if (myGlobals.szMetaProto)
return !mir_strcmp(pszModule, myGlobals.szMetaProto);
return !mir_strcmp(pszModule, "MetaContacts");
}
@@ -1042,7 +1042,7 @@ BYTE GetInfoWithData(HANDLE hEvent, DBEVENTINFO *dbei)
INT_PTR size = BlobSizeOf(hEvent);
dbei->cbBlob = (size != -1) ? (DWORD)size : 0;
}
- if(dbei->cbBlob) {
+ if (dbei->cbBlob) {
dbei->pBlob = (PBYTE) mir_alloc(dbei->cbBlob);
if (dbei->pBlob == NULL) {
dbei->cbBlob = 0;
@@ -1106,7 +1106,7 @@ BYTE IsEqual(const DBEVENTINFO *d1, const DBEVENTINFO *d2, bool Data)
(d1->cbBlob == d2->cbBlob) &&
(!d1->szModule || !d2->szModule || !_stricmp(d1->szModule, d2->szModule))
;
- if(Data) {
+ if (Data) {
return res &&
(!d1->pBlob || !d2->pBlob || !memcmp(d1->pBlob,d2->pBlob,d1->cbBlob))
;
@@ -1141,9 +1141,9 @@ BYTE Exists(HANDLE hContact, HANDLE& hDbExistingEvent, DBEVENTINFO *dbei)
if ((dbei->timestamp < edbei.timestamp)) {
return FALSE;
}
- if(IsEqual(dbei, &edbei, false)) {
+ if (IsEqual(dbei, &edbei, false)) {
if (!GetInfoWithData(hDbExistingEvent, &edbei)) {
- if(IsEqual(dbei, &edbei, true)) {
+ if (IsEqual(dbei, &edbei, true)) {
mir_free(edbei.pBlob);
return TRUE;
}
@@ -1166,7 +1166,7 @@ BYTE Exists(HANDLE hContact, HANDLE& hDbExistingEvent, DBEVENTINFO *dbei)
hDbExistingEvent = edbe;
//compare without data (faster)
if ( result = IsEqual(dbei, &edbei, false)) {
- if(NULL == (result = !GetInfoWithData(edbe, &edbei))) continue;
+ if (NULL == (result = !GetInfoWithData(edbe, &edbei))) continue;
//compare with data
result = IsEqual(dbei, &edbei, true);
mir_free(edbei.pBlob);
@@ -1183,7 +1183,7 @@ BYTE Exists(HANDLE hContact, HANDLE& hDbExistingEvent, DBEVENTINFO *dbei)
hDbExistingEvent = edbe;
//compare without data (faster)
if ( result = IsEqual(dbei, &edbei, false)) {
- if(NULL == (result = !GetInfoWithData(edbe, &edbei))) continue;
+ if (NULL == (result = !GetInfoWithData(edbe, &edbei))) continue;
//compare with data
result = IsEqual(dbei, &edbei, true);
mir_free(edbei.pBlob);
diff --git a/plugins/UserInfoEx/src/mir_string.cpp b/plugins/UserInfoEx/src/mir_string.cpp
index 882cb3301b..c538c110ad 100644
--- a/plugins/UserInfoEx/src/mir_string.cpp
+++ b/plugins/UserInfoEx/src/mir_string.cpp
@@ -128,7 +128,7 @@ size_t mir_snwprintf(wchar_t *pszDest, const size_t cchDest, const wchar_t *pszF
int mir_IsEmptyA(char *str)
{
- if(str == NULL || str[0] == 0)
+ if (str == NULL || str[0] == 0)
return 1;
int i = 0;
while (str[i]) {
@@ -143,7 +143,7 @@ int mir_IsEmptyA(char *str)
int mir_IsEmptyW(wchar_t *str)
{
- if(str == NULL || str[0] == 0)
+ if (str == NULL || str[0] == 0)
return 1;
int i = 0;
while (str[i]) {
diff --git a/plugins/UserInfoEx/src/psp_contact.cpp b/plugins/UserInfoEx/src/psp_contact.cpp
index 912134281e..b5ac2dab8c 100644
--- a/plugins/UserInfoEx/src/psp_contact.cpp
+++ b/plugins/UserInfoEx/src/psp_contact.cpp
@@ -167,7 +167,7 @@ INT_PTR CALLBACK PSPProcContactHome(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM
break;
case EDIT_COUNTRY:
- if(HIWORD(wParam) == CBN_SELCHANGE) {
+ if (HIWORD(wParam) == CBN_SELCHANGE) {
LPIDSTRLIST pd = (LPIDSTRLIST)ComboBox_GetItemData((HWND)lParam, ComboBox_GetCurSel((HWND)lParam));
UpDate_CountryIcon(GetDlgItem(hDlg, ICO_COUNTRY), pd->nID);
}
@@ -322,7 +322,7 @@ INT_PTR CALLBACK PSPProcContactWork(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM
break;
case EDIT_COUNTRY:
- if(HIWORD(wParam) == CBN_SELCHANGE) {
+ if (HIWORD(wParam) == CBN_SELCHANGE) {
LPIDSTRLIST pd = (LPIDSTRLIST)ComboBox_GetItemData((HWND)lParam, ComboBox_GetCurSel((HWND)lParam));
UpDate_CountryIcon(GetDlgItem(hDlg, ICO_COUNTRY), pd->nID);
}
diff --git a/plugins/UserInfoEx/src/psp_options.cpp b/plugins/UserInfoEx/src/psp_options.cpp
index ea0b2c76d8..5ae5c14471 100644
--- a/plugins/UserInfoEx/src/psp_options.cpp
+++ b/plugins/UserInfoEx/src/psp_options.cpp
@@ -389,8 +389,8 @@ static INT_PTR CALLBACK DlgProc_CommonOpts(HWND hDlg, UINT uMsg, WPARAM wParam,
SvcGenderEnableExtraIcons(IsDlgButtonChecked(hDlg, CHECK_OPT_GENDER)? 1:-1, TRUE);
- if(FlagsClistChange) EnsureExtraImages();
- if(FlagsMsgWndChange) UpdateStatusIcons(NULL);
+ if (FlagsClistChange) EnsureExtraImages();
+ if (FlagsMsgWndChange) UpdateStatusIcons(NULL);
SvcHomepageEnableExtraIcons(IsDlgButtonChecked(hDlg, CHECK_OPT_HOMEPAGEICON), TRUE);
SvcEMailEnableExtraIcons(IsDlgButtonChecked(hDlg, CHECK_OPT_EMAILICON), TRUE);
@@ -490,7 +490,7 @@ static INT_PTR CALLBACK DlgProc_AdvancedOpts(HWND hDlg, UINT uMsg, WPARAM wParam
DBGetCheckBtn(hDlg, CHECK_OPT_BUTTONICONS, SET_ICONS_BUTTONS, TRUE);
DBGetCheckBtn(hDlg, CHECK_OPT_METASCAN, SET_META_SCAN, TRUE);
DBGetCheckBtn(hDlg, CHECK_OPT_SREMAIL_ENABLED, SET_EXTENDED_EMAILSERVICE, TRUE);
- if(tmi.getTimeZoneTime) {
+ if (tmi.getTimeZoneTime) {
CheckDlgButton(hDlg, CHECK_OPT_AUTOTIMEZONE, TRUE);
EnableWindow(GetDlgItem(hDlg, CHECK_OPT_AUTOTIMEZONE), FALSE);
}
diff --git a/plugins/UserInfoEx/src/psp_origin.cpp b/plugins/UserInfoEx/src/psp_origin.cpp
index d822eab505..7980af97f6 100644
--- a/plugins/UserInfoEx/src/psp_origin.cpp
+++ b/plugins/UserInfoEx/src/psp_origin.cpp
@@ -136,7 +136,7 @@ INT_PTR CALLBACK PSPProcOrigin(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lPara
switch (LOWORD(wParam))
{
case EDIT_COUNTRY:
- if(HIWORD(wParam) == CBN_SELCHANGE) {
+ if (HIWORD(wParam) == CBN_SELCHANGE) {
LPIDSTRLIST pd = (LPIDSTRLIST)ComboBox_GetItemData((HWND)lParam, ComboBox_GetCurSel((HWND)lParam));
UpDate_CountryIcon(GetDlgItem(hDlg, ICO_COUNTRY), pd->nID);
}
diff --git a/plugins/UserInfoEx/src/svc_contactinfo.cpp b/plugins/UserInfoEx/src/svc_contactinfo.cpp
index b7760f225d..a29d2e2b33 100644
--- a/plugins/UserInfoEx/src/svc_contactinfo.cpp
+++ b/plugins/UserInfoEx/src/svc_contactinfo.cpp
@@ -148,7 +148,7 @@ static FORCEINLINE INT_PTR GCIVarEx(CONTACTINFO *ci, LPCSTR pszSetting)
static FORCEINLINE INT_PTR GCILangEx(CONTACTINFO *ci, LPCSTR pszSetting)
{
if (0 == GCIVarEx(ci, pszSetting)) {
- if(ci->type!= CNFT_ASCIIZ) {
+ if (ci->type!= CNFT_ASCIIZ) {
//lang was safed in database as code
LPIDSTRLIST pList;
UINT nList, i, res = 0;
@@ -160,7 +160,7 @@ static FORCEINLINE INT_PTR GCILangEx(CONTACTINFO *ci, LPCSTR pszSetting)
}
GetLanguageList(&nList, &pList);
for(i = 0; i<nList; i++) {
- if(pList[i].nID == res) {
+ if (pList[i].nID == res) {
//use untranslate string (pszText member)
ci->pszVal = (ci->dwFlag & CNF_UNICODE)
? (LPTSTR) mir_a2u(pList[i].pszText)
@@ -379,7 +379,7 @@ INT_PTR GetContactInfo(WPARAM wParam, LPARAM lParam)
case CNF_FIRSTLAST: {
result = GCIVarEx(ci, SET_CONTACT_FIRSTLASTNAME); //first try to read "FullName"
- if(result) result = GCIFirstLast(ci); //fallback to "FirstName" + "LastName"
+ if (result) result = GCIFirstLast(ci); //fallback to "FirstName" + "LastName"
} break;
case CNF_NICK: {
@@ -576,7 +576,7 @@ INT_PTR GetContactInfo(WPARAM wParam, LPARAM lParam)
case CNF_TIMEZONE: {
//use new core tz interface
- if(tmi.prepareList) {
+ if (tmi.prepareList) {
HANDLE hTz = tmi.createByContact(ci->hContact, TZF_KNOWNONLY);
if (hTz) {
LPTIME_ZONE_INFORMATION tzi = tmi.getTzi(hTz);
diff --git a/plugins/UserInfoEx/src/svc_refreshci.cpp b/plugins/UserInfoEx/src/svc_refreshci.cpp
index 2db5949405..e2c5674a6f 100644
--- a/plugins/UserInfoEx/src/svc_refreshci.cpp
+++ b/plugins/UserInfoEx/src/svc_refreshci.cpp
@@ -888,7 +888,7 @@ static int OnContactAdded(WPARAM wParam, LPARAM lParam)
**/
static int OnPreShutdown(WPARAM, LPARAM)
{
- if(ContactUpdater) {
+ if (ContactUpdater) {
delete ContactUpdater;
ContactUpdater = 0;
}