diff options
author | George Hazan <george.hazan@gmail.com> | 2014-02-16 12:44:38 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2014-02-16 12:44:38 +0000 |
commit | 907116c051e995a6a593743c7a6dfdece747c2c0 (patch) | |
tree | 59d079cb818382ae09840da99e3be1b58abffff5 | |
parent | bec34b3f632d179368f00b49e984ac576f14fad4 (diff) |
code cleaning
git-svn-id: http://svn.miranda-ng.org/main/trunk@8133 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
24 files changed, 247 insertions, 314 deletions
diff --git a/plugins/AuthState/src/main.cpp b/plugins/AuthState/src/main.cpp index 6d2223af71..b6af9e6668 100644 --- a/plugins/AuthState/src/main.cpp +++ b/plugins/AuthState/src/main.cpp @@ -89,12 +89,12 @@ INT_PTR getIconToUse(MCONTACT hContact, LPARAM lParam) return icon_none;
}
-int onExtraImageApplying(WPARAM wParam, LPARAM lParam)
+int onExtraImageApplying(WPARAM hContact, LPARAM lParam)
{
- if (wParam == NULL)
+ if (hContact == NULL)
return 0;
- int usedIcon = getIconToUse(wParam, lParam);
+ int usedIcon = getIconToUse(hContact, lParam);
const char *icon;
switch (usedIcon) {
@@ -103,38 +103,38 @@ int onExtraImageApplying(WPARAM wParam, LPARAM lParam) case icon_auth: icon = "auth_icon"; break;
default: icon = NULL; break;
}
- ExtraIcon_SetIcon(hExtraIcon, wParam, icon);
+ ExtraIcon_SetIcon(hExtraIcon, hContact, icon);
return 0;
}
-int onContactSettingChanged(WPARAM wParam,LPARAM lParam)
+int onContactSettingChanged(WPARAM hContact, LPARAM lParam)
{
DBCONTACTWRITESETTING *cws=(DBCONTACTWRITESETTING*)lParam;
- char *proto = GetContactProto(wParam);
+ char *proto = GetContactProto(hContact);
if (!proto) return 0;
if (!lstrcmpA(cws->szModule,proto))
if (!lstrcmpA(cws->szSetting,"Auth") || !lstrcmpA(cws->szSetting,"Grant") || !lstrcmpA(cws->szSetting,"ServerId") || !lstrcmpA(cws->szSetting,"ContactType"))
- onExtraImageApplying(wParam, 1);
+ onExtraImageApplying(hContact, 1);
return 0;
}
-int onDBContactAdded(WPARAM wParam, LPARAM lParam)
+int onDBContactAdded(WPARAM hContact, LPARAM lParam)
{
// A new contact added, mark it as recent
- db_set_b(wParam, MODULENAME, "ShowIcons", 1);
- onExtraImageApplying(wParam, 0);
+ db_set_b(hContact, MODULENAME, "ShowIcons", 1);
+ onExtraImageApplying(hContact, 0);
return 0;
}
-INT_PTR onAuthMenuSelected(WPARAM wParam, LPARAM lParam)
+INT_PTR onAuthMenuSelected(WPARAM hContact, LPARAM lParam)
{
- byte enabled = db_get_b(wParam,"AuthState","ShowIcons",1);
- db_set_b(wParam, MODULENAME, "ShowIcons", !enabled);
+ byte enabled = db_get_b(hContact,"AuthState","ShowIcons",1);
+ db_set_b(hContact, MODULENAME, "ShowIcons", !enabled);
- onExtraImageApplying(wParam, 0);
+ onExtraImageApplying(hContact, 0);
return 0;
}
@@ -163,7 +163,7 @@ static IconItem iconList[] = { LPGEN("Auth & Grant"), "authgrant_icon", IDI_AUTHGRANT }
};
-int onModulesLoaded(WPARAM wParam,LPARAM lParam)
+int onModulesLoaded(WPARAM, LPARAM)
{
// IcoLib support
Icon_Register(g_hInst, "Auth State", iconList, SIZEOF(iconList));
@@ -182,7 +182,7 @@ int onModulesLoaded(WPARAM wParam,LPARAM lParam) return 0;
}
-static int onShutdown(WPARAM wParam,LPARAM lParam)
+static int onShutdown(WPARAM, LPARAM)
{
DestroyServiceFunction(hAuthMenuSelected);
return 0;
@@ -203,8 +203,7 @@ extern "C" int __declspec(dllexport) Load(void) HookEvent(ME_DB_CONTACT_ADDED, onDBContactAdded);
- if (bContactMenuItem)
- {
+ if (bContactMenuItem) {
hAuthMenuSelected = CreateServiceFunction("AuthState/MenuItem", onAuthMenuSelected);
CLISTMENUITEM mi = { sizeof(mi) };
diff --git a/plugins/BuddyExpectator/src/BuddyExpectator.cpp b/plugins/BuddyExpectator/src/BuddyExpectator.cpp index 23b3aa2bd2..e8108e505d 100644 --- a/plugins/BuddyExpectator/src/BuddyExpectator.cpp +++ b/plugins/BuddyExpectator/src/BuddyExpectator.cpp @@ -359,14 +359,12 @@ INT_PTR MissYouAction(WPARAM wParam, LPARAM lParam) * when called from popup, wParam = (HANDLE)hContact and lParam == 0,
* when called from clist event, wParam = hWndCList, lParam = &CLISTEVENT
*/
-INT_PTR ContactReturnedAction(WPARAM wParam, LPARAM lParam)
+INT_PTR ContactReturnedAction(WPARAM hContact, LPARAM lParam)
{
- MCONTACT hContact;
if (lParam) {
- CLISTEVENT* cle = (CLISTEVENT*)lParam;
+ CLISTEVENT *cle = (CLISTEVENT*)lParam;
hContact = cle->hContact;
}
- else hContact = wParam;
if (options.iShowMessageWindow>0)
CallService(MS_MSG_SENDMESSAGET, hContact, 0);
@@ -383,14 +381,12 @@ INT_PTR ContactReturnedAction(WPARAM wParam, LPARAM lParam) * when called from popup, wParam = (HANDLE)hContact and lParam == 0,
* when called from clist event, wParam = hWndCList, lParam = &CLISTEVENT
*/
-INT_PTR ContactStillAbsentAction(WPARAM wParam, LPARAM lParam)
+INT_PTR ContactStillAbsentAction(WPARAM hContact, LPARAM lParam)
{
- MCONTACT hContact;
if (lParam) {
CLISTEVENT* cle = (CLISTEVENT*)lParam;
hContact = cle->hContact;
}
- else hContact = wParam;
switch (options.action2) {
case GCA_DELETE:
@@ -412,7 +408,7 @@ INT_PTR ContactStillAbsentAction(WPARAM wParam, LPARAM lParam) /**
* Load icons either from icolib or built in
*/
-int onIconsChanged(WPARAM wParam, LPARAM lParam)
+int onIconsChanged(WPARAM, LPARAM)
{
hIcon = Skin_GetIcon("main_icon");
return 0;
@@ -421,17 +417,17 @@ int onIconsChanged(WPARAM wParam, LPARAM lParam) /**
* Menu item click action
*/
-INT_PTR MenuMissYouClick(WPARAM wParam, LPARAM lParam)
+INT_PTR MenuMissYouClick(WPARAM hContact, LPARAM)
{
- if (db_get_b(wParam, MODULE_NAME, "MissYou", 0)) {
- db_set_b(wParam, MODULE_NAME, "MissYou", 0);
+ if (db_get_b(hContact, MODULE_NAME, "MissYou", 0)) {
+ db_set_b(hContact, MODULE_NAME, "MissYou", 0);
if (options.MissYouIcon)
- ExtraIcon_Clear(hExtraIcon, wParam);
+ ExtraIcon_Clear(hExtraIcon, hContact);
}
else {
- db_set_b(wParam, MODULE_NAME, "MissYou", 1);
+ db_set_b(hContact, MODULE_NAME, "MissYou", 1);
if (options.MissYouIcon)
- ExtraIcon_SetIcon(hExtraIcon, wParam, "enabled_icon");
+ ExtraIcon_SetIcon(hExtraIcon, hContact, "enabled_icon");
}
return 0;
@@ -440,15 +436,15 @@ INT_PTR MenuMissYouClick(WPARAM wParam, LPARAM lParam) /**
* Menu is about to appear
*/
-int onPrebuildContactMenu(WPARAM wParam, LPARAM lParam)
+int onPrebuildContactMenu(WPARAM hContact, LPARAM)
{
- char *proto = GetContactProto(wParam);
+ char *proto = GetContactProto(hContact);
if (!proto)
return 0;
CLISTMENUITEM mi = { sizeof(mi) };
mi.flags = CMIM_ICON | CMIM_NAME | CMIF_TCHAR;
- if (db_get_b(wParam, MODULE_NAME, "MissYou", 0)) {
+ if (db_get_b(hContact, MODULE_NAME, "MissYou", 0)) {
mi.ptszName = LPGENT("Disable Miss You");
mi.icolibItem = iconList[1].hIcolib;
}
@@ -457,14 +453,14 @@ int onPrebuildContactMenu(WPARAM wParam, LPARAM lParam) mi.icolibItem = iconList[2].hIcolib;
}
Menu_ModifyItem(hContactMenu, &mi);
- Menu_ShowItem(hContactMenu, !db_get_b(wParam, proto, "ChatRoom", 0) && (CallProtoService(proto, PS_GETCAPS, PFLAGNUM_1, 0) & PF1_IMSEND));
+ Menu_ShowItem(hContactMenu, !db_get_b(hContact, proto, "ChatRoom", 0) && (CallProtoService(proto, PS_GETCAPS, PFLAGNUM_1, 0) & PF1_IMSEND));
return 0;
}
-int onExtraImageApplying(WPARAM wParam, LPARAM lParam)
+int onExtraImageApplying(WPARAM hContact, LPARAM)
{
- if ( db_get_b(wParam, MODULE_NAME, "MissYou", 0))
- ExtraIcon_SetIcon(hExtraIcon, wParam, "enabled_icon");
+ if ( db_get_b(hContact, MODULE_NAME, "MissYou", 0))
+ ExtraIcon_SetIcon(hExtraIcon, hContact, "enabled_icon");
return 0;
}
@@ -472,11 +468,9 @@ int onExtraImageApplying(WPARAM wParam, LPARAM lParam) /**
* ContactSettingChanged callback
*/
-int SettingChanged(WPARAM wParam, LPARAM lParam)
+int SettingChanged(WPARAM hContact, LPARAM lParam)
{
- MCONTACT hContact = (MCONTACT) wParam;
- DBCONTACTWRITESETTING *inf = (DBCONTACTWRITESETTING *) lParam;
-
+ DBCONTACTWRITESETTING *inf = (DBCONTACTWRITESETTING*)lParam;
if (hContact == NULL || inf->value.type == DBVT_DELETED || strcmp(inf->szSetting, "Status") != 0)
return 0;
@@ -536,8 +530,7 @@ int SettingChanged(WPARAM wParam, LPARAM lParam) }
unsigned int AbsencePeriod = db_get_dw(hContact, MODULE_NAME, "iAbsencePeriod", options.iAbsencePeriod);
- if (isContactGoneFor(hContact, AbsencePeriod))
- {
+ if (isContactGoneFor(hContact, AbsencePeriod)) {
TCHAR* message = TranslateT("has returned after a long absence.");
TCHAR tmpBuf[251] = {0};
time_t tmpTime = getLastSeen(hContact);
@@ -598,11 +591,10 @@ void CALLBACK TimerProc(HWND, UINT, UINT_PTR, DWORD) /**
* Called when all the modules have had their modules loaded event handlers called (dependence of popups on fontservice :( )
*/
-int ModulesLoaded2(WPARAM wParam, LPARAM lParam)
+int ModulesLoaded2(WPARAM, LPARAM)
{
// check for 'still absent' contacts on startup
TimerProc(0, 0, 0, 0);
-
return 0;
}
@@ -610,7 +602,7 @@ int ModulesLoaded2(WPARAM wParam, LPARAM lParam) * Called when all the modules are loaded
*/
-int ModulesLoaded(WPARAM wParam, LPARAM lParam)
+int ModulesLoaded(WPARAM, LPARAM)
{
HookEvent(ME_USERINFO_INITIALISE, UserinfoInit);
@@ -669,13 +661,13 @@ extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD miranda return &pluginInfo;
}
-int ContactAdded(WPARAM wParam, LPARAM lParam)
+int ContactAdded(WPARAM hContact, LPARAM)
{
- db_set_dw(wParam, MODULE_NAME, "CreationTime", (DWORD)time(0));
+ db_set_dw(hContact, MODULE_NAME, "CreationTime", (DWORD)time(0));
return 0;
}
-int onShutdown(WPARAM wParam,LPARAM lParam)
+int onShutdown(WPARAM, LPARAM)
{
DestroyServiceFunction(hContactReturnedAction);
DestroyServiceFunction(hContactStillAbsentAction);
diff --git a/plugins/BuddyPounce/src/main.cpp b/plugins/BuddyPounce/src/main.cpp index ba13bc78d9..0c53aac56e 100644 --- a/plugins/BuddyPounce/src/main.cpp +++ b/plugins/BuddyPounce/src/main.cpp @@ -189,11 +189,12 @@ int UserOnlineSettingChanged(WPARAM hContact, LPARAM lParam) return 0;
}
-INT_PTR BuddyPounceMenuCommand(WPARAM wParam, LPARAM lParam)
+INT_PTR BuddyPounceMenuCommand(WPARAM hContact, LPARAM lParam)
{
- if (db_get_b(NULL, modname, "UseAdvanced", 0) || db_get_b(wParam, modname, "UseAdvanced", 0))
- CreateDialogParam(hInst,MAKEINTRESOURCE(IDD_POUNCE),0,BuddyPounceDlgProc, wParam);
- else CreateDialogParam(hInst,MAKEINTRESOURCE(IDD_POUNCE_SIMPLE),0,BuddyPounceSimpleDlgProc, wParam);
+ if (db_get_b(NULL, modname, "UseAdvanced", 0) || db_get_b(hContact, modname, "UseAdvanced", 0))
+ CreateDialogParam(hInst,MAKEINTRESOURCE(IDD_POUNCE),0,BuddyPounceDlgProc, hContact);
+ else
+ CreateDialogParam(hInst,MAKEINTRESOURCE(IDD_POUNCE_SIMPLE),0,BuddyPounceSimpleDlgProc, hContact);
return 0;
}
diff --git a/plugins/Clist_modern/src/modern_clistmenus.cpp b/plugins/Clist_modern/src/modern_clistmenus.cpp index 24f14b2b03..a619d019a9 100644 --- a/plugins/Clist_modern/src/modern_clistmenus.cpp +++ b/plugins/Clist_modern/src/modern_clistmenus.cpp @@ -92,9 +92,9 @@ static IconItem iconList[] = { LPGEN("Contact rate High"), "Rate4", IDI_FAVORITE_3 }
};
-static int FAV_OnContactMenuBuild(WPARAM wParam, LPARAM lParam)
+static int FAV_OnContactMenuBuild(WPARAM hContact, LPARAM lParam)
{
- BYTE bContactRate = db_get_b(wParam, "CList", "Rate", 0);
+ BYTE bContactRate = db_get_b(hContact, "CList", "Rate", 0);
if ( bContactRate > SIZEOF(rates)-1)
bContactRate = SIZEOF(rates)-1;
@@ -149,7 +149,7 @@ static int FAV_OnContactMenuBuild(WPARAM wParam, LPARAM lParam) mi.hIcon = NULL;
mi.ptszName = LPGENT("Show even if offline");
- mi.flags = CMIF_CHILDPOPUP | CMIF_TCHAR | (db_get_b(wParam, "CList", "noOffline", 0) ? CMIF_CHECKED : 0);
+ mi.flags = CMIF_CHILDPOPUP | CMIF_TCHAR | (db_get_b(hContact, "CList", "noOffline", 0) ? CMIF_CHECKED : 0);
mi.pszService = CLUI_FAVTOGGLESHOWOFFLINE;
mi.popupPosition = i+100000000;
mi.position = -100000000;
diff --git a/plugins/CountryFlags/src/extraimg.cpp b/plugins/CountryFlags/src/extraimg.cpp index 1ada5a8372..d58e49de07 100644 --- a/plugins/CountryFlags/src/extraimg.cpp +++ b/plugins/CountryFlags/src/extraimg.cpp @@ -24,18 +24,18 @@ static HANDLE hServiceDetectContactOrigin; /************************* Services *******************************/
-static INT_PTR ServiceDetectContactOriginCountry(WPARAM wParam,LPARAM lParam)
+static INT_PTR ServiceDetectContactOriginCountry(WPARAM hContact, LPARAM lParam)
{
int countryNumber = 0xFFFF;
- char *pszProto = GetContactProto(wParam);
+ char *pszProto = GetContactProto(hContact);
/* ip detect */
if (bUseIpToCountry)
- countryNumber = ServiceIpToCountry(db_get_dw(wParam,pszProto,"RealIP",0),0);
+ countryNumber = ServiceIpToCountry(db_get_dw(hContact, pszProto, "RealIP", 0), 0);
/* fallback */
if (countryNumber == 0xFFFF)
- countryNumber = db_get_w(wParam,pszProto,"Country",0);
+ countryNumber = db_get_w(hContact, pszProto, "Country", 0);
if (countryNumber == 0 || countryNumber == 0xFFFF)
- countryNumber = db_get_w(wParam,pszProto,"CompanyCountry",0);
+ countryNumber = db_get_w(hContact, pszProto, "CompanyCountry", 0);
return (countryNumber == 0) ? 0xFFFF : countryNumber;
}
diff --git a/plugins/MirandaG15/src/CAppletManager.cpp b/plugins/MirandaG15/src/CAppletManager.cpp index 483c31652a..aa72b89af8 100644 --- a/plugins/MirandaG15/src/CAppletManager.cpp +++ b/plugins/MirandaG15/src/CAppletManager.cpp @@ -1849,38 +1849,29 @@ int CAppletManager::HookContactDeleted(WPARAM wParam, LPARAM lParam) //************************************************************************
// setting changed hook function
//************************************************************************
-int CAppletManager::HookSettingChanged(WPARAM wParam,LPARAM lParam)
+int CAppletManager::HookSettingChanged(WPARAM hContact,LPARAM lParam)
{
DBCONTACTWRITESETTING *dbcws = (DBCONTACTWRITESETTING*)lParam;
CEvent Event;
- Event.hContact = wParam;
+ Event.hContact = hContact;
- if(!lstrcmpA(dbcws->szModule,"MetaContacts"))
- {
- //if(!lstrcmpA(dbcws->szSetting,"Enabled")) {
- // CAppletManager::GetInstance()->OnConfigChanged();
- // return 0;
- //} else
+ if(!lstrcmpA(dbcws->szModule,"MetaContacts")) {
if(!lstrcmpA(dbcws->szSetting,"IsSubcontact")) {
Event.eType = EVENT_CONTACT_GROUP;
DBVARIANT dbv;
- int res = db_get_ts(wParam, "CList", "Group", &dbv);
+ int res = db_get_ts(hContact, "CList", "Group", &dbv);
if(!res)
Event.strValue = dbv.ptszVal;
db_free(&dbv);
- } else {
- return 0;
}
+ else return 0;
}
- else if(!lstrcmpA(dbcws->szSetting,"Nick") || !lstrcmpA(dbcws->szSetting,"MyHandle"))
- {
+ else if(!lstrcmpA(dbcws->szSetting,"Nick") || !lstrcmpA(dbcws->szSetting,"MyHandle")) {
DBVARIANT dbv={0};
// if the protocol nick has changed, check if a custom handle is set
- if(!lstrcmpA(dbcws->szSetting,"Nick"))
- {
- if (!db_get_ts(Event.hContact, "CList", "MyHandle", &dbv))
- {
+ if(!lstrcmpA(dbcws->szSetting,"Nick")) {
+ if (!db_get_ts(Event.hContact, "CList", "MyHandle", &dbv)) {
// handle found, ignore this event
if(dbv.pszVal && strlen(dbv.pszVal)>0)
return 0;
@@ -1889,15 +1880,13 @@ int CAppletManager::HookSettingChanged(WPARAM wParam,LPARAM lParam) }
Event.eType = EVENT_CONTACT_NICK;
- if(dbcws->value.type != DBVT_DELETED && dbcws->value.pszVal && strlen(dbcws->value.pszVal)>0)
- {
+ if(dbcws->value.type != DBVT_DELETED && dbcws->value.pszVal && strlen(dbcws->value.pszVal)>0) {
if(dbcws->value.type == DBVT_UTF8)
Event.strValue = Utf8_Decode(dbcws->value.pszVal);
else
Event.strValue = toTstring(dbcws->value.pszVal);
}
- else
- {
+ else {
char *szProto = (char *) CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)Event.hContact, 0);
if (db_get_ts(Event.hContact, szProto, "Nick", &dbv))
return 0;
@@ -1905,27 +1894,23 @@ int CAppletManager::HookSettingChanged(WPARAM wParam,LPARAM lParam) db_free(&dbv);
}
}
- else if(!lstrcmpA(dbcws->szModule,"CList"))
- {
- if(!lstrcmpA(dbcws->szSetting,"Hidden"))
- {
+ else if(!lstrcmpA(dbcws->szModule,"CList")) {
+ if(!lstrcmpA(dbcws->szSetting,"Hidden")) {
Event.eType = EVENT_CONTACT_HIDDEN;
- Event.iValue = db_get_b(wParam,"CList","Hidden",0);
+ Event.iValue = db_get_b(hContact,"CList","Hidden",0);
}
- else if(!lstrcmpA(dbcws->szSetting,"Group"))
- {
+ else if(!lstrcmpA(dbcws->szSetting,"Group")) {
Event.eType = EVENT_CONTACT_GROUP;
DBVARIANT dbv;
- int res = db_get_ts(wParam, "CList", "Group", &dbv);
+ int res = db_get_ts(hContact, "CList", "Group", &dbv);
if(!res)
Event.strValue = dbv.ptszVal;
db_free(&dbv);
}
- else
- return 0;
+ else return 0;
}
- else
- return 0;
+ else return 0;
+
CAppletManager::GetInstance()->HandleEvent(&Event);
return 0;
-}
\ No newline at end of file +}
diff --git a/plugins/RecentContacts/src/RecentContacts.cpp b/plugins/RecentContacts/src/RecentContacts.cpp index 46493dd74a..04ee5376fd 100644 --- a/plugins/RecentContacts/src/RecentContacts.cpp +++ b/plugins/RecentContacts/src/RecentContacts.cpp @@ -479,12 +479,12 @@ int OnMsgEvent(WPARAM wParam, LPARAM lParam) return 0;
}
-static int OnPrebuildContactMenu (WPARAM wParam, LPARAM lParam)
+static int OnPrebuildContactMenu(WPARAM hContact, LPARAM lParam)
{
CLISTMENUITEM clmi = { sizeof(clmi) };
clmi.flags = CMIM_NAME | CMIF_TCHAR;
- if ( db_get_b(wParam, dbLastUC_ModuleName, dbLastUC_IgnoreContact, 0) == 0)
+ if (db_get_b(hContact, dbLastUC_ModuleName, dbLastUC_IgnoreContact, 0) == 0)
clmi.ptszName = TranslateT("Ignore Contact");
else
clmi.ptszName = TranslateT("Show Contact");
@@ -500,15 +500,13 @@ int OnModulesLoaded(WPARAM wParam, LPARAM lParam) LoadDBSettings();
// hotkeys
- HOTKEYDESC hk = {0};
- hk.cbSize = sizeof(hk);
+ HOTKEYDESC hk = { sizeof(hk) };
hk.pszName = msLastUC_ShowList;
hk.pszDescription = LPGEN("Show Recent Contacts");
hk.pszSection = "Contacts";
hk.pszService = msLastUC_ShowList;
hk.DefHotKey = MAKEWORD('R', HOTKEYF_CONTROL | HOTKEYF_SHIFT);
Hotkey_Register(&hk);
-
return 0;
}
diff --git a/plugins/SimpleStatusMsg/src/awaymsg.cpp b/plugins/SimpleStatusMsg/src/awaymsg.cpp index f0ff0661f4..af2562aff3 100644 --- a/plugins/SimpleStatusMsg/src/awaymsg.cpp +++ b/plugins/SimpleStatusMsg/src/awaymsg.cpp @@ -351,11 +351,11 @@ static INT_PTR GoToURLMsgCommand(WPARAM wParam, LPARAM lParam) return 0;
}
-static int AwayMsgPreBuildMenu(WPARAM wParam, LPARAM lParam)
+static int AwayMsgPreBuildMenu(WPARAM hContact, LPARAM lParam)
{
TCHAR str[128];
- char *szProto = GetContactProto(wParam);
- int iHidden = szProto ? db_get_b(wParam, szProto, "ChatRoom", 0) : 0;
+ char *szProto = GetContactProto(hContact);
+ int iHidden = szProto ? db_get_b(hContact, szProto, "ChatRoom", 0) : 0;
int iStatus;
CLISTMENUITEM clmi = { sizeof(clmi) };
@@ -363,7 +363,7 @@ static int AwayMsgPreBuildMenu(WPARAM wParam, LPARAM lParam) clmi.flags = CMIM_FLAGS | CMIF_HIDDEN | CMIF_TCHAR;
if (!iHidden) {
iHidden = 1;
- iStatus = db_get_w(wParam, szProto, "Status", ID_STATUS_OFFLINE);
+ iStatus = db_get_w(hContact, szProto, "Status", ID_STATUS_OFFLINE);
if (CallProtoService(szProto, PS_GETCAPS, PFLAGNUM_1,0) & PF1_MODEMSGRECV) {
if (CallProtoService(szProto, PS_GETCAPS, PFLAGNUM_3,0) & Proto_Status2Flag(iStatus == ID_STATUS_OFFLINE ? ID_STATUS_INVISIBLE : iStatus)) {
iHidden = 0;
@@ -377,7 +377,7 @@ static int AwayMsgPreBuildMenu(WPARAM wParam, LPARAM lParam) Menu_ModifyItem(hAwayMsgMenuItem, &clmi);
Skin_ReleaseIcon(clmi.hIcon);
- ptrA szMsg(db_get_sa(wParam, "CList", "StatusMsg"));
+ ptrA szMsg(db_get_sa(hContact, "CList", "StatusMsg"));
clmi.flags = CMIM_FLAGS | CMIF_HIDDEN | CMIF_TCHAR;
if (!iHidden && szMsg != NULL) {
diff --git a/plugins/UserInfoEx/src/svc_refreshci.cpp b/plugins/UserInfoEx/src/svc_refreshci.cpp index 31195555a1..ebbcb09d65 100644 --- a/plugins/UserInfoEx/src/svc_refreshci.cpp +++ b/plugins/UserInfoEx/src/svc_refreshci.cpp @@ -836,17 +836,17 @@ static INT_PTR RefreshService(WPARAM wParam, LPARAM lParam) *
*
**/
-static int OnContactAdded(WPARAM wParam, LPARAM lParam)
+static int OnContactAdded(WPARAM hContact, LPARAM lParam)
{
try
{
- DWORD dwStmp = db_get_dw(wParam, USERINFO, SET_CONTACT_ADDEDTIME, 0);
+ DWORD dwStmp = db_get_dw(hContact, USERINFO, SET_CONTACT_ADDEDTIME, 0);
if (!dwStmp)
{
MTime mt;
mt.GetLocalTime();
- mt.DBWriteStamp(wParam, USERINFO, SET_CONTACT_ADDEDTIME);
+ mt.DBWriteStamp(hContact, USERINFO, SET_CONTACT_ADDEDTIME);
// create updater, if not yet exists
if (!ContactUpdater)
@@ -858,7 +858,7 @@ static int OnContactAdded(WPARAM wParam, LPARAM lParam) ContactUpdater->AddIfDontHave(
(ContactUpdater->Size() > 0)
? max(ContactUpdater->Get(ContactUpdater->Size() - 1)->check_time + 15000, 4000)
- : 4000, wParam);
+ : 4000, hContact);
}
}
catch(...)
diff --git a/plugins/Weather/src/weather_popup.cpp b/plugins/Weather/src/weather_popup.cpp index 24b5b8cc1f..47f80c3eb5 100644 --- a/plugins/Weather/src/weather_popup.cpp +++ b/plugins/Weather/src/weather_popup.cpp @@ -32,17 +32,17 @@ static HANDLE hPopupContact; // display weather popups
// wParam = the contact to display popup
// lParam = whether the weather data is changed or not
-int WeatherPopup(WPARAM wParam, LPARAM lParam)
+int WeatherPopup(WPARAM hContact, LPARAM lParam)
{
// determine if the popup should display or not
if (opt.UsePopup && opt.UpdatePopup && (!opt.PopupOnChange || (BOOL)lParam) &&
- !db_get_b(wParam, WEATHERPROTONAME, "DPopUp", 0))
+ !db_get_b(hContact, WEATHERPROTONAME, "DPopUp", 0))
{
- WEATHERINFO winfo = LoadWeatherInfo(wParam);
+ WEATHERINFO winfo = LoadWeatherInfo(hContact);
// setup the popup
POPUPDATAT ppd = { 0 };
- ppd.lchContact = wParam;
+ ppd.lchContact = hContact;
ppd.PluginData = ppd.lchIcon = LoadSkinnedProtoIcon(WEATHERPROTONAME, winfo.status);
GetDisplay(&winfo, opt.pTitle, ppd.lptzContactName);
GetDisplay(&winfo, opt.pText, ppd.lptzText);
diff --git a/plugins/WebView/src/webview_alerts.cpp b/plugins/WebView/src/webview_alerts.cpp index 21c6037a62..21062d72bb 100644 --- a/plugins/WebView/src/webview_alerts.cpp +++ b/plugins/WebView/src/webview_alerts.cpp @@ -153,12 +153,12 @@ int WPopupAlert(WPARAM wParam, LPARAM lParam) }
/*****************************************************************************/
-int PopupAlert(WPARAM wParam, LPARAM lParam)
+int PopupAlert(WPARAM hContact, LPARAM lParam)
{
POPUPDATA ppd = { 0 };
- if (((HANDLE)wParam) != NULL) {
+ if (hContact != NULL) {
DBVARIANT dbv;
- if ( !db_get_s(wParam, MODULENAME, PRESERVE_NAME_KEY, &dbv)) {
+ if (!db_get_s(hContact, MODULENAME, PRESERVE_NAME_KEY, &dbv)) {
lstrcpynA(ppd.lptzContactName, dbv.pszVal, SIZEOF(ppd.lptzContactName));
db_free(&dbv);
}
@@ -166,7 +166,7 @@ int PopupAlert(WPARAM wParam, LPARAM lParam) if (ppd.lptzContactName[0] == 0)
strncpy_s(ppd.lptzContactName, SIZEOF(ppd.lptzContactName), MODULENAME, _TRUNCATE);
- ppd.lchContact = wParam;
+ ppd.lchContact = hContact;
ppd.lchIcon = LoadIcon(hInst, MAKEINTRESOURCE(IDI_SITE));
char *displaytext = (char*)lParam;
@@ -198,14 +198,14 @@ int PopupAlert(WPARAM wParam, LPARAM lParam) }
/*****************************************************************************/
-int OSDAlert(WPARAM wParam, LPARAM lParam)
+int OSDAlert(WPARAM hContact, LPARAM lParam)
{
char contactname[255], newdisplaytext[2000];
contactname[0] = 0;
- if (((HANDLE)wParam) != NULL) {
+ if (hContact != NULL) {
DBVARIANT dbv;
- if ( !db_get_s(wParam, MODULENAME, PRESERVE_NAME_KEY, &dbv)) {
+ if (!db_get_s(hContact, MODULENAME, PRESERVE_NAME_KEY, &dbv)) {
strncpy_s(contactname, SIZEOF(contactname), dbv.pszVal, _TRUNCATE);
db_free(&dbv);
}
@@ -228,7 +228,7 @@ int ErrorMsgs(WPARAM wParam, LPARAM lParam) MCONTACT hContact = wParam;
TCHAR newdisplaytext[2000], *displaytext = (TCHAR*)lParam;
- if ( db_get_b(NULL, MODULENAME, SUPPRESS_ERR_KEY, 0))
+ if (db_get_b(NULL, MODULENAME, SUPPRESS_ERR_KEY, 0))
return 0;
TCHAR *ptszContactName = pcli->pfnGetContactDisplayName(hContact, 0);
@@ -264,7 +264,7 @@ void SaveToFile(MCONTACT hContact, char *truncated) char url[300]; url[0] = '\0';
DBVARIANT dbv;
- if ( !db_get_s(hContact, MODULENAME, URL_KEY, &dbv)) {
+ if (!db_get_s(hContact, MODULENAME, URL_KEY, &dbv)) {
strncpy_s(url, SIZEOF(url), dbv.pszVal, _TRUNCATE);
db_free(&dbv);
}
@@ -327,10 +327,10 @@ int ProcessAlerts(MCONTACT hContact, char *truncated, char *tstr, char *contactn ZeroMemory(&cachecompare, sizeof(cachecompare));
// alerts
- if ( db_get_b(hContact, MODULENAME, ENABLE_ALERTS_KEY, 0)) { // ALERTS
+ if (db_get_b(hContact, MODULENAME, ENABLE_ALERTS_KEY, 0)) { // ALERTS
alertIndex = db_get_b(hContact, MODULENAME, ALRT_INDEX_KEY, 0);
eventIndex = db_get_b(hContact, MODULENAME, EVNT_INDEX_KEY, 0);
- if ((notpresent)) {
+ if (notpresent) {
if (alertIndex == 0) { // Popup
Sleep(1000);
WAlertPopup(hContact, TranslateT("Start/end strings not found or strings not set."));
@@ -339,10 +339,10 @@ int ProcessAlerts(MCONTACT hContact, char *truncated, char *tstr, char *contactn db_set_s(hContact, "CList", "MyHandle", tstr);
}
else if (alertIndex == 1) { // log to file
- if ( !db_get_s(hContact, MODULENAME, FILE_KEY, &tdbv)) {
+ if (!db_get_s(hContact, MODULENAME, FILE_KEY, &tdbv)) {
int AmountWspcRem = 0;
- if ( !db_get_b(hContact, MODULENAME, SAVE_AS_RAW_KEY, 0)) {
+ if (!db_get_b(hContact, MODULENAME, SAVE_AS_RAW_KEY, 0)) {
CodetoSymbol(tempraw);
Sleep(100); // avoid 100% CPU
@@ -374,7 +374,7 @@ int ProcessAlerts(MCONTACT hContact, char *truncated, char *tstr, char *contactn }
else if (alertIndex == 3) {
WAlertOSD(hContact, TranslateT("Alert start/end strings not found or strings not set."));
- if ( db_get_b(hContact, MODULENAME, APND_DATE_NAME_KEY, 0))
+ if (db_get_b(hContact, MODULENAME, APND_DATE_NAME_KEY, 0))
db_set_s(hContact, "CList", "MyHandle", tstr);
}
else if (eventIndex == 2) {
@@ -391,7 +391,7 @@ int ProcessAlerts(MCONTACT hContact, char *truncated, char *tstr, char *contactn }
if (eventIndex == 0) { // string present
- if ( !db_get_s(hContact, MODULENAME, ALERT_STRING_KEY, &tdbv)) {
+ if (!db_get_s(hContact, MODULENAME, ALERT_STRING_KEY, &tdbv)) {
strncpy_s(alertstring, SIZEOF(alertstring), tdbv.pszVal, _TRUNCATE);
db_free(&tdbv);
@@ -414,7 +414,7 @@ int ProcessAlerts(MCONTACT hContact, char *truncated, char *tstr, char *contactn else if (alertIndex == 1) {
if (!db_get_s(hContact, MODULENAME, FILE_KEY, &tdbv)) {
int AmountWspcRem = 0;
- if ( !db_get_b(hContact, MODULENAME, SAVE_AS_RAW_KEY, 0)) {
+ if (!db_get_b(hContact, MODULENAME, SAVE_AS_RAW_KEY, 0)) {
CodetoSymbol(tempraw);
Sleep(100); // avoid 100% CPU
@@ -519,7 +519,7 @@ int ProcessAlerts(MCONTACT hContact, char *truncated, char *tstr, char *contactn if (!db_get_s(hContact, MODULENAME, FILE_KEY, &tdbv)) {
int AmountWspcRem = 0;
- if ( !db_get_b(hContact, MODULENAME, SAVE_AS_RAW_KEY, 0)) {
+ if (!db_get_b(hContact, MODULENAME, SAVE_AS_RAW_KEY, 0)) {
CodetoSymbol(tempraw);
Sleep(100); // avoid 100% CPU
@@ -562,11 +562,11 @@ int ProcessAlerts(MCONTACT hContact, char *truncated, char *tstr, char *contactn if (eventIndex == 2) { // part of webpage changed
Alerttempstring[0] = Alerttempstring2[0] = 0;
- if ( !db_get_s(hContact, MODULENAME, ALRT_S_STRING_KEY, &tdbv)) {
+ if (!db_get_s(hContact, MODULENAME, ALRT_S_STRING_KEY, &tdbv)) {
strncpy_s(Alerttempstring, SIZEOF(Alerttempstring), tdbv.pszVal, _TRUNCATE);
db_free(&tdbv);
}
- if ( !db_get_s(hContact, MODULENAME, ALRT_E_STRING_KEY, &tdbv)) {
+ if (!db_get_s(hContact, MODULENAME, ALRT_E_STRING_KEY, &tdbv)) {
strncpy_s(Alerttempstring2, SIZEOF(Alerttempstring2), tdbv.pszVal, _TRUNCATE);
db_free(&tdbv);
}
@@ -623,9 +623,9 @@ int ProcessAlerts(MCONTACT hContact, char *truncated, char *tstr, char *contactn }
else if (alertIndex == 1) { // LOG
if (!notpresent) { // dont log to file twice if both types of start/end strings not present
- if ( !db_get_s(hContact, MODULENAME, FILE_KEY, &tdbv)) {
+ if (!db_get_s(hContact, MODULENAME, FILE_KEY, &tdbv)) {
int AmountWspcRem = 0;
- if ( !db_get_b(hContact, MODULENAME, SAVE_AS_RAW_KEY, 0)) {
+ if (!db_get_b(hContact, MODULENAME, SAVE_AS_RAW_KEY, 0)) {
CodetoSymbol(tempraw);
Sleep(100); // avoid 100% CPU
@@ -729,7 +729,7 @@ int ProcessAlerts(MCONTACT hContact, char *truncated, char *tstr, char *contactn else if (alertIndex == 1) { // log to file
if (!db_get_s(hContact, MODULENAME, FILE_KEY, &tdbv)) {
int AmountWspcRem = 0;
- if ( !db_get_b(hContact, MODULENAME, SAVE_AS_RAW_KEY, 0)) {
+ if (!db_get_b(hContact, MODULENAME, SAVE_AS_RAW_KEY, 0)) {
CodetoSymbol(tempraw);
Sleep(100); // avoid 100% CPU
@@ -779,7 +779,7 @@ int ProcessAlerts(MCONTACT hContact, char *truncated, char *tstr, char *contactn if (!db_get_s(hContact, MODULENAME, FILE_KEY, &tdbv)) {
int AmountWspcRem = 0;
- if ( !db_get_b(hContact, MODULENAME, SAVE_AS_RAW_KEY, 0)) {
+ if (!db_get_b(hContact, MODULENAME, SAVE_AS_RAW_KEY, 0)) {
CodetoSymbol(tempraw);
Sleep(100); // avoid 100% CPU
@@ -848,7 +848,7 @@ void ReadFromFile(void *param) HWND hwndDlg = WindowList_Find(hWindowList, hContact);
char contactname[100]; contactname[0] = 0;
- if ( !db_get_s(hContact, "CList", "MyHandle", &dbv)) {
+ if (!db_get_s(hContact, "CList", "MyHandle", &dbv)) {
strncpy_s(contactname, SIZEOF(contactname), dbv.pszVal, _TRUNCATE);
db_free(&dbv);
}
diff --git a/plugins/WebView/src/webview_datawnd.cpp b/plugins/WebView/src/webview_datawnd.cpp index e9d7ae144c..e928b21d6a 100644 --- a/plugins/WebView/src/webview_datawnd.cpp +++ b/plugins/WebView/src/webview_datawnd.cpp @@ -132,7 +132,7 @@ static MCONTACT FindContactByUrl(HWND hwndDlg) ptrT db1( db_get_tsa(hContact, MODULENAME, URL_KEY));
ptrT db2( db_get_tsa(hContact, MODULENAME, PRESERVE_NAME_KEY));
- if ( !lstrcmp(urltext, db1) && !lstrcmp(titlebartxt, db2)) {
+ if (!lstrcmp(urltext, db1) && !lstrcmp(titlebartxt, db2)) {
contactcount++;
if (contactcount > 1) {
MessageBox(NULL, TranslateT("ERROR: You have two or more Webview contacts with the same URL and contact name."), _T(MODULENAME), MB_OK);
@@ -161,14 +161,14 @@ INT_PTR CALLBACK DlgProcDisplayData(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA WindowList_Add(hWindowList, hwndDlg, hContact2);
url[0] = '\0';
- if ( !db_get_ts(hContact2, MODULENAME, URL_KEY, &dbv)) {
+ if (!db_get_ts(hContact2, MODULENAME, URL_KEY, &dbv)) {
_tcsncpy_s(url, SIZEOF(url), dbv.ptszVal, _TRUNCATE);
db_free(&dbv);
}
SetDlgItemText(hwndDlg, IDC_OPEN_URL, FixButtonText(url, SIZEOF(url)));
char preservename[100];
- if ( !db_get_s(hContact2, MODULENAME, PRESERVE_NAME_KEY, &dbv)) {
+ if (!db_get_s(hContact2, MODULENAME, PRESERVE_NAME_KEY, &dbv)) {
strncpy_s(preservename, SIZEOF(preservename), dbv.pszVal, _TRUNCATE);
db_free(&dbv);
}
@@ -199,7 +199,7 @@ INT_PTR CALLBACK DlgProcDisplayData(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA SendDlgItemMessage(hwndDlg, IDC_OPEN_URL, BUTTONADDTOOLTIP, (WPARAM) TranslateT("Click here to open this URL in a browser window."), BATF_TCHAR);
- if ( !db_get_b(hContact2, MODULENAME, ON_TOP_KEY, 0)) {
+ if (!db_get_b(hContact2, MODULENAME, ON_TOP_KEY, 0)) {
SendDlgItemMessage(hwndDlg, IDC_STICK_BUTTON, BM_SETIMAGE, IMAGE_ICON, (LPARAM) LoadImage(hInst, MAKEINTRESOURCE(IDI_UNSTICK), IMAGE_ICON, GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), 0));
SendDlgItemMessage(hwndDlg, IDC_STICK_BUTTON, BUTTONADDTOOLTIP, (WPARAM) TranslateT("Stick to the front"), BATF_TCHAR);
}
@@ -360,7 +360,7 @@ INT_PTR CALLBACK DlgProcDisplayData(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA {
TCHAR *ptszToolTip;
HWND hTopmost;
- if ( !db_get_b(hContact, MODULENAME, ON_TOP_KEY, 0)) {
+ if (!db_get_b(hContact, MODULENAME, ON_TOP_KEY, 0)) {
hTopmost = HWND_NOTOPMOST;
ptszToolTip = TranslateT("Stick to the front");
}
@@ -452,7 +452,7 @@ INT_PTR CALLBACK DlgProcDisplayData(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA break;
case WM_MOVE:
- if ( !IsIconic(hwndDlg) && !IsZoomed(hwndDlg)) {
+ if (!IsIconic(hwndDlg) && !IsZoomed(hwndDlg)) {
GetWindowRect(hwndDlg, &rc);
// global
Xposition = rc.left;
diff --git a/plugins/WebView/src/webview_getdata.cpp b/plugins/WebView/src/webview_getdata.cpp index 0c885b9012..eef98ee250 100644 --- a/plugins/WebView/src/webview_getdata.cpp +++ b/plugins/WebView/src/webview_getdata.cpp @@ -72,13 +72,13 @@ void GetData(void *param) db_set_b(hContact, MODULENAME, STOP_KEY, 0);
if (db_get_s(hContact, MODULENAME, PRESERVE_NAME_KEY, &dbv)) {
- if ( !db_get_s(hContact, "CList", "MyHandle", &dbv)) {
+ if (!db_get_s(hContact, "CList", "MyHandle", &dbv)) {
db_set_s(hContact, MODULENAME, PRESERVE_NAME_KEY, dbv.pszVal);
db_free(&dbv);
}
}
- if ( !db_get_s(hContact, MODULENAME, PRESERVE_NAME_KEY, &dbv)) {
+ if (!db_get_s(hContact, MODULENAME, PRESERVE_NAME_KEY, &dbv)) {
strncpy_s(contactname, SIZEOF(contactname), dbv.pszVal, _TRUNCATE);
db_free(&dbv);
}
@@ -88,17 +88,17 @@ void GetData(void *param) if (!Startingup)
db_set_b(NULL, MODULENAME, HAS_CRASHED_KEY, 1);
- if ( !db_get_s(hContact, MODULENAME, START_STRING_KEY, &dbv)) {
+ if (!db_get_s(hContact, MODULENAME, START_STRING_KEY, &dbv)) {
strncpy_s(tempstring, SIZEOF(tempstring), dbv.pszVal, _TRUNCATE);
db_free(&dbv);
}
- if ( !db_get_s(hContact, MODULENAME, END_STRING_KEY, &dbv)) {
+ if (!db_get_s(hContact, MODULENAME, END_STRING_KEY, &dbv)) {
strncpy_s(tempstring2, SIZEOF(tempstring2), dbv.pszVal, _TRUNCATE);
db_free(&dbv);
}
- if ( !db_get_s(hContact, MODULENAME, URL_KEY, &dbv)) {
+ if (!db_get_s(hContact, MODULENAME, URL_KEY, &dbv)) {
strncpy_s(url, SIZEOF(url), dbv.pszVal, _TRUNCATE);
db_free(&dbv);
}
@@ -349,11 +349,11 @@ void GetData(void *param) strncpy(buff, truncated, SIZEOF(buff));
Filter(buff);
- if ( !db_get_s(hContact, MODULENAME, ALRT_S_STRING_KEY, &dbv)) {
+ if (!db_get_s(hContact, MODULENAME, ALRT_S_STRING_KEY, &dbv)) {
strncpy_s(Alerttempstring, SIZEOF(Alerttempstring), dbv.pszVal, _TRUNCATE);
db_free(&dbv);
}
- if ( !db_get_s(hContact, MODULENAME, ALRT_E_STRING_KEY, &dbv)) {
+ if (!db_get_s(hContact, MODULENAME, ALRT_E_STRING_KEY, &dbv)) {
strncpy_s(Alerttempstring2, SIZEOF(Alerttempstring2), dbv.pszVal, _TRUNCATE);
db_free(&dbv);
}
diff --git a/plugins/WebView/src/webview_opts.cpp b/plugins/WebView/src/webview_opts.cpp index 14f776003b..fe02eb5d21 100644 --- a/plugins/WebView/src/webview_opts.cpp +++ b/plugins/WebView/src/webview_opts.cpp @@ -424,7 +424,7 @@ INT_PTR CALLBACK DlgProcAlertOpt(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l }
}
- if ( !db_get_ts(hContact, MODULENAME, FILE_KEY, &dbv)) {
+ if (!db_get_ts(hContact, MODULENAME, FILE_KEY, &dbv)) {
SetDlgItemText(hwndDlg, IDC_FILENAME, dbv.ptszVal);
db_free(&dbv);
}
diff --git a/plugins/XSoundNotify/src/xsn_main.cpp b/plugins/XSoundNotify/src/xsn_main.cpp index 14c2f69c11..c53aaf2715 100644 --- a/plugins/XSoundNotify/src/xsn_main.cpp +++ b/plugins/XSoundNotify/src/xsn_main.cpp @@ -108,14 +108,14 @@ static bool isReceiveMessage(HANDLE hDbEvent) return !(((info.eventType != EVENTTYPE_MESSAGE) && !(info.flags & DBEF_READ)) || (info.flags & DBEF_SENT));
}
-static int ProcessEvent(WPARAM wParam, LPARAM lParam)
+static int ProcessEvent(WPARAM hContact, LPARAM lParam)
{
if (!isReceiveMessage(HANDLE(lParam)))
return 0;
- isIgnoreSound = db_get_b(wParam, SETTINGSNAME, SETTINGSIGNOREKEY, 0);
+ isIgnoreSound = db_get_b(hContact, SETTINGSNAME, SETTINGSIGNOREKEY, 0);
DBVARIANT dbv;
- if ( !isIgnoreSound && !db_get_ts(wParam, SETTINGSNAME, SETTINGSKEY, &dbv)) {
+ if (!isIgnoreSound && !db_get_ts(hContact, SETTINGSNAME, SETTINGSKEY, &dbv)) {
TCHAR PlaySoundPath[MAX_PATH] = {0};
PathToAbsoluteT(dbv.ptszVal, PlaySoundPath);
SkinPlaySoundFile(PlaySoundPath);
diff --git a/protocols/IcqOscarJ/src/icqosc_svcs.cpp b/protocols/IcqOscarJ/src/icqosc_svcs.cpp index c261468d5c..c5060ab1e4 100644 --- a/protocols/IcqOscarJ/src/icqosc_svcs.cpp +++ b/protocols/IcqOscarJ/src/icqosc_svcs.cpp @@ -84,11 +84,11 @@ static int LookupDatabaseSetting(const FieldNamesItem* table, int code, DBVARIAN return 0; // Success
}
-INT_PTR CIcqProto::GetInfoSetting(WPARAM wParam, LPARAM lParam)
+INT_PTR CIcqProto::GetInfoSetting(WPARAM hContact, LPARAM lParam)
{
DBCONTACTGETSETTING *cgs = (DBCONTACTGETSETTING*)lParam;
BYTE type = cgs->pValue->type;
- INT_PTR rc = db_get_s(wParam, cgs->szModule, cgs->szSetting, cgs->pValue, 0);
+ INT_PTR rc = db_get_s(hContact, cgs->szModule, cgs->szSetting, cgs->pValue, 0);
if (rc)
return rc;
diff --git a/protocols/Xfire/src/Xfire_game.h b/protocols/Xfire/src/Xfire_game.h index f88d22dd6a..8be3428983 100644 --- a/protocols/Xfire/src/Xfire_game.h +++ b/protocols/Xfire/src/Xfire_game.h @@ -37,7 +37,7 @@ using namespace std;
//externe funktion die das spielstarten steuern
-extern INT_PTR StartGame(WPARAM wParam,LPARAM lParam,LPARAM fParam);
+extern INT_PTR StartGame(WPARAM wParam, LPARAM lParam,LPARAM fParam);
class Xfire_game : public Xfire_base {
public:
diff --git a/protocols/Xfire/src/Xfire_proxy.cpp b/protocols/Xfire/src/Xfire_proxy.cpp index f2fe0659a6..db3952ee37 100644 --- a/protocols/Xfire/src/Xfire_proxy.cpp +++ b/protocols/Xfire/src/Xfire_proxy.cpp @@ -67,7 +67,7 @@ void XfireclientConnecting(HANDLE hConnection, DWORD, void* extra ) }
//inits nachdem alle module geladen wurden
-int AfterSystemModulesLoaded(WPARAM wParam,LPARAM lParam)
+int AfterSystemModulesLoaded(WPARAM wParam, LPARAM lParam)
{
//init netlib handle
NETLIBUSER nlu = {0};
diff --git a/protocols/Xfire/src/baseProtocol.h b/protocols/Xfire/src/baseProtocol.h index 7bd05730a1..920633eb25 100644 --- a/protocols/Xfire/src/baseProtocol.h +++ b/protocols/Xfire/src/baseProtocol.h @@ -51,11 +51,11 @@ extern HINSTANCE hinstance; extern int bpStatus;
//Services.c
-INT_PTR GetCaps(WPARAM wParam,LPARAM lParam);
-INT_PTR GetName(WPARAM wParam,LPARAM lParam);
-INT_PTR SetStatus(WPARAM wParam,LPARAM lParam);
-INT_PTR GetStatus(WPARAM wParam,LPARAM lParam);
-INT_PTR TMLoadIcon(WPARAM wParam,LPARAM lParam);
+INT_PTR GetCaps(WPARAM wParam, LPARAM lParam);
+INT_PTR GetName(WPARAM wParam, LPARAM lParam);
+INT_PTR SetStatus(WPARAM wParam, LPARAM lParam);
+INT_PTR GetStatus(WPARAM wParam, LPARAM lParam);
+INT_PTR TMLoadIcon(WPARAM wParam, LPARAM lParam);
INT_PTR SetNickName(WPARAM newnick, LPARAM lparam);
BOOL IsXFireContact(MCONTACT h);
diff --git a/protocols/Xfire/src/main.cpp b/protocols/Xfire/src/main.cpp index 5087537cb1..f5178659e5 100644 --- a/protocols/Xfire/src/main.cpp +++ b/protocols/Xfire/src/main.cpp @@ -91,8 +91,8 @@ Xfire_voicechat voicechat; HANDLE hLogEvent;
int bpStatus = ID_STATUS_OFFLINE;
int previousMode;
-int OptInit(WPARAM wParam,LPARAM lParam);
-int OnDetailsInit(WPARAM wParam,LPARAM lParam);
+int OptInit(WPARAM wParam, LPARAM lParam);
+int OnDetailsInit(WPARAM wParam, LPARAM lParam);
HANDLE hFillListEvent = 0;
CONTACT user;
HINSTANCE hinstance = NULL;
@@ -161,12 +161,12 @@ static INT_PTR GetVIPPort(WPARAM /*wParam*/,LPARAM lParam); int RebuildContactMenu( WPARAM wParam, LPARAM lParam );
int doneQuery( WPARAM wParam, LPARAM lParam );
-static INT_PTR GotoProfile(WPARAM wParam,LPARAM lParam);
-static INT_PTR GotoProfileAct(WPARAM wParam,LPARAM lParam);
-static INT_PTR GotoXFireClanSite(WPARAM wParam,LPARAM lParam);
-static INT_PTR ReScanMyGames(WPARAM wParam,LPARAM lParam);
-static INT_PTR SetNickDlg(WPARAM wParam,LPARAM lParam);
-static INT_PTR CustomGameSetup(WPARAM wParam,LPARAM lParam);
+static INT_PTR GotoProfile(WPARAM wParam, LPARAM lParam);
+static INT_PTR GotoProfileAct(WPARAM wParam, LPARAM lParam);
+static INT_PTR GotoXFireClanSite(WPARAM wParam, LPARAM lParam);
+static INT_PTR ReScanMyGames(WPARAM wParam, LPARAM lParam);
+static INT_PTR SetNickDlg(WPARAM wParam, LPARAM lParam);
+static INT_PTR CustomGameSetup(WPARAM wParam, LPARAM lParam);
#ifndef NO_PTHREAD
void *gamedetectiont(void *ptr);
@@ -178,25 +178,25 @@ static INT_PTR CustomGameSetup(WPARAM wParam,LPARAM lParam); #endif
INT_PTR AddtoList( WPARAM wParam, LPARAM lParam );
-INT_PTR BasicSearch(WPARAM wParam,LPARAM lParam);
+INT_PTR BasicSearch(WPARAM wParam, LPARAM lParam);
INT_PTR GetAvatarInfo(WPARAM wParam, LPARAM lParam); //GAIR_NOAVATAR
-INT_PTR SearchAddtoList(WPARAM wParam,LPARAM lParam);
+INT_PTR SearchAddtoList(WPARAM wParam, LPARAM lParam);
INT_PTR SendPrefs(WPARAM wparam, LPARAM lparam);
INT_PTR SetAwayMsg(WPARAM wParam, LPARAM lParam);
//INT_PTR GetAwayMsg(WPARAM wParam, LPARAM lParam);
INT_PTR GetXStatusIcon(WPARAM wParam, LPARAM lParam);
-static INT_PTR GotoProfile2(WPARAM wParam,LPARAM lParam);
+static INT_PTR GotoProfile2(WPARAM wParam, LPARAM lParam);
MCONTACT handlingBuddys(BuddyListEntry *entry, int clan=0,char* group=NULL,BOOL dontscan=FALSE);
-int StatusIcon(WPARAM wParam,LPARAM lParam);
+int StatusIcon(WPARAM wParam, LPARAM lParam);
void CreateGroup(char*grpn,char*field); //void CreateGroup(char*grp);
int ContactDeleted(WPARAM wParam,LPARAM /*lParam*/);
-INT_PTR JoinGame(WPARAM wParam,LPARAM lParam);
+INT_PTR JoinGame(WPARAM wParam, LPARAM lParam);
extern void Scan4Games( LPVOID lparam );
-INT_PTR RemoveFriend(WPARAM wParam,LPARAM lParam);
-INT_PTR BlockFriend(WPARAM wParam,LPARAM lParam);
-INT_PTR StartThisGame(WPARAM wParam,LPARAM lParam);
+INT_PTR RemoveFriend(WPARAM wParam, LPARAM lParam);
+INT_PTR BlockFriend(WPARAM wParam, LPARAM lParam);
+INT_PTR StartThisGame(WPARAM wParam, LPARAM lParam);
int IconLibChanged(WPARAM wParam, LPARAM lParam);
void SetAvatar2(LPVOID lparam);
int ExtraListRebuild(WPARAM wparam, LPARAM lparam);
@@ -884,7 +884,7 @@ INT_PTR UrlCall(WPARAM wparam,LPARAM lparam) { }
//wenn alle module geladen sind
-static int OnSystemModulesLoaded(WPARAM wParam,LPARAM lParam)
+static int OnSystemModulesLoaded(WPARAM wParam, LPARAM lParam)
{
/*NETLIB***********************************/
NETLIBUSER nlu;
@@ -1386,7 +1386,7 @@ INT_PTR SendMessage(WPARAM wParam, LPARAM lParam) //GetCaps
//=======================================================
-INT_PTR GetCaps(WPARAM wParam,LPARAM lParam)
+INT_PTR GetCaps(WPARAM wParam, LPARAM lParam)
{
if (wParam==PFLAGNUM_1)
return PF1_BASICSEARCH|PF1_MODEMSG|PF1_IM/*|PF1_SERVERCLIST*/;
@@ -1408,7 +1408,7 @@ INT_PTR GetCaps(WPARAM wParam,LPARAM lParam) //=======================================================
//GetName (tray icon)
//=======================================================
-INT_PTR GetName(WPARAM wParam,LPARAM lParam)
+INT_PTR GetName(WPARAM wParam, LPARAM lParam)
{
lstrcpynA((char*)lParam,"XFire",wParam);
return 0;
@@ -1417,7 +1417,7 @@ INT_PTR GetName(WPARAM wParam,LPARAM lParam) //=======================================================
//TMLoadIcon
//=======================================================
-INT_PTR TMLoadIcon(WPARAM wParam,LPARAM lParam)
+INT_PTR TMLoadIcon(WPARAM wParam, LPARAM lParam)
{
if (LOWORD( wParam ) == PLI_PROTOCOL) {
if (wParam & PLIF_ICOLIB)
@@ -1464,7 +1464,7 @@ static void ConnectingThread(LPVOID params) //=======================================================
//SetStatus
//=======================================================
-INT_PTR SetStatus(WPARAM wParam,LPARAM lParam)
+INT_PTR SetStatus(WPARAM wParam, LPARAM lParam)
{
int oldStatus;
@@ -1582,7 +1582,7 @@ INT_PTR SetStatus(WPARAM wParam,LPARAM lParam) //=======================================================
//GetStatus
//=======================================================
-INT_PTR GetStatus(WPARAM wParam,LPARAM lParam)
+INT_PTR GetStatus(WPARAM wParam, LPARAM lParam)
{
if (bpStatus == ID_STATUS_ONLINE)
return ID_STATUS_ONLINE;
@@ -1922,29 +1922,24 @@ BOOL GetAvatar(char* username,XFireAvatar* av) return status;
}
-static INT_PTR GetIPPort(WPARAM wParam,LPARAM lParam)
+static INT_PTR GetIPPort(WPARAM hContact, LPARAM lParam)
{
- char temp[XFIRE_MAX_STATIC_STRING_LEN];
- HGLOBAL clipbuffer;
- char* buffer;
-
- if (db_get_w(wParam, protocolname, "Port", -1)==0)
+ if (db_get_w(hContact, protocolname, "Port", -1)==0)
return 0;
DBVARIANT dbv;
- if (db_get_s(wParam, protocolname, "ServerIP",&dbv))
+ if (db_get_s(hContact, protocolname, "ServerIP",&dbv))
return 0;
- mir_snprintf(temp, SIZEOF(temp), "%s:%d", dbv.pszVal, db_get_w(wParam, protocolname, "Port", -1));
-
+ char temp[XFIRE_MAX_STATIC_STRING_LEN];
+ mir_snprintf(temp, SIZEOF(temp), "%s:%d", dbv.pszVal, db_get_w(hContact, protocolname, "Port", -1));
db_free(&dbv);
- if (OpenClipboard(NULL))
- {
+ if (OpenClipboard(NULL)) {
EmptyClipboard();
- clipbuffer = GlobalAlloc(GMEM_DDESHARE, strlen(temp)+1);
- buffer = (char*)GlobalLock(clipbuffer);
+ HGLOBAL clipbuffer = GlobalAlloc(GMEM_DDESHARE, strlen(temp)+1);
+ char *buffer = (char*)GlobalLock(clipbuffer);
strcpy(buffer, LPCSTR(temp));
GlobalUnlock(clipbuffer);
@@ -1955,29 +1950,24 @@ static INT_PTR GetIPPort(WPARAM wParam,LPARAM lParam) return 0;
}
-static INT_PTR GetVIPPort(WPARAM wParam,LPARAM lParam)
+static INT_PTR GetVIPPort(WPARAM hContact, LPARAM lParam)
{
- char temp[XFIRE_MAX_STATIC_STRING_LEN];
- HGLOBAL clipbuffer;
- char* buffer;
-
- if (db_get_w(wParam, protocolname, "VPort", -1)==0)
+ if (db_get_w(hContact, protocolname, "VPort", -1)==0)
return 0;
DBVARIANT dbv;
- if (db_get_s(wParam, protocolname, "VServerIP",&dbv))
+ if (db_get_s(hContact, protocolname, "VServerIP",&dbv))
return 0;
- mir_snprintf(temp, SIZEOF(temp), "%s:%d", dbv.pszVal, db_get_w(wParam, protocolname, "VPort", -1));
-
+ char temp[XFIRE_MAX_STATIC_STRING_LEN];
+ mir_snprintf(temp, SIZEOF(temp), "%s:%d", dbv.pszVal, db_get_w(hContact, protocolname, "VPort", -1));
db_free(&dbv);
- if (OpenClipboard(NULL))
- {
+ if (OpenClipboard(NULL)) {
EmptyClipboard();
- clipbuffer = GlobalAlloc(GMEM_DDESHARE, strlen(temp)+1);
- buffer = (char*)GlobalLock(clipbuffer);
+ HGLOBAL clipbuffer = GlobalAlloc(GMEM_DDESHARE, strlen(temp)+1);
+ char *buffer = (char*)GlobalLock(clipbuffer);
strcpy(buffer, LPCSTR(temp));
GlobalUnlock(clipbuffer);
@@ -1988,28 +1978,28 @@ static INT_PTR GetVIPPort(WPARAM wParam,LPARAM lParam) return 0;
}
-static INT_PTR GotoProfile(WPARAM wParam,LPARAM lParam)
+static INT_PTR GotoProfile(WPARAM hContact, LPARAM lParam)
{
DBVARIANT dbv;
- char temp[64]="";
-
- if (db_get_s(wParam, protocolname, "Username",&dbv))
+ if (db_get_s(hContact, protocolname, "Username",&dbv))
return 0;
+ char temp[64];
strcpy(temp,"http://xfire.com/profile/");
strcat_s(temp,64,dbv.pszVal);
db_free(&dbv);
- CallService(MS_UTILS_OPENURL, 1, (LPARAM)temp );
+ CallService(MS_UTILS_OPENURL, 1, (LPARAM)temp);
return 0;
}
-static INT_PTR GotoXFireClanSite(WPARAM wParam,LPARAM lParam) {
+static INT_PTR GotoXFireClanSite(WPARAM hContact, LPARAM lParam)
+{
DBVARIANT dbv;
char temp[64]="";
- int clanid=db_get_dw(wParam, protocolname, "Clan",-1);
+ int clanid=db_get_dw(hContact, protocolname, "Clan",-1);
mir_snprintf(temp, SIZEOF(temp), "ClanUrl_%d", clanid);
if (db_get_s(NULL, protocolname, temp,&dbv))
@@ -2019,34 +2009,27 @@ static INT_PTR GotoXFireClanSite(WPARAM wParam,LPARAM lParam) { strcat_s(temp,64,dbv.pszVal);
db_free(&dbv);
- CallService(MS_UTILS_OPENURL, 1, (LPARAM)temp );
+ CallService(MS_UTILS_OPENURL, 1, (LPARAM)temp);
return 0;
}
-static INT_PTR GotoProfile2(WPARAM wParam,LPARAM lParam)
+static INT_PTR GotoProfile2(WPARAM wParam, LPARAM lParam)
{
DBVARIANT dbv;
- char temp[64]="";
-
if (db_get_s(NULL, protocolname, "login",&dbv))
return 0;
+ char temp[64];
strcpy(temp,"http://xfire.com/profile/");
- strcat_s(temp,64,dbv.pszVal);
+ strcat_s(temp, 64, dbv.pszVal);
db_free(&dbv);
- CallService(MS_UTILS_OPENURL, 1, (LPARAM)temp );
-
- //prefrences pakcet senden
- //XFirePrefPacket *packet2 = new XFirePrefPacket();
- //myClient->client->send( packet2 );
- //delete(packet2);
-
+ CallService(MS_UTILS_OPENURL, 1, (LPARAM)temp);
return 0;
}
-static INT_PTR GotoProfileAct(WPARAM wParam,LPARAM lParam)
+static INT_PTR GotoProfileAct(WPARAM wParam, LPARAM lParam)
{
DBVARIANT dbv;
char temp[64]="";
@@ -2058,13 +2041,7 @@ static INT_PTR GotoProfileAct(WPARAM wParam,LPARAM lParam) strcat_s(temp,64,dbv.pszVal);
db_free(&dbv);
- CallService(MS_UTILS_OPENURL, 1, (LPARAM)temp );
-
- //prefrences pakcet senden
- //XFirePrefPacket *packet2 = new XFirePrefPacket();
- //myClient->client->send( packet2 );
- //delete(packet2);
-
+ CallService(MS_UTILS_OPENURL, 1, (LPARAM)temp);
return 0;
}
@@ -2151,19 +2128,14 @@ void SetXFireGameStatusMsg(Xfire_game* game) if (!game) return;
if (!game->statusmsg)
- {
xgamelist.getIniValue(game->id,"XUSERStatusMsg",statusmsg,100);
- }
else
- {
strcpy_s(statusmsg,100,game->statusmsg);
- }
if (statusmsg[0]!=0)
if (myClient!=NULL)
if (myClient->client->connected)
myClient->Status(statusmsg);
-
}
#ifndef NO_PTHREAD
@@ -2578,7 +2550,7 @@ void gamedetectiont(LPVOID lparam) }
}
-static INT_PTR ReScanMyGames(WPARAM wParam,LPARAM lParam)
+static INT_PTR ReScanMyGames(WPARAM wParam, LPARAM lParam)
{
db_unset(NULL, protocolname, "foundgames");
@@ -2587,7 +2559,7 @@ static INT_PTR ReScanMyGames(WPARAM wParam,LPARAM lParam) return 0;
}
-static INT_PTR CustomGameSetup(WPARAM wParam,LPARAM lParam)
+static INT_PTR CustomGameSetup(WPARAM wParam, LPARAM lParam)
{
//DialogBox(hinstance,MAKEINTRESOURCE(IDD_GAMELIST),NULL,DlgAddGameProc);
return 0;
@@ -3076,7 +3048,7 @@ static void __cdecl AckBasicSearch(void * pszNick) }
}
-INT_PTR BasicSearch(WPARAM wParam,LPARAM lParam) {
+INT_PTR BasicSearch(WPARAM wParam, LPARAM lParam) {
static char buf[50];
if ( lParam ) {
if (myClient!=NULL)
@@ -3093,7 +3065,7 @@ INT_PTR BasicSearch(WPARAM wParam,LPARAM lParam) { -INT_PTR SearchAddtoList(WPARAM wParam,LPARAM lParam)
+INT_PTR SearchAddtoList(WPARAM wParam, LPARAM lParam)
{
PROTOSEARCHRESULT *psr = ( PROTOSEARCHRESULT* ) lParam;
@@ -3236,30 +3208,28 @@ INT_PTR SetNickName(WPARAM newnick, LPARAM lparam) //sendet neue preferencen zu xfire
INT_PTR SendPrefs(WPARAM wparam, LPARAM lparam)
{
- if (myClient!=NULL)
- if (myClient->client->connected)
- {
+ if (myClient != NULL)
+ if (myClient->client->connected) {
PrefsPacket prefs;
for(int i=0;i<XFIRE_RECVPREFSPACKET_MAXCONFIGS;i++)
- {
prefs.config[i]=xfireconfig[i];
- }
+
myClient->client->send( &prefs );
return TRUE;
}
return FALSE;
}
-int ContactDeleted(WPARAM wParam,LPARAM lParam)
+int ContactDeleted(WPARAM hContact, LPARAM lParam)
{
- if (!db_get_b(wParam, protocolname, "DontSendDenyPacket", 0))
- if (db_get_b(wParam,"CList","NotOnList",0))
+ if (!db_get_b(hContact, protocolname, "DontSendDenyPacket", 0))
+ if (db_get_b(hContact,"CList","NotOnList",0))
{
if (myClient!=NULL)
if (myClient->client->connected)
{
DBVARIANT dbv2;
- if (!db_get(wParam,protocolname,"Username",&dbv2)) {
+ if (!db_get(hContact,protocolname,"Username",&dbv2)) {
SendDenyInvitationPacket deny;
deny.name = dbv2.pszVal;
myClient->client->send( &deny );
@@ -3269,7 +3239,7 @@ int ContactDeleted(WPARAM wParam,LPARAM lParam) return 0;
}
-INT_PTR StartGame(WPARAM wParam,LPARAM lParam,LPARAM fParam)
+INT_PTR StartGame(WPARAM wParam, LPARAM lParam,LPARAM fParam)
{
//gamelist blocken
xgamelist.Block(TRUE);
@@ -3287,12 +3257,12 @@ INT_PTR StartGame(WPARAM wParam,LPARAM lParam,LPARAM fParam) return 0;
}
-INT_PTR RemoveFriend(WPARAM wParam,LPARAM lParam)
+INT_PTR RemoveFriend(WPARAM hContact, LPARAM lParam)
{
char temp[256];
DBVARIANT dbv;
- if (!db_get_s(wParam, protocolname, "Username",&dbv))
+ if (!db_get_s(hContact, protocolname, "Username",&dbv))
{
mir_snprintf(temp, SIZEOF(temp), Translate("Do you really want to delete your friend %s?"), dbv.pszVal);
if (MessageBoxA(NULL,temp,Translate("Confirm Delete"),MB_YESNO|MB_ICONQUESTION)==IDYES)
@@ -3303,7 +3273,7 @@ INT_PTR RemoveFriend(WPARAM wParam,LPARAM lParam) {
SendRemoveBuddyPacket removeBuddy;
- removeBuddy.userid=db_get_dw(wParam,protocolname,"UserId",0);
+ removeBuddy.userid=db_get_dw(hContact,protocolname,"UserId",0);
if (removeBuddy.userid!=0)
{
@@ -3317,11 +3287,11 @@ INT_PTR RemoveFriend(WPARAM wParam,LPARAM lParam) return 0;
}
-INT_PTR BlockFriend(WPARAM wParam,LPARAM lParam)
+INT_PTR BlockFriend(WPARAM hContact, LPARAM lParam)
{
DBVARIANT dbv;
- if (!db_get_s(wParam, protocolname, "Username",&dbv))
+ if (!db_get_s(hContact, protocolname, "Username",&dbv))
{
if (MessageBox(NULL,TranslateT("Block this user from ever contacting you again?"),TranslateT("Block Confirmation"),MB_YESNO|MB_ICONQUESTION)==IDYES)
{
@@ -3337,21 +3307,22 @@ INT_PTR BlockFriend(WPARAM wParam,LPARAM lParam) }
}
}
- CallService(MS_DB_CONTACT_DELETE, (WPARAM) wParam, 1);
+ CallService(MS_DB_CONTACT_DELETE, (WPARAM) hContact, 1);
db_free(&dbv);
}
return 0;
}
-INT_PTR StartThisGame(WPARAM wParam,LPARAM lParam) {
+INT_PTR StartThisGame(WPARAM wParam, LPARAM lParam)
+{
//gamelist blocken
xgamelist.Block(TRUE);
//hole die gameid des spiels
- int id=db_get_w(wParam, protocolname, "GameId",0);
+ int id = db_get_w(wParam, protocolname, "GameId",0);
//hole passendes spielobjekt
- Xfire_game*game=xgamelist.getGamebyGameid(id);
+ Xfire_game*game = xgamelist.getGamebyGameid(id);
//starte das spiel
if (game)
@@ -3363,23 +3334,20 @@ INT_PTR StartThisGame(WPARAM wParam,LPARAM lParam) { return 0;
}
-INT_PTR JoinGame(WPARAM wParam,LPARAM lParam) {
+INT_PTR JoinGame(WPARAM hContact, LPARAM lParam)
+{
//gamelist blocken
xgamelist.Block(TRUE);
//hole die gameid des spiels
- int id=db_get_w(wParam, protocolname, "GameId",0);
+ int id = db_get_w(hContact, protocolname, "GameId",0);
//hole passendes spielobjekt
- Xfire_game*game=xgamelist.getGamebyGameid(id);
-
- //starte das spiel
- if (game)
- {
+ Xfire_game *game = xgamelist.getGamebyGameid(id);
+ if (game) {
DBVARIANT dbv; //dbv.pszVal
- int port=db_get_w(wParam, protocolname, "Port",0);
- if (!db_get_s(wParam, protocolname, "ServerIP",&dbv))
- {
+ int port=db_get_w(hContact, protocolname, "Port",0);
+ if (!db_get_s(hContact, protocolname, "ServerIP",&dbv)) {
//starte spiel mit netzwerk parametern
game->start_game(dbv.pszVal,port);
db_free(&dbv);
@@ -3388,8 +3356,6 @@ INT_PTR JoinGame(WPARAM wParam,LPARAM lParam) { //gamelist unblocken
xgamelist.Block(FALSE);
-
-
return 0;
}
@@ -3411,7 +3377,7 @@ int doneQuery( WPARAM wParam, LPARAM lParam ) { return 0;
}
-static INT_PTR SetNickDlg(WPARAM wParam,LPARAM lParam) {
+static INT_PTR SetNickDlg(WPARAM wParam, LPARAM lParam) {
return ShowSetNick();
}
diff --git a/protocols/Xfire/src/searching4games.cpp b/protocols/Xfire/src/searching4games.cpp index 6cd9512e8d..4f1bca085c 100644 --- a/protocols/Xfire/src/searching4games.cpp +++ b/protocols/Xfire/src/searching4games.cpp @@ -34,7 +34,7 @@ using std::string; extern int foundgames;
extern HANDLE XFireAvatarFolder;
extern HANDLE XFireWorkingFolder;
-extern INT_PTR StartGame(WPARAM wParam,LPARAM lParam,LPARAM fParam);
+extern INT_PTR StartGame(WPARAM wParam, LPARAM lParam,LPARAM fParam);
extern Xfire_gamelist xgamelist;
//versucht die * in den pfaden der ini mit dem korrekten eintrag zu ersetzen
diff --git a/protocols/Xfire/src/userdetails.cpp b/protocols/Xfire/src/userdetails.cpp index 45d72bdb58..96ef2044f2 100644 --- a/protocols/Xfire/src/userdetails.cpp +++ b/protocols/Xfire/src/userdetails.cpp @@ -85,29 +85,24 @@ void SetItemTxt(HWND hwndDlg,int feldid,char*feld,MCONTACT hcontact,int type) }
}
-static int GetIPPortUDetails(MCONTACT wParam,char* feld1,char* feld2)
+static int GetIPPortUDetails(MCONTACT hContact,char* feld1,char* feld2)
{
- char temp[255];
- HGLOBAL clipbuffer;
- char* buffer;
-
- if (db_get_w(wParam, protocolname, feld2, -1)==0)
+ if (db_get_w(hContact, protocolname, feld2, -1)==0)
return 0;
DBVARIANT dbv;
- if (db_get_s(wParam, protocolname, feld1,&dbv))
+ if (db_get_s(hContact, protocolname, feld1,&dbv))
return 0;
- mir_snprintf(temp, SIZEOF(temp), "%s:%d", dbv.pszVal, db_get_w(wParam, protocolname, feld2, -1));
-
+ char temp[255];
+ mir_snprintf(temp, SIZEOF(temp), "%s:%d", dbv.pszVal, db_get_w(hContact, protocolname, feld2, -1));
db_free(&dbv);
- if (OpenClipboard(NULL))
- {
+ if (OpenClipboard(NULL)) {
EmptyClipboard();
- clipbuffer = GlobalAlloc(GMEM_DDESHARE, strlen(temp)+1);
- buffer = (char*)GlobalLock(clipbuffer);
+ HGLOBAL clipbuffer = GlobalAlloc(GMEM_DDESHARE, strlen(temp)+1);
+ char *buffer = (char*)GlobalLock(clipbuffer);
strcpy(buffer, LPCSTR(temp));
GlobalUnlock(clipbuffer);
@@ -121,16 +116,13 @@ static int GetIPPortUDetails(MCONTACT wParam,char* feld1,char* feld2) void addToList(HWND listbox,MCONTACT hContact,char*key,char*val)
{
DBVARIANT dbv;
- if (!db_get(hContact,protocolname,val,&dbv))
- {
- LVITEMA lvitem;
- memset(&lvitem,0,sizeof(lvitem));
+ if (!db_get_s(hContact,protocolname,val,&dbv)) {
+ LVITEMA lvitem = { 0 };
lvitem.mask=LVIF_TEXT;
lvitem.cchTextMax=255;
- lvitem.iItem=0;
- lvitem.iSubItem=0;
lvitem.pszText=key;
SendMessageA(listbox,LVM_INSERTITEM,0,(LPARAM)&lvitem);
+
lvitem.iSubItem++;
lvitem.pszText=dbv.pszVal;
SendMessageA(listbox,LVM_SETITEM,0,(LPARAM)&lvitem);
@@ -427,7 +419,7 @@ static INT_PTR CALLBACK DlgProcUserDetails(HWND hwndDlg, UINT msg, WPARAM wParam return FALSE;
}*/
-int OnDetailsInit(WPARAM wParam,LPARAM lParam)
+int OnDetailsInit(WPARAM wParam, LPARAM lParam)
{
if (!IsXFireContact(lParam))
return 0;
diff --git a/src/core/stdaway/awaymsg.cpp b/src/core/stdaway/awaymsg.cpp index e52709a35f..bfdcc52ada 100644 --- a/src/core/stdaway/awaymsg.cpp +++ b/src/core/stdaway/awaymsg.cpp @@ -131,18 +131,18 @@ static INT_PTR GetMessageCommand(WPARAM wParam, LPARAM) return 0;
}
-static int AwayMsgPreBuildMenu(WPARAM wParam, LPARAM)
+static int AwayMsgPreBuildMenu(WPARAM hContact, LPARAM)
{
TCHAR str[128];
- char *szProto = GetContactProto(wParam);
+ char *szProto = GetContactProto(hContact);
CLISTMENUITEM mi = { sizeof(mi) };
mi.flags = CMIM_FLAGS | CMIF_NOTOFFLINE | CMIF_HIDDEN | CMIF_TCHAR;
if (szProto != NULL) {
- int chatRoom = szProto ? db_get_b(wParam, szProto, "ChatRoom", 0) : 0;
+ int chatRoom = szProto ? db_get_b(hContact, szProto, "ChatRoom", 0) : 0;
if ( !chatRoom) {
- int status = db_get_w(wParam, szProto, "Status", ID_STATUS_OFFLINE);
+ int status = db_get_w(hContact, szProto, "Status", ID_STATUS_OFFLINE);
mir_sntprintf(str, SIZEOF(str), TranslateT("Re&ad %s message"), pcli->pfnGetStatusModeDescription(status, 0));
mi.ptszName = str;
if (CallProtoService(szProto, PS_GETCAPS, PFLAGNUM_1, 0) & PF1_MODEMSGRECV) {
diff --git a/src/core/stdemail/email.cpp b/src/core/stdemail/email.cpp index 9cd254783d..23ae28da48 100644 --- a/src/core/stdemail/email.cpp +++ b/src/core/stdemail/email.cpp @@ -32,12 +32,12 @@ void SendEmailThread(void *szUrl) return;
}
-static INT_PTR SendEMailCommand(WPARAM wParam, LPARAM lParam)
+static INT_PTR SendEMailCommand(WPARAM hContact, LPARAM lParam)
{
DBVARIANT dbv;
- char *szProto = GetContactProto(wParam);
- if (szProto == NULL || db_get_s(wParam, szProto, "e-mail", &dbv)) {
- if (db_get_s(wParam, "UserInfo", "Mye-mail0", &dbv)) {
+ char *szProto = GetContactProto(hContact);
+ if (szProto == NULL || db_get_s(hContact, szProto, "e-mail", &dbv)) {
+ if (db_get_s(hContact, "UserInfo", "Mye-mail0", &dbv)) {
MessageBox((HWND)lParam, TranslateT("User has not registered an e-mail address"), TranslateT("Send e-mail"), MB_OK);
return 1;
}
@@ -50,13 +50,13 @@ static INT_PTR SendEMailCommand(WPARAM wParam, LPARAM lParam) return 0;
}
-static int EMailPreBuildMenu(WPARAM wParam, LPARAM)
+static int EMailPreBuildMenu(WPARAM hContact, LPARAM)
{
bool bEnabled = true;
DBVARIANT dbv = { 0 };
- char *szProto = GetContactProto(wParam);
- if (szProto == NULL || db_get_s(wParam, szProto, "e-mail", &dbv))
- if (db_get_s(wParam, "UserInfo", "Mye-mail0", &dbv))
+ char *szProto = GetContactProto(hContact);
+ if (szProto == NULL || db_get_s(hContact, szProto, "e-mail", &dbv))
+ if (db_get_s(hContact, "UserInfo", "Mye-mail0", &dbv))
bEnabled = false;
Menu_ShowItem(hEMailMenuItem, bEnabled);
|