summaryrefslogtreecommitdiff
path: root/src/core/stdmsg
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/stdmsg')
-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
3 files changed, 25 insertions, 29 deletions
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 {