summaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2014-02-11 19:01:03 +0000
committerGeorge Hazan <george.hazan@gmail.com>2014-02-11 19:01:03 +0000
commit1925d3521846f4e6683d3d537cc41de9c9bd7250 (patch)
tree3f9bd6e5f557dc9eac040b078ededd5ee8e7870d /src/core
parentb63d67c92da0c420ee7c4f81b8ecdd3b8cfd132d (diff)
"we don't need these variables" (c) Pink Floyd
git-svn-id: http://svn.miranda-ng.org/main/trunk@8101 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'src/core')
-rw-r--r--src/core/stdfile/file.cpp12
-rw-r--r--src/core/stdmsg/src/globals.cpp9
-rw-r--r--src/core/stdmsg/src/msgs.cpp42
-rw-r--r--src/core/stdmsg/src/statusicon.cpp3
-rw-r--r--src/core/stdurl/url.cpp8
-rw-r--r--src/core/stduseronline/useronline.cpp22
6 files changed, 46 insertions, 50 deletions
diff --git a/src/core/stdfile/file.cpp b/src/core/stdfile/file.cpp
index 19dcf2f27c..08d5b250b5 100644
--- a/src/core/stdfile/file.cpp
+++ b/src/core/stdfile/file.cpp
@@ -59,19 +59,19 @@ TCHAR *GetContactID(MCONTACT hContact)
return NULL;
}
-static INT_PTR SendFileCommand(WPARAM wParam, LPARAM)
+static INT_PTR SendFileCommand(WPARAM hContact, LPARAM)
{
struct FileSendData fsd;
- fsd.hContact = wParam;
+ fsd.hContact = hContact;
fsd.ppFiles = NULL;
CreateDialogParam(hInst, MAKEINTRESOURCE(IDD_FILESEND), NULL, DlgProcSendFile, (LPARAM)&fsd);
return 0;
}
-static INT_PTR SendSpecificFiles(WPARAM wParam, LPARAM lParam)
+static INT_PTR SendSpecificFiles(WPARAM hContact, LPARAM lParam)
{
FileSendData fsd;
- fsd.hContact = wParam;
+ fsd.hContact = hContact;
char** ppFiles = (char**)lParam;
int count = 0;
@@ -89,10 +89,10 @@ static INT_PTR SendSpecificFiles(WPARAM wParam, LPARAM lParam)
return 0;
}
-static INT_PTR SendSpecificFilesT(WPARAM wParam, LPARAM lParam)
+static INT_PTR SendSpecificFilesT(WPARAM hContact, LPARAM lParam)
{
FileSendData fsd;
- fsd.hContact = wParam;
+ fsd.hContact = hContact;
fsd.ppFiles = (const TCHAR**)lParam;
CreateDialogParam(hInst, MAKEINTRESOURCE(IDD_FILESEND), NULL, DlgProcSendFile, (LPARAM)&fsd);
return 0;
diff --git a/src/core/stdmsg/src/globals.cpp b/src/core/stdmsg/src/globals.cpp
index fb90ce71ff..a56ee6f898 100644
--- a/src/core/stdmsg/src/globals.cpp
+++ b/src/core/stdmsg/src/globals.cpp
@@ -119,9 +119,8 @@ void ReloadGlobals()
if (g_dat.msgTimeout < SRMSGSET_MSGTIMEOUT_MIN) g_dat.msgTimeout = SRMSGDEFSET_MSGTIMEOUT;
}
-static int dbaddedevent(WPARAM wParam, LPARAM lParam)
+static int dbaddedevent(WPARAM hContact, LPARAM lParam)
{
- MCONTACT hContact = wParam;
if (hContact) {
HWND h = WindowList_Find(g_dat.hMessageWindowList, hContact);
if (h)
@@ -142,10 +141,10 @@ static int ackevent(WPARAM wParam, LPARAM lParam)
return 0;
}
-int AvatarChanged(WPARAM wParam, LPARAM lParam)
+int AvatarChanged(WPARAM hContact, LPARAM lParam)
{
- MCONTACT hContact = wParam;
HWND h = WindowList_Find(g_dat.hMessageWindowList, hContact);
- if (h) SendMessage(h, HM_AVATARACK, wParam, lParam);
+ if (h)
+ SendMessage(h, HM_AVATARACK, hContact, lParam);
return 0;
}
diff --git a/src/core/stdmsg/src/msgs.cpp b/src/core/stdmsg/src/msgs.cpp
index 83312cb914..f164d72b31 100644
--- a/src/core/stdmsg/src/msgs.cpp
+++ b/src/core/stdmsg/src/msgs.cpp
@@ -49,7 +49,7 @@ static int SRMMStatusToPf2(int status)
return 0;
}
-static int MessageEventAdded(WPARAM wParam, LPARAM lParam)
+static int MessageEventAdded(WPARAM hContact, LPARAM lParam)
{
DBEVENTINFO dbei = { sizeof(dbei) };
db_event_get((HANDLE)lParam, &dbei);
@@ -57,9 +57,9 @@ static int MessageEventAdded(WPARAM wParam, LPARAM lParam)
if (dbei.flags & (DBEF_SENT | DBEF_READ) || !(dbei.eventType == EVENTTYPE_MESSAGE || DbEventIsForMsgWindow(&dbei)))
return 0;
- CallServiceSync(MS_CLIST_REMOVEEVENT, wParam, (LPARAM) 1);
+ CallServiceSync(MS_CLIST_REMOVEEVENT, hContact, 1);
/* does a window for the contact exist? */
- HWND hwnd = WindowList_Find(g_dat.hMessageWindowList, wParam);
+ HWND hwnd = WindowList_Find(g_dat.hMessageWindowList, hContact);
if (hwnd) {
if (!db_get_b(NULL, SRMMMOD, SRMSGSET_DONOTSTEALFOCUS, SRMSGDEFSET_DONOTSTEALFOCUS)) {
ShowWindow(hwnd, SW_RESTORE);
@@ -78,10 +78,10 @@ static int MessageEventAdded(WPARAM wParam, LPARAM lParam)
/* new message */
SkinPlaySound("AlertMsg");
- char *szProto = GetContactProto(wParam);
+ char *szProto = GetContactProto(hContact);
if (szProto && (g_dat.openFlags & SRMMStatusToPf2(CallProtoService(szProto, PS_GETSTATUS, 0, 0)))) {
NewMessageWindowLParam newData = { 0 };
- newData.hContact = wParam;
+ newData.hContact = hContact;
newData.noActivate = db_get_b(NULL, SRMMMOD, SRMSGSET_DONOTSTEALFOCUS, SRMSGDEFSET_DONOTSTEALFOCUS);
CreateDialogParam(g_hInst, MAKEINTRESOURCE(IDD_MSG), NULL, DlgProcMessage, (LPARAM)&newData);
return 0;
@@ -89,12 +89,12 @@ static int MessageEventAdded(WPARAM wParam, LPARAM lParam)
TCHAR toolTip[256], *contactName;
CLISTEVENT cle = { sizeof(cle) };
- cle.hContact = wParam;
+ cle.hContact = hContact;
cle.hDbEvent = (HANDLE)lParam;
cle.flags = CLEF_TCHAR;
cle.hIcon = LoadSkinnedIcon(SKINICON_EVENT_MESSAGE);
cle.pszService = "SRMsg/ReadMessage";
- contactName = pcli->pfnGetContactDisplayName(wParam, 0);
+ contactName = pcli->pfnGetContactDisplayName(hContact, 0);
mir_sntprintf(toolTip, SIZEOF(toolTip), TranslateT("Message from %s"), contactName);
cle.ptszTooltip = toolTip;
CallService(MS_CLIST_ADDEVENT, 0, (LPARAM)&cle);
@@ -152,21 +152,21 @@ static INT_PTR ReadMessageCommand(WPARAM wParam, LPARAM lParam)
return 0;
}
-static int TypingMessage(WPARAM wParam, LPARAM lParam)
+static int TypingMessage(WPARAM hContact, LPARAM lParam)
{
if (!(g_dat.flags & SMF_SHOWTYPING))
return 0;
SkinPlaySound((lParam) ? "TNStart" : "TNStop");
- HWND hwnd = WindowList_Find(g_dat.hMessageWindowList, wParam);
+ HWND hwnd = WindowList_Find(g_dat.hMessageWindowList, hContact);
if (hwnd)
SendMessage(hwnd, DM_TYPING, 0, lParam);
else if (lParam && (g_dat.flags & SMF_SHOWTYPINGTRAY)) {
TCHAR szTip[256];
- mir_sntprintf(szTip, SIZEOF(szTip), TranslateT("%s is typing a message"), pcli->pfnGetContactDisplayName(wParam, 0));
+ mir_sntprintf(szTip, SIZEOF(szTip), TranslateT("%s is typing a message"), pcli->pfnGetContactDisplayName(hContact, 0));
- if (ServiceExists(MS_CLIST_SYSTRAY_NOTIFY) && !(g_dat.flags&SMF_SHOWTYPINGCLIST)) {
+ if (ServiceExists(MS_CLIST_SYSTRAY_NOTIFY) && !(g_dat.flags & SMF_SHOWTYPINGCLIST)) {
MIRANDASYSTRAYNOTIFY tn = { sizeof(tn) };
tn.tszInfoTitle = TranslateT("Typing notification");
tn.tszInfo = szTip;
@@ -177,26 +177,25 @@ static int TypingMessage(WPARAM wParam, LPARAM lParam)
}
else {
CLISTEVENT cle = { sizeof(cle) };
- cle.hContact = wParam;
+ cle.hContact = hContact;
cle.hDbEvent = (HANDLE)1;
cle.flags = CLEF_ONLYAFEW | CLEF_TCHAR;
cle.hIcon = LoadSkinnedIcon( SKINICON_OTHER_TYPING );
cle.pszService = "SRMsg/ReadMessage";
cle.ptszTooltip = szTip;
- CallServiceSync(MS_CLIST_REMOVEEVENT, wParam, (LPARAM) 1);
- CallServiceSync(MS_CLIST_ADDEVENT, wParam, (LPARAM) & cle);
+ CallServiceSync(MS_CLIST_REMOVEEVENT, hContact, 1);
+ CallServiceSync(MS_CLIST_ADDEVENT, hContact, (LPARAM)&cle);
Skin_ReleaseIcon(cle.hIcon);
}
}
return 0;
}
-static int MessageSettingChanged(WPARAM wParam, LPARAM lParam)
+static int MessageSettingChanged(WPARAM hContact, LPARAM lParam)
{
- DBCONTACTWRITESETTING *cws = (DBCONTACTWRITESETTING *) lParam;
- MCONTACT hContact = wParam;
-
- if (cws->szModule == NULL) return 0;
+ DBCONTACTWRITESETTING *cws = (DBCONTACTWRITESETTING*)lParam;
+ if (cws->szModule == NULL)
+ return 0;
if (!strcmp(cws->szModule, "CList"))
WindowList_Broadcast(g_dat.hMessageWindowList, DM_UPDATETITLE, (WPARAM) cws, 0);
@@ -204,7 +203,7 @@ static int MessageSettingChanged(WPARAM wParam, LPARAM lParam)
if (cws->szSetting && !strcmp(cws->szSetting, "Timezone"))
WindowList_Broadcast(g_dat.hMessageWindowList, DM_NEWTIMEZONE, (WPARAM) cws, 0);
else {
- char *szProto = GetContactProto(wParam);
+ char *szProto = GetContactProto(hContact);
if (szProto && !strcmp(cws->szModule, szProto))
WindowList_Broadcast(g_dat.hMessageWindowList, DM_UPDATETITLE, (WPARAM) cws, 0);
}
@@ -313,9 +312,8 @@ static int IconsChanged(WPARAM, LPARAM)
return 0;
}
-static int PrebuildContactMenu(WPARAM wParam, LPARAM lParam)
+static int PrebuildContactMenu(WPARAM hContact, LPARAM lParam)
{
- MCONTACT hContact = wParam;
if (hContact) {
bool bEnabled = false;
char *szProto = GetContactProto(hContact);
diff --git a/src/core/stdmsg/src/statusicon.cpp b/src/core/stdmsg/src/statusicon.cpp
index bd813201cf..935af689ec 100644
--- a/src/core/stdmsg/src/statusicon.cpp
+++ b/src/core/stdmsg/src/statusicon.cpp
@@ -24,9 +24,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
HANDLE hHookIconPressedEvt;
-static int OnSrmmIconChanged(WPARAM wParam, LPARAM)
+static int OnSrmmIconChanged(WPARAM hContact, LPARAM)
{
- MCONTACT hContact = wParam;
if (hContact == NULL)
WindowList_Broadcast(g_dat.hMessageWindowList, DM_STATUSICONCHANGE, 0, 0);
else {
diff --git a/src/core/stdurl/url.cpp b/src/core/stdurl/url.cpp
index 5473c6a596..763fb637bd 100644
--- a/src/core/stdurl/url.cpp
+++ b/src/core/stdurl/url.cpp
@@ -39,21 +39,21 @@ static INT_PTR ReadUrlCommand(WPARAM, LPARAM lParam)
return 0;
}
-static int UrlEventAdded(WPARAM wParam, LPARAM lParam)
+static int UrlEventAdded(WPARAM hContact, LPARAM lParam)
{
DBEVENTINFO dbei = { sizeof(dbei) };
db_event_get((HANDLE)lParam, &dbei);
- if (dbei.flags&(DBEF_SENT|DBEF_READ) || dbei.eventType != EVENTTYPE_URL)
+ if (dbei.flags & (DBEF_SENT|DBEF_READ) || dbei.eventType != EVENTTYPE_URL)
return 0;
SkinPlaySound("RecvUrl");
TCHAR szTooltip[256];
- mir_sntprintf(szTooltip, SIZEOF(szTooltip), TranslateT("URL from %s"), pcli->pfnGetContactDisplayName(wParam, 0));
+ mir_sntprintf(szTooltip, SIZEOF(szTooltip), TranslateT("URL from %s"), pcli->pfnGetContactDisplayName(hContact, 0));
CLISTEVENT cle = { sizeof(cle) };
cle.flags = CLEF_TCHAR;
- cle.hContact = wParam;
+ cle.hContact = hContact;
cle.hDbEvent = (HANDLE)lParam;
cle.hIcon = LoadSkinIcon(SKINICON_EVENT_URL);
cle.pszService = "SRUrl/ReadUrl";
diff --git a/src/core/stduseronline/useronline.cpp b/src/core/stduseronline/useronline.cpp
index 1093f380db..2f896fe3af 100644
--- a/src/core/stduseronline/useronline.cpp
+++ b/src/core/stduseronline/useronline.cpp
@@ -31,24 +31,24 @@ static bool Proto_IsAccountEnabled(PROTOACCOUNT* pa)
return pa && ((pa->bIsEnabled && !pa->bDynDisabled) || pa->bOldProto);
}
-static int UserOnlineSettingChanged(WPARAM wParam, LPARAM lParam)
+static int UserOnlineSettingChanged(WPARAM hContact, LPARAM lParam)
{
DBCONTACTWRITESETTING *cws = (DBCONTACTWRITESETTING*)lParam;
- if ((HANDLE)wParam == NULL || strcmp(cws->szSetting, "Status"))
+ if (hContact == NULL || strcmp(cws->szSetting, "Status"))
return 0;
int newStatus = cws->value.wVal;
- int oldStatus = db_get_w(wParam, "UserOnline", "OldStatus", ID_STATUS_OFFLINE);
- db_set_w(wParam, "UserOnline", "OldStatus", (WORD)newStatus);
- if (CallService(MS_IGNORE_ISIGNORED, wParam, IGNOREEVENT_USERONLINE)) return 0;
- if (db_get_b(wParam, "CList", "Hidden", 0)) return 0;
+ int oldStatus = db_get_w(hContact, "UserOnline", "OldStatus", ID_STATUS_OFFLINE);
+ db_set_w(hContact, "UserOnline", "OldStatus", (WORD)newStatus);
+ if (CallService(MS_IGNORE_ISIGNORED, hContact, IGNOREEVENT_USERONLINE)) return 0;
+ if (db_get_b(hContact, "CList", "Hidden", 0)) return 0;
if (newStatus == ID_STATUS_OFFLINE && oldStatus != ID_STATUS_OFFLINE) {
// Remove the event from the queue if it exists since they are now offline
- int lastEvent = (int)db_get_dw(wParam, "UserOnline", "LastEvent", 0);
+ int lastEvent = (int)db_get_dw(hContact, "UserOnline", "LastEvent", 0);
if (lastEvent) {
- CallService(MS_CLIST_REMOVEEVENT, wParam, (LPARAM)lastEvent);
- db_set_dw(wParam, "UserOnline", "LastEvent", 0);
+ CallService(MS_CLIST_REMOVEEVENT, hContact, (LPARAM)lastEvent);
+ db_set_dw(hContact, "UserOnline", "LastEvent", 0);
}
}
if ((newStatus == ID_STATUS_ONLINE || newStatus == ID_STATUS_FREECHAT) &&
@@ -63,11 +63,11 @@ static int UserOnlineSettingChanged(WPARAM wParam, LPARAM lParam)
ZeroMemory(&cle, sizeof(cle));
cle.cbSize = sizeof(cle);
cle.flags = CLEF_ONLYAFEW | CLEF_TCHAR;
- cle.hContact = wParam;
+ cle.hContact = hContact;
cle.hDbEvent = (HANDLE)(uniqueEventId++);
cle.hIcon = LoadSkinIcon(SKINICON_OTHER_USERONLINE, false);
cle.pszService = "UserOnline/Description";
- mir_sntprintf(tooltip, SIZEOF(tooltip), TranslateT("%s is online"), pcli->pfnGetContactDisplayName(wParam, 0));
+ mir_sntprintf(tooltip, SIZEOF(tooltip), TranslateT("%s is online"), pcli->pfnGetContactDisplayName(hContact, 0));
cle.ptszTooltip = tooltip;
CallService(MS_CLIST_ADDEVENT, 0, (LPARAM)&cle);
IcoLib_ReleaseIcon(cle.hIcon, 0);