summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2017-03-28 14:55:06 +0300
committerGeorge Hazan <ghazan@miranda.im>2017-03-28 14:55:06 +0300
commit1e49d6b2cb3812d8e80051cbb3d44891e6532825 (patch)
tree2ffb8e36641e063d625faece1d380f4ce833d1a6
parenteccbb5307a048e70ac4adb0d3fd333be28245fa8 (diff)
funny, but without cbSize we have no need in MessageWindowInputData at all
-rw-r--r--include/delphi/m_message.inc7
-rw-r--r--include/m_message.h9
-rw-r--r--plugins/CountryFlags/src/extraimg.cpp16
-rw-r--r--plugins/Dropbox/src/dropbox_events.cpp7
-rw-r--r--plugins/Dropbox/src/dropbox_options.cpp7
-rw-r--r--plugins/Dropbox/src/dropbox_utils.cpp6
-rw-r--r--plugins/KeyboardNotify/src/main.cpp6
-rw-r--r--plugins/MirFox/src/MirandaUtils.cpp15
-rw-r--r--plugins/MirLua/src/m_message.cpp7
-rw-r--r--plugins/MirandaG15/src/CAppletManager.cpp6
-rw-r--r--plugins/NewAwaySysMod/src/MsgEventAdded.cpp8
-rw-r--r--plugins/NewEventNotify/src/main.cpp7
-rw-r--r--plugins/NewXstatusNotify/src/utils.cpp7
-rw-r--r--plugins/Nudge/src/shake.cpp9
-rw-r--r--plugins/Scriver/src/msgs.cpp9
-rw-r--r--plugins/Sessions/Src/Main.cpp10
-rw-r--r--plugins/TabSRMM/src/msgs.cpp35
-rw-r--r--plugins/Utils.pas/mircontacts.pas7
-rw-r--r--plugins/WinterSpeak/src/SpeakAnnounce.cpp10
-rw-r--r--protocols/MSN/src/msn_misc.cpp9
-rw-r--r--src/core/stdmsg/src/msgs.cpp7
21 files changed, 54 insertions, 150 deletions
diff --git a/include/delphi/m_message.inc b/include/delphi/m_message.inc
index f8b51e8bea..5ce79317af 100644
--- a/include/delphi/m_message.inc
+++ b/include/delphi/m_message.inc
@@ -67,13 +67,6 @@ const
}
MS_MSG_GETWINDOWCLASS:PAnsiChar = 'MessageAPI/WindowClass';
-type
- PMessageWindowInputData = ^TMessageWindowInputData;
- TMessageWindowInputData = record
- hContact: TMCONTACT;
- uFlags : int; // see uflags above
- end;
-
const
MSG_WINDOW_STATE_EXISTS = $00000001; // Window exists should always be true
// if hwndWindow exists
diff --git a/include/m_message.h b/include/m_message.h
index 43c7612cda..472e6a8f61 100644
--- a/include/m_message.h
+++ b/include/m_message.h
@@ -76,12 +76,6 @@ struct StatusTextData
// Sets a statusbar line text for the appropriate contact
#define MS_MSG_SETSTATUSTEXT "MessageAPI/SetStatusText"
-struct MessageWindowInputData
-{
- MCONTACT hContact;
- int uFlags; // see uflags above
-};
-
#define MSG_WINDOW_STATE_EXISTS 0x00000001 // Window exists should always be true if hwndWindow exists
#define MSG_WINDOW_STATE_VISIBLE 0x00000002
#define MSG_WINDOW_STATE_FOCUS 0x00000004
@@ -89,14 +83,13 @@ struct MessageWindowInputData
struct MessageWindowData
{
- MCONTACT hContact;
int uFlags; // should be same as input data unless 0, then it will be the actual type
HWND hwndWindow; //top level window for the contact or NULL if no window exists
int uState; // see window states
void *local; // used to store pointer to custom data
};
-// wparam = (MessageWindowInputData*)
+// wparam = (MCONTACT)hContact
// lparam = (MessageWindowData*)
// returns 0 on success and returns non-zero (1) on error or if no window data exists for that hcontact
#define MS_MSG_GETWINDOWDATA "MessageAPI/GetWindowData"
diff --git a/plugins/CountryFlags/src/extraimg.cpp b/plugins/CountryFlags/src/extraimg.cpp
index 0683405bb6..9cf69d9fed 100644
--- a/plugins/CountryFlags/src/extraimg.cpp
+++ b/plugins/CountryFlags/src/extraimg.cpp
@@ -135,20 +135,18 @@ static int MsgWndEvent(WPARAM, LPARAM lParam)
void CALLBACK UpdateStatusIcons(LPARAM)
{
- MessageWindowInputData msgwi = { sizeof(msgwi) };
- msgwi.uFlags = MSG_WINDOW_UFLAG_MSG_BOTH;
- msgwi.hContact = db_find_first();
- while (msgwi.hContact != NULL) {
+ MCONTACT hContact = db_find_first();
+ while (hContact != NULL) {
/* is a message window opened for this contact? */
MessageWindowData msgw; /* output */
- if (!CallService(MS_MSG_GETWINDOWDATA,(WPARAM)&msgwi,(LPARAM)&msgw) && msgw.uState & MSG_WINDOW_STATE_EXISTS) {
+ if (!CallService(MS_MSG_GETWINDOWDATA, hContact, (LPARAM)&msgw) && msgw.uState & MSG_WINDOW_STATE_EXISTS) {
if (bShowStatusIcon) {
- int countryNumber = ServiceDetectContactOriginCountry((WPARAM)msgwi.hContact, 0);
- SetStatusIcon(msgwi.hContact, countryNumber);
+ int countryNumber = ServiceDetectContactOriginCountry(hContact, 0);
+ SetStatusIcon(hContact, countryNumber);
}
- else UnsetStatusIcon(msgwi.hContact);
+ else UnsetStatusIcon(hContact);
}
- msgwi.hContact = db_find_next(msgw.hContact);
+ hContact = db_find_next(hContact);
}
}
diff --git a/plugins/Dropbox/src/dropbox_events.cpp b/plugins/Dropbox/src/dropbox_events.cpp
index 13413a56dd..8ed963d51e 100644
--- a/plugins/Dropbox/src/dropbox_events.cpp
+++ b/plugins/Dropbox/src/dropbox_events.cpp
@@ -109,14 +109,9 @@ int CDropbox::OnProtoAck(WPARAM, LPARAM lParam)
WORD status = ack->lParam;
bool canSendOffline = (CallProtoService(ack->szModule, PS_GETCAPS, PFLAGNUM_4, 0) & PF4_IMSENDOFFLINE) > 0;
- MessageWindowInputData msgwi;
- msgwi.uFlags = MSG_WINDOW_UFLAG_MSG_BOTH;
-
for (MCONTACT hContact = db_find_first(ack->szModule); hContact; hContact = db_find_next(hContact, ack->szModule)) {
- msgwi.hContact = hContact;
-
MessageWindowData msgw;
- if (!CallService(MS_MSG_GETWINDOWDATA, (WPARAM)&msgwi, (LPARAM)&msgw) && msgw.uState & MSG_WINDOW_STATE_EXISTS) {
+ if (!CallService(MS_MSG_GETWINDOWDATA, hContact, (LPARAM)&msgw) && msgw.uState & MSG_WINDOW_STATE_EXISTS) {
BBButton bbd = {};
bbd.pszModuleName = MODULE;
bbd.dwButtonID = BBB_ID_FILE_SEND;
diff --git a/plugins/Dropbox/src/dropbox_options.cpp b/plugins/Dropbox/src/dropbox_options.cpp
index 68c6d0316e..2ce64cca26 100644
--- a/plugins/Dropbox/src/dropbox_options.cpp
+++ b/plugins/Dropbox/src/dropbox_options.cpp
@@ -123,14 +123,9 @@ void CDropboxOptionsInterception::OnApply()
interceptedProtos.AppendFormat("%s\t", acc->szModuleName);
// hide tabsrmm button for intercepted accounts
- MessageWindowInputData msgwi;
- msgwi.uFlags = MSG_WINDOW_UFLAG_MSG_BOTH;
-
for (MCONTACT hContact = db_find_first(acc->szModuleName); hContact; hContact = db_find_next(hContact, acc->szModuleName)) {
- msgwi.hContact = hContact;
-
MessageWindowData msgw;
- if (!CallService(MS_MSG_GETWINDOWDATA, (WPARAM)&msgwi, (LPARAM)&msgw) && msgw.uState & MSG_WINDOW_STATE_EXISTS) {
+ if (!CallService(MS_MSG_GETWINDOWDATA, hContact, (LPARAM)&msgw) && msgw.uState & MSG_WINDOW_STATE_EXISTS) {
BBButton bbd = {};
bbd.pszModuleName = MODULE;
bbd.dwButtonID = BBB_ID_FILE_SEND;
diff --git a/plugins/Dropbox/src/dropbox_utils.cpp b/plugins/Dropbox/src/dropbox_utils.cpp
index ad6bfa5af4..4872e917f4 100644
--- a/plugins/Dropbox/src/dropbox_utils.cpp
+++ b/plugins/Dropbox/src/dropbox_utils.cpp
@@ -116,12 +116,8 @@ void CDropbox::SendToContact(MCONTACT hContact, const wchar_t *data)
void CDropbox::PasteToInputArea(MCONTACT hContact, const wchar_t *data)
{
- MessageWindowInputData mwid = { sizeof(MessageWindowInputData) };
- mwid.hContact = hContact;
- mwid.uFlags = MSG_WINDOW_UFLAG_MSG_BOTH;
-
MessageWindowData mwd = { sizeof(MessageWindowData) };
- if (!CallService(MS_MSG_GETWINDOWDATA, (WPARAM)&mwid, (LPARAM)&mwd)) {
+ if (!CallService(MS_MSG_GETWINDOWDATA, hContact, (LPARAM)&mwd)) {
HWND hEdit = GetDlgItem(mwd.hwndWindow, 1002 /*IDC_MESSAGE*/);
if (!hEdit) hEdit = GetDlgItem(mwd.hwndWindow, 1009 /*IDC_CHATMESSAGE*/);
diff --git a/plugins/KeyboardNotify/src/main.cpp b/plugins/KeyboardNotify/src/main.cpp
index e42c7a939b..277ae0e0f4 100644
--- a/plugins/KeyboardNotify/src/main.cpp
+++ b/plugins/KeyboardNotify/src/main.cpp
@@ -843,11 +843,7 @@ BOOL CheckMsgWnd(MCONTACT hContact, BOOL *focus)
{
if (hContact) {
MessageWindowData mwd = { sizeof(MessageWindowData) };
- MessageWindowInputData mwid = { sizeof(MessageWindowInputData) };
- mwid.hContact = hContact;
- mwid.uFlags = MSG_WINDOW_UFLAG_MSG_BOTH;
- mwd.hContact = hContact;
- if (!CallService(MS_MSG_GETWINDOWDATA, (WPARAM)&mwid, (LPARAM)&mwd) && mwd.hwndWindow) {
+ if (!CallService(MS_MSG_GETWINDOWDATA, hContact, (LPARAM)&mwd) && mwd.hwndWindow) {
*focus = mwd.uState & MSG_WINDOW_STATE_FOCUS;
return TRUE;
}
diff --git a/plugins/MirFox/src/MirandaUtils.cpp b/plugins/MirFox/src/MirandaUtils.cpp
index c16eca6fe4..0f9b1aad54 100644
--- a/plugins/MirFox/src/MirandaUtils.cpp
+++ b/plugins/MirFox/src/MirandaUtils.cpp
@@ -357,22 +357,15 @@ int MirandaUtils::on_hook_OpenMW(WPARAM wParam, LPARAM lParam)
}
MessageWindowData mwd;
- mwd.hContact = (UINT_PTR)param->targetHandle;
- mwd.uFlags = MSG_WINDOW_UFLAG_MSG_BOTH;
-
- MessageWindowInputData mwid;
- mwid.hContact = (UINT_PTR)param->targetHandle;
- mwid.uFlags = MSG_WINDOW_UFLAG_MSG_BOTH;
-
- delete param;
-
- if (!CallService(MS_MSG_GETWINDOWDATA, (WPARAM)&mwid, (LPARAM)&mwd) && mwd.hwndWindow){
+ if (!CallService(MS_MSG_GETWINDOWDATA, (WPARAM)param->targetHandle, (LPARAM)&mwd) && mwd.hwndWindow){
HWND parent;
HWND hWnd = mwd.hwndWindow;
- while((parent = GetParent(hWnd)) != 0) hWnd = parent; // ensure we have the top level window (need parent window for scriver & tabsrmm)
+ while((parent = GetParent(hWnd)) != 0)
+ hWnd = parent; // ensure we have the top level window (need parent window for scriver & tabsrmm)
ForceForegroundWindow(hWnd);
}
+ delete param;
return 0;
}
diff --git a/plugins/MirLua/src/m_message.cpp b/plugins/MirLua/src/m_message.cpp
index f9782b1945..c21d71335c 100644
--- a/plugins/MirLua/src/m_message.cpp
+++ b/plugins/MirLua/src/m_message.cpp
@@ -5,13 +5,8 @@ static int message_Paste(lua_State *L)
MCONTACT hContact = luaL_checkinteger(L, 1);
ptrW text(mir_utf8decodeW(luaL_checkstring(L, 2)));
- MessageWindowInputData mwid = { sizeof(MessageWindowInputData) };
- mwid.hContact = hContact;
- mwid.uFlags = MSG_WINDOW_UFLAG_MSG_BOTH;
-
MessageWindowData mwd = { sizeof(MessageWindowData) };
-
- INT_PTR res = CallService(MS_MSG_GETWINDOWDATA, (WPARAM)&mwid, (LPARAM)&mwd);
+ INT_PTR res = CallService(MS_MSG_GETWINDOWDATA, hContact, (LPARAM)&mwd);
lua_pushinteger(L, res);
if (res)
return 1;
diff --git a/plugins/MirandaG15/src/CAppletManager.cpp b/plugins/MirandaG15/src/CAppletManager.cpp
index ad9bdc133b..5e60617648 100644
--- a/plugins/MirandaG15/src/CAppletManager.cpp
+++ b/plugins/MirandaG15/src/CAppletManager.cpp
@@ -788,12 +788,8 @@ MEVENT CAppletManager::SendMessageToContact(MCONTACT hContact, tstring strMessag
//************************************************************************
bool CAppletManager::IsMessageWindowOpen(MCONTACT hContact)
{
- MessageWindowInputData mwid;
- mwid.hContact = hContact;
- mwid.uFlags = MSG_WINDOW_UFLAG_MSG_BOTH;
-
MessageWindowData mwd;
- CallService(MS_MSG_GETWINDOWDATA, (WPARAM)&mwid, (LPARAM)&mwd);
+ CallService(MS_MSG_GETWINDOWDATA, hContact, (LPARAM)&mwd);
if (mwd.uState & MSG_WINDOW_STATE_EXISTS)
return true;
return false;
diff --git a/plugins/NewAwaySysMod/src/MsgEventAdded.cpp b/plugins/NewAwaySysMod/src/MsgEventAdded.cpp
index 08adac9ee3..8d256418fc 100644
--- a/plugins/NewAwaySysMod/src/MsgEventAdded.cpp
+++ b/plugins/NewAwaySysMod/src/MsgEventAdded.cpp
@@ -85,12 +85,8 @@ void __cdecl AutoreplyDelayThread(void *_ad)
int IsSRMsgWindowOpen(MCONTACT hContact, int DefaultRetVal)
{
if (ServiceExists(MS_MSG_GETWINDOWDATA)) {
- MessageWindowInputData mwid = {};
- mwid.uFlags = MSG_WINDOW_UFLAG_MSG_BOTH;
- mwid.hContact = hContact;
-
- MessageWindowData mwd = {};
- return !CallService(MS_MSG_GETWINDOWDATA, (WPARAM)&mwid, (LPARAM)&mwd) && mwd.hwndWindow;
+ MessageWindowData mwd;
+ return !CallService(MS_MSG_GETWINDOWDATA, hContact, (LPARAM)&mwd) && mwd.hwndWindow;
}
return DefaultRetVal;
diff --git a/plugins/NewEventNotify/src/main.cpp b/plugins/NewEventNotify/src/main.cpp
index 5161e03586..81a8e51d63 100644
--- a/plugins/NewEventNotify/src/main.cpp
+++ b/plugins/NewEventNotify/src/main.cpp
@@ -170,13 +170,8 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD, LPVOID)
int CheckMsgWnd(MCONTACT hContact)
{
if (g_IsSrmmWindowAPI) {
- MessageWindowInputData mwid;
- mwid.hContact = hContact;
- mwid.uFlags = MSG_WINDOW_UFLAG_MSG_BOTH;
-
MessageWindowData mwd;
- mwd.hContact = hContact;
- if (!CallService(MS_MSG_GETWINDOWDATA, (WPARAM) &mwid, (LPARAM) &mwd))
+ if (!CallService(MS_MSG_GETWINDOWDATA, hContact, (LPARAM)&mwd))
if (mwd.hwndWindow != NULL && (mwd.uState & MSG_WINDOW_STATE_EXISTS))
return 1;
}
diff --git a/plugins/NewXstatusNotify/src/utils.cpp b/plugins/NewXstatusNotify/src/utils.cpp
index e9f5cae71d..f3216823a8 100644
--- a/plugins/NewXstatusNotify/src/utils.cpp
+++ b/plugins/NewXstatusNotify/src/utils.cpp
@@ -24,13 +24,8 @@
// From NewEventNotify :-)
bool CheckMsgWnd(MCONTACT hContact)
{
- MessageWindowInputData mwid;
- mwid.hContact = hContact;
- mwid.uFlags = MSG_WINDOW_UFLAG_MSG_BOTH;
-
MessageWindowData mwd;
- mwd.hContact = hContact;
- if (CallService(MS_MSG_GETWINDOWDATA, (WPARAM)&mwid, (LPARAM)&mwd) != NULL)
+ if (CallService(MS_MSG_GETWINDOWDATA, hContact, (LPARAM)&mwd) != NULL)
return false;
if (mwd.hwndWindow != NULL && (mwd.uState & MSG_WINDOW_STATE_EXISTS))
diff --git a/plugins/Nudge/src/shake.cpp b/plugins/Nudge/src/shake.cpp
index 50982fdde2..6e71d703bc 100644
--- a/plugins/Nudge/src/shake.cpp
+++ b/plugins/Nudge/src/shake.cpp
@@ -39,15 +39,8 @@ INT_PTR ShakeChat(WPARAM wParam, LPARAM)
{
if (((HANDLE)wParam) == NULL) return -1;
- //char srmmName[100];
MessageWindowData mwd;
- mwd.hContact = db_mc_tryMeta(wParam);
- mwd.uFlags = MSG_WINDOW_UFLAG_MSG_BOTH;
-
- MessageWindowInputData mwid;
- mwid.hContact = mwd.hContact;
- mwid.uFlags = MSG_WINDOW_UFLAG_MSG_BOTH;
- CallService(MS_MSG_GETWINDOWDATA, (WPARAM)&mwid, (LPARAM)&mwd);
+ CallService(MS_MSG_GETWINDOWDATA, db_mc_tryMeta(wParam), (LPARAM)&mwd);
HWND parent;
HWND hWnd = mwd.hwndWindow;
diff --git a/plugins/Scriver/src/msgs.cpp b/plugins/Scriver/src/msgs.cpp
index 30776f7aa5..b0c52cad36 100644
--- a/plugins/Scriver/src/msgs.cpp
+++ b/plugins/Scriver/src/msgs.cpp
@@ -283,19 +283,18 @@ static void RestoreUnreadMessageAlerts(void)
}
}
-static INT_PTR GetWindowData(WPARAM wParam, LPARAM lParam)
+static INT_PTR GetWindowData(WPARAM hContact, LPARAM lParam)
{
- MessageWindowInputData *mwid = (MessageWindowInputData*)wParam;
- if (mwid == nullptr || mwid->hContact == 0 || mwid->uFlags != MSG_WINDOW_UFLAG_MSG_BOTH)
+ if (hContact == 0)
return 1;
MessageWindowData *mwd = (MessageWindowData*)lParam;
if (mwd == nullptr)
return 1;
- HWND hwnd = WindowList_Find(pci->hWindowList, mwid->hContact);
+ HWND hwnd = WindowList_Find(pci->hWindowList, hContact);
if (hwnd == nullptr)
- hwnd = SM_FindWindowByContact(mwid->hContact);
+ hwnd = SM_FindWindowByContact(hContact);
mwd->uFlags = MSG_WINDOW_UFLAG_MSG_BOTH;
mwd->hwndWindow = hwnd;
mwd->local = 0;
diff --git a/plugins/Sessions/Src/Main.cpp b/plugins/Sessions/Src/Main.cpp
index 7a813390f3..93955d9011 100644
--- a/plugins/Sessions/Src/Main.cpp
+++ b/plugins/Sessions/Src/Main.cpp
@@ -394,16 +394,10 @@ INT_PTR CALLBACK LoadSessionDlgProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM)
INT_PTR CloseCurrentSession(WPARAM, LPARAM)
{
- MessageWindowInputData mwid;
- MessageWindowData mwd;
-
while (session_list[0] != 0) {
- mwid.hContact = session_list[0];
- mwid.uFlags = MSG_WINDOW_UFLAG_MSG_BOTH;
-
- mwd.hContact = mwid.hContact;
+ MessageWindowData mwd;
mwd.uFlags = MSG_WINDOW_UFLAG_MSG_BOTH;
- CallService(MS_MSG_GETWINDOWDATA, (WPARAM)&mwid, (LPARAM)&mwd);
+ CallService(MS_MSG_GETWINDOWDATA, session_list[0], (LPARAM)&mwd);
SendMessage(mwd.hwndWindow, WM_CLOSE, 0, 0);
}
memset(session_list, 0, sizeof(session_list));
diff --git a/plugins/TabSRMM/src/msgs.cpp b/plugins/TabSRMM/src/msgs.cpp
index f0e8c76e7f..136c85e07d 100644
--- a/plugins/TabSRMM/src/msgs.cpp
+++ b/plugins/TabSRMM/src/msgs.cpp
@@ -64,17 +64,16 @@ int SmileyAddOptionsChanged(WPARAM, LPARAM)
// lparam = (MessageWindowData*)
// returns 0 on success and returns non-zero (1) on error or if no window data exists for that hcontact
-static INT_PTR GetWindowData(WPARAM wParam, LPARAM lParam)
+static INT_PTR GetWindowData(WPARAM hContact, LPARAM lParam)
{
- MessageWindowInputData *mwid = (MessageWindowInputData*)wParam;
- if (mwid == nullptr || mwid->hContact == 0 || mwid->uFlags != MSG_WINDOW_UFLAG_MSG_BOTH)
+ if (hContact == 0)
return 1;
MessageWindowData *mwd = (MessageWindowData*)lParam;
if (mwd == nullptr)
return 1;
- HWND hwnd = M.FindWindow(mwid->hContact);
+ HWND hwnd = M.FindWindow(hContact);
if (hwnd) {
mwd->uFlags = MSG_WINDOW_UFLAG_MSG_BOTH;
mwd->hwndWindow = hwnd;
@@ -83,24 +82,18 @@ static INT_PTR GetWindowData(WPARAM wParam, LPARAM lParam)
mwd->uState = GetWindowLongPtr(hwnd, DWLP_MSGRESULT);
return 0;
}
- else
- {
- SESSION_INFO *si = SM_FindSessionByHCONTACT(mwid->hContact);
- if (si != nullptr && si->pDlg != nullptr) {
- mwd->uFlags = MSG_WINDOW_UFLAG_MSG_BOTH;
- mwd->hwndWindow = si->pDlg->GetHwnd();
- mwd->local = GetParent(GetParent(si->pDlg->GetHwnd()));
- SendMessage(si->pDlg->GetHwnd(), DM_GETWINDOWSTATE, 0, 0);
- mwd->uState = GetWindowLongPtr(si->pDlg->GetHwnd(), DWLP_MSGRESULT);
- return 0;
- }
- else {
- mwd->uState = 0;
- mwd->hContact = 0;
- mwd->hwndWindow = 0;
- mwd->uFlags = 0;
- }
+
+ SESSION_INFO *si = SM_FindSessionByHCONTACT(hContact);
+ if (si != nullptr && si->pDlg != nullptr) {
+ mwd->uFlags = MSG_WINDOW_UFLAG_MSG_BOTH;
+ mwd->hwndWindow = si->pDlg->GetHwnd();
+ mwd->local = GetParent(GetParent(si->pDlg->GetHwnd()));
+ SendMessage(si->pDlg->GetHwnd(), DM_GETWINDOWSTATE, 0, 0);
+ mwd->uState = GetWindowLongPtr(si->pDlg->GetHwnd(), DWLP_MSGRESULT);
+ return 0;
}
+
+ memset(mwd, 0, sizeof(*mwd));
return 1;
}
diff --git a/plugins/Utils.pas/mircontacts.pas b/plugins/Utils.pas/mircontacts.pas
index 293b954174..92dc6074e0 100644
--- a/plugins/Utils.pas/mircontacts.pas
+++ b/plugins/Utils.pas/mircontacts.pas
@@ -409,21 +409,18 @@ end;
function WndToContact(wnd:HWND):TMCONTACT;
var
hContact:TMCONTACT;
- mwid:TMessageWindowInputData;
mwod:TMessageWindowOutputData;
begin
wnd:=GetParent(wnd); //!!
hContact:=db_find_first();
- mwid.uFlags:=MSG_WINDOW_UFLAG_MSG_BOTH;
while hContact<>0 do
begin
- mwid.hContact:=hContact;
- if CallService(MS_MSG_GETWINDOWDATA,wparam(@mwid),lparam(@mwod))=0 then
+ if CallService(MS_MSG_GETWINDOWDATA,hContact,lparam(@mwod))=0 then
begin
if mwod.hwndWindow=wnd then
begin
- result:=mwid.hContact;
+ result:=hContact;
exit;
end
end;
diff --git a/plugins/WinterSpeak/src/SpeakAnnounce.cpp b/plugins/WinterSpeak/src/SpeakAnnounce.cpp
index a9070f595d..0609548b59 100644
--- a/plugins/WinterSpeak/src/SpeakAnnounce.cpp
+++ b/plugins/WinterSpeak/src/SpeakAnnounce.cpp
@@ -146,15 +146,9 @@ bool SpeakAnnounce::readMessage(MCONTACT contact)
{
// Check if message window exists
if (m_db.getEventFlag(AnnounceDatabase::EventFlag_DialogOpen) || m_db.getEventFlag(AnnounceDatabase::EventFlag_DialogFocused)) {
- // Do not notify if window is already open
- MessageWindowInputData mwid;
- mwid.hContact = contact;
- mwid.uFlags = MSG_WINDOW_UFLAG_MSG_BOTH;
-
+ // Do not notify if window is already opened
MessageWindowData mwd;
- mwd.hContact = contact;
- //returns 0 on success and returns non-zero (1) on error or if no window data exists for that hcontact
- if (CallService(MS_MSG_GETWINDOWDATA, (WPARAM) &mwid, (LPARAM) &mwd) == 0) {
+ if (CallService(MS_MSG_GETWINDOWDATA, contact, (LPARAM)&mwd) == 0) {
if (m_db.getEventFlag(AnnounceDatabase::EventFlag_DialogOpen))
return ((mwd.uState & MSG_WINDOW_STATE_EXISTS) == 0);
else if (m_db.getEventFlag(AnnounceDatabase::EventFlag_DialogFocused))
diff --git a/protocols/MSN/src/msn_misc.cpp b/protocols/MSN/src/msn_misc.cpp
index 637ef68518..680662c28f 100644
--- a/protocols/MSN/src/msn_misc.cpp
+++ b/protocols/MSN/src/msn_misc.cpp
@@ -1309,13 +1309,12 @@ bool CMsnProto::MSN_IsMeByContact(MCONTACT hContact, char* szEmail)
bool MSN_MsgWndExist(MCONTACT hContact)
{
MessageWindowData msgWinData = {};
- MessageWindowInputData msgWinInData = { hContact, MSG_WINDOW_UFLAG_MSG_BOTH };
- bool res = CallService(MS_MSG_GETWINDOWDATA, (WPARAM)&msgWinInData, (LPARAM)&msgWinData) != 0;
+ bool res = CallService(MS_MSG_GETWINDOWDATA, hContact, (LPARAM)&msgWinData) != 0;
res = res || msgWinData.hwndWindow;
if (res) {
- msgWinInData.hContact = db_mc_getMeta(hContact);
- if (msgWinInData.hContact != NULL) {
- res = CallService(MS_MSG_GETWINDOWDATA, (WPARAM)&msgWinInData, (LPARAM)&msgWinData) != 0;
+ hContact = db_mc_getMeta(hContact);
+ if (hContact != 0) {
+ res = CallService(MS_MSG_GETWINDOWDATA, hContact, (LPARAM)&msgWinData) != 0;
res |= (msgWinData.hwndWindow == NULL);
}
}
diff --git a/src/core/stdmsg/src/msgs.cpp b/src/core/stdmsg/src/msgs.cpp
index 48b8832a70..80463aa7a5 100644
--- a/src/core/stdmsg/src/msgs.cpp
+++ b/src/core/stdmsg/src/msgs.cpp
@@ -495,17 +495,16 @@ static INT_PTR SetStatusText(WPARAM wParam, LPARAM lParam)
return 0;
}
-static INT_PTR GetWindowData(WPARAM wParam, LPARAM lParam)
+static INT_PTR GetWindowData(WPARAM hContact, LPARAM lParam)
{
- MessageWindowInputData *mwid = (MessageWindowInputData*)wParam;
- if (mwid == NULL || mwid->hContact == 0 || mwid->uFlags != MSG_WINDOW_UFLAG_MSG_BOTH)
+ if (hContact == 0)
return 1;
MessageWindowData *mwd = (MessageWindowData*)lParam;
if(mwd == NULL)
return 1;
- HWND hwnd = WindowList_Find(pci->hWindowList, mwid->hContact);
+ HWND hwnd = WindowList_Find(pci->hWindowList, hContact);
mwd->uFlags = MSG_WINDOW_UFLAG_MSG_BOTH;
mwd->hwndWindow = hwnd;
mwd->local = 0;