summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2016-09-06 16:15:19 +0000
committerGeorge Hazan <george.hazan@gmail.com>2016-09-06 16:15:19 +0000
commit3bb087726db613aad9c1e61332fda7300600f60c (patch)
treea31945932779db8ba24f83e7bbaba16ae95dfb95
parent910d3cab907dc5649a01bab756dc78af74a23981 (diff)
clist services' extermination continued
git-svn-id: http://svn.miranda-ng.org/main/trunk@17265 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
-rw-r--r--bin10/lib/mir_app.libbin72418 -> 73200 bytes
-rw-r--r--bin10/lib/mir_app64.libbin69858 -> 70586 bytes
-rw-r--r--bin12/lib/mir_app.libbin72418 -> 73200 bytes
-rw-r--r--bin12/lib/mir_app64.libbin69858 -> 70586 bytes
-rw-r--r--bin14/lib/mir_app.libbin72418 -> 73200 bytes
-rw-r--r--bin14/lib/mir_app64.libbin69858 -> 70586 bytes
-rw-r--r--include/delphi/m_clist.inc42
-rw-r--r--include/m_clist.h22
-rw-r--r--plugins/AddContactPlus/src/addcontact.cpp2
-rw-r--r--plugins/ContactsPlus/src/receive.cpp9
-rw-r--r--plugins/FavContacts/src/menu.cpp2
-rw-r--r--plugins/FavContacts/src/services.cpp2
-rw-r--r--plugins/FloatingContacts/src/filedrop.cpp2
-rw-r--r--plugins/FloatingContacts/src/stdafx.h1
-rw-r--r--plugins/FloatingContacts/src/thumbs.cpp2
-rw-r--r--plugins/NewAwaySysMod/src/ContactList.cpp2
-rw-r--r--plugins/QuickContacts/src/quickcontacts.cpp2
-rw-r--r--plugins/RecentContacts/src/RecentContacts.cpp2
-rw-r--r--plugins/Sessions/Src/Main.cpp4
-rw-r--r--plugins/ShellExt/src/shlcom.cpp2
-rw-r--r--plugins/TabSRMM/src/hotkeyhandler.cpp4
-rw-r--r--plugins/TooltipNotify/src/TooltipNotify.cpp3
-rw-r--r--plugins/Utils.pas/mircontacts.pas2
-rw-r--r--protocols/IcqOscarJ/src/icq_servlist.cpp2
-rw-r--r--src/mir_app/src/addcontact.cpp4
-rw-r--r--src/mir_app/src/clc.cpp4
-rw-r--r--src/mir_app/src/clcutils.cpp2
-rw-r--r--src/mir_app/src/clistmod.cpp43
-rw-r--r--src/mir_app/src/contact.cpp12
-rw-r--r--src/mir_app/src/menu_utils.cpp16
-rw-r--r--src/mir_app/src/meta_services.cpp4
-rw-r--r--src/mir_app/src/mir_app.def3
-rw-r--r--src/mir_app/src/mir_app64.def3
-rw-r--r--src/mir_app/src/miranda.h2
-rw-r--r--src/mir_app/src/movetogroup.cpp2
35 files changed, 65 insertions, 137 deletions
diff --git a/bin10/lib/mir_app.lib b/bin10/lib/mir_app.lib
index a26b93b6f0..f387672bef 100644
--- a/bin10/lib/mir_app.lib
+++ b/bin10/lib/mir_app.lib
Binary files differ
diff --git a/bin10/lib/mir_app64.lib b/bin10/lib/mir_app64.lib
index 4a1b8196dd..1c2630deeb 100644
--- a/bin10/lib/mir_app64.lib
+++ b/bin10/lib/mir_app64.lib
Binary files differ
diff --git a/bin12/lib/mir_app.lib b/bin12/lib/mir_app.lib
index a26b93b6f0..f387672bef 100644
--- a/bin12/lib/mir_app.lib
+++ b/bin12/lib/mir_app.lib
Binary files differ
diff --git a/bin12/lib/mir_app64.lib b/bin12/lib/mir_app64.lib
index 4a1b8196dd..1c2630deeb 100644
--- a/bin12/lib/mir_app64.lib
+++ b/bin12/lib/mir_app64.lib
Binary files differ
diff --git a/bin14/lib/mir_app.lib b/bin14/lib/mir_app.lib
index a26b93b6f0..f387672bef 100644
--- a/bin14/lib/mir_app.lib
+++ b/bin14/lib/mir_app.lib
Binary files differ
diff --git a/bin14/lib/mir_app64.lib b/bin14/lib/mir_app64.lib
index 4a1b8196dd..1c2630deeb 100644
--- a/bin14/lib/mir_app64.lib
+++ b/bin14/lib/mir_app64.lib
Binary files differ
diff --git a/include/delphi/m_clist.inc b/include/delphi/m_clist.inc
index c5366fcf72..13b5a08cda 100644
--- a/include/delphi/m_clist.inc
+++ b/include/delphi/m_clist.inc
@@ -189,47 +189,9 @@ const
function Clist_GroupCreate(hParentGroup:integer; groupName:PWideChar) : integer; stdcall; external AppDll;
-const
- {
- wParam : TMCONTACT
- lParam : 0
- Affect : Do the message processing associated with the double clicking a contact
- Returns: 0 on success, [non zero] on failure
- Version: v0.1.1.0+
- }
- MS_CLIST_CONTACTDOUBLECLICKED:PAnsiChar = 'CList/ContactDoubleClicked';
-
- {
- wParam : TMCONTACT
- lParam : Pointer to an array of PAnsiChar's containing files/dirs
- Affect : Do the processing when some files are droppeed on a contact, see notes
- Returns: 0 on success, [non zero] on failure
- Notes : the array is terminated when a NULL(0) entry is found
- Version: v0.1.2.1+
- }
- MS_CLIST_CONTACTFILESDROPPED:PAnsiChar = 'CList/ContactFilesDropped';
-
- {
- wParam : TMCONTACT
- lParam : HGROUP
- Affect : Change the group a contact belongs to, see notes
- Returns: 0 on success, [non zero] on failure
- Notes : use hGroup=NULL(0) to remove any group association with the contact
- Version: v0.1.1.0+
- }
- MS_CLIST_CONTACTCHANGEGROUP:PAnsiChar = 'CList/ContactChangeGroup';
-
- {
- wParam : HCONTACT_1
- lParam : HCONTACT_2
- Affect : Determine the ordering of two given contacts
- Returns: 0 if hContact1 is the same as hContact2
- 1 if hContact1 should be displayed before hContact2
- -1 if hContact1 should be displayed after hCotnact2
- Version: v0.1.1.0+
- }
- MS_CLIST_CONTACTSCOMPARE:PAnsiChar = 'CList/ContactsCompare';
+procedure Clist_ContactDoubleClicked(hContact:TMCONTACT); stdcall; external AppDll;
+const
{
wParam=0 (not used)
lParam=(LPARAM) &MIRANDASYSTRAYNOTIFY
diff --git a/include/m_clist.h b/include/m_clist.h
index 57b2737fc6..89edcc38f9 100644
--- a/include/m_clist.h
+++ b/include/m_clist.h
@@ -453,39 +453,23 @@ EXTERN_C MIR_APP_DLL(void) Clist_EndRebuild(void);
/////////////////////////////////////////////////////////////////////////////////////////
// do the message processing associated with double clicking a contact
-// wParam = (MCONTACT)hContact
-// lParam = 0
-// returns 0 on success, nonzero on failure
-#define MS_CLIST_CONTACTDOUBLECLICKED "CList/ContactDoubleClicked"
-
-/////////////////////////////////////////////////////////////////////////////////////////
-// do the processing for when some files are dropped on a contact
-// wParam = (MCONTACT)hContact
-// lParam = (LPARAM)(char**)ppFiles
-// returns 0 on success, nonzero on failure
-// ppFiles is an array of fully qualified filenames, ending with a NULL.
-
-#define MS_CLIST_CONTACTFILESDROPPED "CList/ContactFilesDropped"
+EXTERN_C MIR_APP_DLL(void) Clist_ContactDoubleClicked(MCONTACT hContact);
/////////////////////////////////////////////////////////////////////////////////////////
// change the group a contact belongs to
-// wParam = (MCONTACT)hContact
-// lParam = (LPARAM)(MGROUP)hGroup
// returns 0 on success, nonzero on failure
// use hGroup = NULL to put the contact in no group
-#define MS_CLIST_CONTACTCHANGEGROUP "CList/ContactChangeGroup"
+EXTERN_C MIR_APP_DLL(int) Clist_ContactChangeGroup(MCONTACT hContact, MGROUP hGroup);
/////////////////////////////////////////////////////////////////////////////////////////
// determines the ordering of two contacts
-// wParam = (WPARAM)(MCONTACT)hContact1
-// lParam = (LPARAM)(MCONTACT)hContact2
// returns 0 if hContact1 is the same as hContact2
// returns +1 if hContact2 should be displayed after hContact1
// returns -1 if hContact1 should be displayed after hContact2
-#define MS_CLIST_CONTACTSCOMPARE "CList/ContactsCompare"
+EXTERN_C MIR_APP_DLL(int) Clist_ContactCompare(MCONTACT hContact1, MCONTACT hContact2);
/////////////////////////////////////////////////////////////////////////////////////////
// DRAG-N-DROP SUPPORT
diff --git a/plugins/AddContactPlus/src/addcontact.cpp b/plugins/AddContactPlus/src/addcontact.cpp
index 4af8e5ca10..a6424d4c6b 100644
--- a/plugins/AddContactPlus/src/addcontact.cpp
+++ b/plugins/AddContactPlus/src/addcontact.cpp
@@ -282,7 +282,7 @@ INT_PTR CALLBACK AddContactDlgProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM)
int item = SendDlgItemMessage(hdlg, IDC_GROUP, CB_GETCURSEL, 0, 0);
if (item > 0) {
item = SendDlgItemMessage(hdlg, IDC_GROUP, CB_GETITEMDATA, item, 0);
- CallService(MS_CLIST_CONTACTCHANGEGROUP, hContact, item);
+ Clist_ContactChangeGroup(hContact, item);
}
if (BST_UNCHECKED == IsDlgButtonChecked(hdlg, IDC_ADDTEMP)) {
diff --git a/plugins/ContactsPlus/src/receive.cpp b/plugins/ContactsPlus/src/receive.cpp
index 34fa0291a9..bcf588b6a7 100644
--- a/plugins/ContactsPlus/src/receive.cpp
+++ b/plugins/ContactsPlus/src/receive.cpp
@@ -318,13 +318,8 @@ INT_PTR CALLBACK RecvDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPara
if (!mir_wstrcmp(wndData->maReceived[j]->mcaUIN, caUIN)) {
char *szProto =GetContactProto(wndData->mhContact);
hContact = (MCONTACT)CallProtoService(szProto, PS_ADDTOLISTBYEVENT, MAKEWPARAM(0, j), (LPARAM)wndData->mhDbEvent);
- if (hContact && caGroup) {
- // use newest group API if available
- if (ServiceExists(MS_CLIST_CONTACTCHANGEGROUP))
- CallService(MS_CLIST_CONTACTCHANGEGROUP, hContact, (LPARAM)nGroupId);
- else
- db_set_ws(hContact, "CList", "Group", caGroup);
- }
+ if (hContact && caGroup)
+ Clist_ContactChangeGroup(hContact, nGroupId);
break;
}
mir_free(caUIN);
diff --git a/plugins/FavContacts/src/menu.cpp b/plugins/FavContacts/src/menu.cpp
index 3504975539..0a24b6ecd3 100644
--- a/plugins/FavContacts/src/menu.cpp
+++ b/plugins/FavContacts/src/menu.cpp
@@ -528,7 +528,7 @@ int ShowMenu(bool centered)
DestroyMenu(hMenu);
if (hContact)
- CallService(MS_CLIST_CONTACTDOUBLECLICKED, hContact, 0);
+ Clist_ContactDoubleClicked(hContact);
return 0;
}
diff --git a/plugins/FavContacts/src/services.cpp b/plugins/FavContacts/src/services.cpp
index 2a6cab99c5..acfad2a213 100644
--- a/plugins/FavContacts/src/services.cpp
+++ b/plugins/FavContacts/src/services.cpp
@@ -38,7 +38,7 @@ INT_PTR svcShowMenuCentered(WPARAM, LPARAM)
INT_PTR svcOpenContact(WPARAM wParam, LPARAM)
{
hContactToActivate = wParam;
- CallService(MS_CLIST_CONTACTDOUBLECLICKED, (WPARAM)hContactToActivate, 0);
+ Clist_ContactDoubleClicked(hContactToActivate);
return 0;
}
diff --git a/plugins/FloatingContacts/src/filedrop.cpp b/plugins/FloatingContacts/src/filedrop.cpp
index 76da433254..2b3fffc4a6 100644
--- a/plugins/FloatingContacts/src/filedrop.cpp
+++ b/plugins/FloatingContacts/src/filedrop.cpp
@@ -163,7 +163,7 @@ BOOL OnDropFiles(HDROP hDrop, ThumbInfo *pThumb)
ProcessDroppedItems(ppDroppedItems, nDroppedItemsCount, ppFiles);
- bSuccess = (BOOL)CallService(MS_CLIST_CONTACTFILESDROPPED, (WPARAM)pThumb->hContact, (LPARAM)ppFiles);
+ bSuccess = (BOOL)CallService(MS_FILE_SENDSPECIFICFILES, pThumb->hContact, (LPARAM)ppFiles);
for (UINT iItem = 0; iItem < nFilesCount; ++iItem)
free(ppFiles[iItem]);
diff --git a/plugins/FloatingContacts/src/stdafx.h b/plugins/FloatingContacts/src/stdafx.h
index af3decec3f..b983665732 100644
--- a/plugins/FloatingContacts/src/stdafx.h
+++ b/plugins/FloatingContacts/src/stdafx.h
@@ -10,6 +10,7 @@
#include <newpluginapi.h>
#include <m_system_cpp.h>
#include <m_skin.h>
+#include <m_file.h>
#include <m_fontservice.h>
#include <m_langpack.h>
#include <m_protosvc.h>
diff --git a/plugins/FloatingContacts/src/thumbs.cpp b/plugins/FloatingContacts/src/thumbs.cpp
index e394581046..8fb1a3c5f4 100644
--- a/plugins/FloatingContacts/src/thumbs.cpp
+++ b/plugins/FloatingContacts/src/thumbs.cpp
@@ -661,7 +661,7 @@ void ThumbInfo::UpdateContent()
void ThumbInfo::PopupMessageDialog()
{
- CallService(MS_CLIST_CONTACTDOUBLECLICKED, hContact, 0);
+ Clist_ContactDoubleClicked(hContact);
}
void ThumbInfo::OnTimer(BYTE idTimer)
diff --git a/plugins/NewAwaySysMod/src/ContactList.cpp b/plugins/NewAwaySysMod/src/ContactList.cpp
index a6718e8d2a..8a472008de 100644
--- a/plugins/NewAwaySysMod/src/ContactList.cpp
+++ b/plugins/NewAwaySysMod/src/ContactList.cpp
@@ -458,7 +458,7 @@ int CALLBACK CompareItemsCallback(LPARAM lParam1, LPARAM lParam2, LPARAM lParamS
if (IsHContactGroup(dat->Items[lParam2].hContact))
return 1;
- return CallService(MS_CLIST_CONTACTSCOMPARE, dat->Items[lParam1].hContact, dat->Items[lParam2].hContact);
+ return Clist_ContactCompare(dat->Items[lParam1].hContact, dat->Items[lParam2].hContact);
}
void CCList::SortContacts()
diff --git a/plugins/QuickContacts/src/quickcontacts.cpp b/plugins/QuickContacts/src/quickcontacts.cpp
index 600ef7689e..bc09d7f4aa 100644
--- a/plugins/QuickContacts/src/quickcontacts.cpp
+++ b/plugins/QuickContacts/src/quickcontacts.cpp
@@ -805,7 +805,7 @@ static INT_PTR CALLBACK MainDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA
if (hContact == NULL)
break;
- CallService(MS_CLIST_CONTACTDOUBLECLICKED, hContact, 0);
+ Clist_ContactDoubleClicked(hContact);
db_set_dw(NULL, MODULE_NAME, "LastSentTo", hContact);
SendMessage(hwndDlg, WM_CLOSE, 0, 0);
diff --git a/plugins/RecentContacts/src/RecentContacts.cpp b/plugins/RecentContacts/src/RecentContacts.cpp
index d3568fc24b..72441c76e9 100644
--- a/plugins/RecentContacts/src/RecentContacts.cpp
+++ b/plugins/RecentContacts/src/RecentContacts.cpp
@@ -109,7 +109,7 @@ BOOL ShowListMainDlgProc_OpenContact(HWND hList, int item)
lvi.iSubItem = 0;
ListView_GetItem(hList, &lvi);
if (lvi.lParam != NULL) {
- CallService(MS_CLIST_CONTACTDOUBLECLICKED, (WPARAM)lvi.lParam, NULL);
+ Clist_ContactDoubleClicked(lvi.lParam);
return TRUE;
}
}
diff --git a/plugins/Sessions/Src/Main.cpp b/plugins/Sessions/Src/Main.cpp
index 16cd20eff3..92a88a6a9a 100644
--- a/plugins/Sessions/Src/Main.cpp
+++ b/plugins/Sessions/Src/Main.cpp
@@ -554,7 +554,7 @@ int LoadSession(WPARAM, LPARAM lparam)
// TODO: change to "switch"
while (session_list_t[i] != 0) {
if (CheckForDuplicate(session_list, session_list_t[i]) == -1)
- CallService(MS_CLIST_CONTACTDOUBLECLICKED, (WPARAM)session_list_t[i], 0);
+ Clist_ContactDoubleClicked(session_list_t[i]);
else if (g_bWarnOnHidden) {
if (!CheckContactVisibility(session_list_t[i])) {
hidden[j] = i + 1;
@@ -584,7 +584,7 @@ int LoadSession(WPARAM, LPARAM lparam)
if (g_bWarnOnHidden) {
if (IDYES == MessageBox(NULL, TranslateT("This Session already opened (but probably hidden).\nDo you want to show hidden contacts?"), TranslateT("Sessions Manager"), MB_YESNO | MB_ICONQUESTION))
for (j = 0; hidden[j] != 0; j++)
- CallService(MS_CLIST_CONTACTDOUBLECLICKED, (WPARAM)session_list_t[hidden[j] - 1], 0);
+ Clist_ContactDoubleClicked(session_list_t[hidden[j] - 1]);
}
}
diff --git a/plugins/ShellExt/src/shlcom.cpp b/plugins/ShellExt/src/shlcom.cpp
index e984015fe7..fafaf732ed 100644
--- a/plugins/ShellExt/src/shlcom.cpp
+++ b/plugins/ShellExt/src/shlcom.cpp
@@ -183,7 +183,7 @@ struct TSlotInfo
int __cdecl SortContact(const void *Item1, const void *Item2)
{
- return CallService(MS_CLIST_CONTACTSCOMPARE, ((TSlotInfo*)Item1)->hContact, ((TSlotInfo*)Item2)->hContact);
+ return Clist_ContactCompare(((TSlotInfo*)Item1)->hContact, ((TSlotInfo*)Item2)->hContact);
}
void ipcGetSkinIcons(THeaderIPC *ipch)
diff --git a/plugins/TabSRMM/src/hotkeyhandler.cpp b/plugins/TabSRMM/src/hotkeyhandler.cpp
index eef1b2a6a1..35233489fd 100644
--- a/plugins/TabSRMM/src/hotkeyhandler.cpp
+++ b/plugins/TabSRMM/src/hotkeyhandler.cpp
@@ -124,7 +124,7 @@ void TSAPI HandleMenuEntryFromhContact(MCONTACT hContact)
}
}
- CallService(MS_CLIST_CONTACTDOUBLECLICKED, hContact, 0);
+ Clist_ContactDoubleClicked(hContact);
}
void TSAPI DrawMenuItem(DRAWITEMSTRUCT *dis, HICON hIcon, DWORD dwIdle)
@@ -529,7 +529,7 @@ LONG_PTR CALLBACK HotkeyHandlerDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LP
{
FLASH_PARAMS *p = reinterpret_cast<FLASH_PARAMS*>(lParam);
if (1 == wParam) {
- CallService(MS_CLIST_CONTACTDOUBLECLICKED, (WPARAM)p->hContact, 1);
+ Clist_ContactDoubleClicked(p->hContact);
p->bActiveTab = TRUE;
p->bInactive = FALSE;
p->bMustAutoswitch = p->bMustFlash = FALSE;
diff --git a/plugins/TooltipNotify/src/TooltipNotify.cpp b/plugins/TooltipNotify/src/TooltipNotify.cpp
index cd774894b7..3008beffb2 100644
--- a/plugins/TooltipNotify/src/TooltipNotify.cpp
+++ b/plugins/TooltipNotify/src/TooltipNotify.cpp
@@ -863,7 +863,8 @@ void CTooltipNotify::OnTooltipDblClicked(CTooltip *pTooltip)
TooltipsList::iterator iter = FindBy(&STooltipData::pTooltip, pTooltip);
STooltipData* pTooltipData = *iter;
WPARAM wParam = (WPARAM)pTooltipData->hContact;
- if (wParam) ::CallService(MS_CLIST_CONTACTDOUBLECLICKED, wParam, 0);
+ if (wParam)
+ Clist_ContactDoubleClicked(wParam);
break;
}
diff --git a/plugins/Utils.pas/mircontacts.pas b/plugins/Utils.pas/mircontacts.pas
index 43abcda5ba..0863c0cd35 100644
--- a/plugins/Utils.pas/mircontacts.pas
+++ b/plugins/Utils.pas/mircontacts.pas
@@ -471,7 +471,7 @@ CallService(MS_CLIST_CONTACTDOUBLECLICKED,hContact,0);
end;
if anystatus then
begin
- CallService(MS_CLIST_CONTACTDOUBLECLICKED,hContact,0); //??
+ Clist_ContactDoubleClicked(hContact);
// if chat exist, open chat
// else create new session
end;
diff --git a/protocols/IcqOscarJ/src/icq_servlist.cpp b/protocols/IcqOscarJ/src/icq_servlist.cpp
index 856c8327c9..de90ee5bd8 100644
--- a/protocols/IcqOscarJ/src/icq_servlist.cpp
+++ b/protocols/IcqOscarJ/src/icq_servlist.cpp
@@ -1397,7 +1397,7 @@ int CIcqProto::getCListGroupExists(const char *szGroup)
int CIcqProto::moveContactToCListGroup(MCONTACT hContact, const char *szGroup)
{
MGROUP hGroup = Clist_GroupCreate(0, ptrW(mir_utf8decodeW(szGroup)));
- return CallService(MS_CLIST_CONTACTCHANGEGROUP, hContact, hGroup);
+ return Clist_ContactChangeGroup(hContact, hGroup);
}
diff --git a/src/mir_app/src/addcontact.cpp b/src/mir_app/src/addcontact.cpp
index 5a3ef8408a..87d34fbdb3 100644
--- a/src/mir_app/src/addcontact.cpp
+++ b/src/mir_app/src/addcontact.cpp
@@ -202,7 +202,7 @@ public:
int item = m_group.GetCurSel();
if (item > 0)
- CallService(MS_CLIST_CONTACTCHANGEGROUP, hContact, m_group.GetItemData(item));
+ Clist_ContactChangeGroup(hContact, m_group.GetItemData(item));
db_unset(hContact, "CList", "NotOnList");
@@ -218,7 +218,7 @@ public:
}
if (m_chkOpen.GetState())
- CallService(MS_CLIST_CONTACTDOUBLECLICKED, hContact, 0);
+ Clist_ContactDoubleClicked(hContact);
}
};
diff --git a/src/mir_app/src/clc.cpp b/src/mir_app/src/clc.cpp
index aa01ae56bb..f0f947ad0f 100644
--- a/src/mir_app/src/clc.cpp
+++ b/src/mir_app/src/clc.cpp
@@ -1101,7 +1101,7 @@ LRESULT CALLBACK fnContactListControlWndProc(HWND hwnd, UINT uMsg, WPARAM wParam
cli.pfnGetRowByIndex(dat, dat->selection, &contactn, NULL);
cli.pfnGetRowByIndex(dat, dat->iDragItem, &contacto, NULL);
if (contacto->type == CLCIT_CONTACT) //dropee is a contact
- CallService(MS_CLIST_CONTACTCHANGEGROUP, (WPARAM)contacto->hContact, contactn->groupId);
+ Clist_ContactChangeGroup(contacto->hContact, contactn->groupId);
else if (contacto->type == CLCIT_GROUP) { //dropee is a group
wchar_t szNewName[120];
mir_snwprintf(szNewName, L"%s\\%s", Clist_GroupGetName(contactn->groupId, NULL), contacto->szText);
@@ -1147,7 +1147,7 @@ LRESULT CALLBACK fnContactListControlWndProc(HWND hwnd, UINT uMsg, WPARAM wParam
Clist_GroupRename(contact->groupId, szNewName);
}
else if (contact->type == CLCIT_CONTACT) //dropee is a contact
- CallService(MS_CLIST_CONTACTCHANGEGROUP, (WPARAM)contact->hContact, 0);
+ Clist_ContactChangeGroup(contact->hContact, 0);
}
}
diff --git a/src/mir_app/src/clcutils.cpp b/src/mir_app/src/clcutils.cpp
index de469d6a17..6b10fd8e65 100644
--- a/src/mir_app/src/clcutils.cpp
+++ b/src/mir_app/src/clcutils.cpp
@@ -357,7 +357,7 @@ void fnDoSelectionDefaultAction(HWND hwnd, ClcData *dat)
if (contact->type == CLCIT_GROUP)
cli.pfnSetGroupExpand(hwnd, dat, contact->group, -1);
if (contact->type == CLCIT_CONTACT)
- CallService(MS_CLIST_CONTACTDOUBLECLICKED, (WPARAM)contact->hContact, 0);
+ Clist_ContactDoubleClicked(contact->hContact);
}
int fnFindRowByText(HWND hwnd, ClcData *dat, const wchar_t *text, int prefixOk)
diff --git a/src/mir_app/src/clistmod.cpp b/src/mir_app/src/clistmod.cpp
index edba951768..13f82b29ae 100644
--- a/src/mir_app/src/clistmod.cpp
+++ b/src/mir_app/src/clistmod.cpp
@@ -23,9 +23,10 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "stdafx.h"
+
#include "clc.h"
+#include "genmenu.h"
-INT_PTR ContactChangeGroup(WPARAM wParam, LPARAM lParam);
int InitCListEvents(void);
void UninitCListEvents(void);
void UninitGroupServices(void);
@@ -221,19 +222,25 @@ static int ContactListAccountsChanged(WPARAM eventCode, LPARAM lParam)
return 0;
}
-static INT_PTR ContactDoubleClicked(WPARAM wParam, LPARAM)
+MIR_APP_DLL(void) Clist_ContactDoubleClicked(MCONTACT hContact)
{
// Try to process event myself
- if (cli.pfnEventsProcessContactDoubleClick(wParam) == 0)
- return 0;
+ if (cli.pfnEventsProcessContactDoubleClick(hContact) == 0)
+ return;
// Allow third-party plugins to process a dblclick
- if (NotifyEventHooks(hContactDoubleClicked, wParam, 0))
- return 0;
+ if (NotifyEventHooks(hContactDoubleClicked, hContact, 0))
+ return;
// Otherwise try to execute the default action
- TryProcessDoubleClick(wParam);
- return 0;
+ TIntMenuObject *pmo = GetMenuObjbyId(hContactMenuObject);
+ if (pmo != NULL) {
+ NotifyEventHooks(hPreBuildContactMenuEvent, hContact, 0);
+
+ TMO_IntMenuItem *pimi = Menu_GetDefaultItem(pmo->m_items.first);
+ if (pimi != NULL)
+ Menu_ProcessCommand(pimi, hContact);
+ }
}
static INT_PTR GetIconsImageList(WPARAM, LPARAM)
@@ -241,12 +248,6 @@ static INT_PTR GetIconsImageList(WPARAM, LPARAM)
return (INT_PTR)hCListImages;
}
-static INT_PTR ContactFilesDropped(WPARAM wParam, LPARAM lParam)
-{
- CallService(MS_FILE_SENDSPECIFICFILES, wParam, lParam);
- return 0;
-}
-
static int CListIconsChanged(WPARAM, LPARAM)
{
for (int i = 0; i < _countof(statusModeList); i++)
@@ -398,13 +399,14 @@ void fnChangeContactIcon(MCONTACT hContact, int iIcon)
/////////////////////////////////////////////////////////////////////////////////////////
-static INT_PTR CompareContacts(WPARAM wParam, LPARAM lParam)
+MIR_APP_DLL(int) Clist_ContactCompare(MCONTACT hContact1, MCONTACT hContact2)
{
- ClcContact *p1, *p2;
ClcData *dat = (ClcData*)GetWindowLongPtr(cli.hwndContactTree, 0);
- if (dat != NULL)
- if (!cli.pfnFindItem(cli.hwndContactTree, dat, wParam, &p1, NULL, NULL) && !cli.pfnFindItem(cli.hwndContactTree, dat, lParam, &p2, NULL, NULL))
+ if (dat != NULL) {
+ ClcContact *p1, *p2;
+ if (!cli.pfnFindItem(cli.hwndContactTree, dat, hContact1, &p1, NULL, NULL) && !cli.pfnFindItem(cli.hwndContactTree, dat, hContact2, &p2, NULL, NULL))
return cli.pfnCompareContacts(p1, p2);
+ }
return 0;
}
@@ -423,11 +425,6 @@ int LoadContactListModule2(void)
hContactDoubleClicked = CreateHookableEvent(ME_CLIST_DOUBLECLICKED);
hContactIconChangedEvent = CreateHookableEvent(ME_CLIST_CONTACTICONCHANGED);
- CreateServiceFunction(MS_CLIST_CONTACTDOUBLECLICKED, ContactDoubleClicked);
- CreateServiceFunction(MS_CLIST_CONTACTFILESDROPPED, ContactFilesDropped);
- CreateServiceFunction(MS_CLIST_CONTACTSCOMPARE, CompareContacts);
- CreateServiceFunction(MS_CLIST_CONTACTCHANGEGROUP, ContactChangeGroup);
-
InitCListEvents();
InitGroupServices();
cli.pfnInitTray();
diff --git a/src/mir_app/src/contact.cpp b/src/mir_app/src/contact.cpp
index c482deed19..430c699a1d 100644
--- a/src/mir_app/src/contact.cpp
+++ b/src/mir_app/src/contact.cpp
@@ -46,18 +46,18 @@ void fnLoadContactTree(void)
Clist_EndRebuild();
}
-INT_PTR ContactChangeGroup(WPARAM wParam, LPARAM lParam)
+MIR_APP_DLL(int) Clist_ContactChangeGroup(MCONTACT hContact, MGROUP hGroup)
{
CLISTGROUPCHANGE grpChg = { sizeof(CLISTGROUPCHANGE), NULL, NULL };
- if (lParam == NULL)
- db_unset(wParam, "CList", "Group");
+ if (hGroup == NULL)
+ db_unset(hContact, "CList", "Group");
else {
- grpChg.pszNewName = Clist_GroupGetName(lParam, NULL);
- db_set_ws(wParam, "CList", "Group", grpChg.pszNewName);
+ grpChg.pszNewName = Clist_GroupGetName(hGroup, NULL);
+ db_set_ws(hContact, "CList", "Group", grpChg.pszNewName);
}
- NotifyEventHooks(hGroupChangeEvent, wParam, (LPARAM)&grpChg);
+ NotifyEventHooks(hGroupChangeEvent, hContact, (LPARAM)&grpChg);
return 0;
}
diff --git a/src/mir_app/src/menu_utils.cpp b/src/mir_app/src/menu_utils.cpp
index 30a2a02eec..76955d5ae4 100644
--- a/src/mir_app/src/menu_utils.cpp
+++ b/src/mir_app/src/menu_utils.cpp
@@ -1273,22 +1273,6 @@ int RegisterAllIconsInIconLib()
return 0;
}
-int TryProcessDoubleClick(MCONTACT hContact)
-{
- TIntMenuObject *pmo = GetMenuObjbyId(hContactMenuObject);
- if (pmo != NULL) {
- NotifyEventHooks(hPreBuildContactMenuEvent, hContact, 0);
-
- TMO_IntMenuItem *pimi = Menu_GetDefaultItem(pmo->m_items.first);
- if (pimi != NULL) {
- Menu_ProcessCommand(pimi, hContact);
- return 0;
- }
- }
-
- return 1;
-}
-
/////////////////////////////////////////////////////////////////////////////////////////
// Static services
diff --git a/src/mir_app/src/meta_services.cpp b/src/mir_app/src/meta_services.cpp
index 3393c14a69..7a862f79df 100644
--- a/src/mir_app/src/meta_services.cpp
+++ b/src/mir_app/src/meta_services.cpp
@@ -695,10 +695,10 @@ INT_PTR Meta_ContactMenuFunc(WPARAM hMeta, LPARAM lParam)
CallService(MS_MSG_SENDMESSAGEW, hMeta, 0);
}
else // protocol does not support messaging - simulate double click
- CallService(MS_CLIST_CONTACTDOUBLECLICKED, hContact, 0);
+ Clist_ContactDoubleClicked(hContact);
}
else // protocol does not support messaging - simulate double click
- CallService(MS_CLIST_CONTACTDOUBLECLICKED, hContact, 0);
+ Clist_ContactDoubleClicked(hContact);
}
else if (options.menu_function == FT_MENU) // show contact's context menu
CallFunctionAsync(sttMenuThread, (void*)hContact);
diff --git a/src/mir_app/src/mir_app.def b/src/mir_app/src/mir_app.def
index 832cbb31b9..4f2eee5936 100644
--- a/src/mir_app/src/mir_app.def
+++ b/src/mir_app/src/mir_app.def
@@ -268,3 +268,6 @@ Clist_BroadcastAsync @267
Clist_MenuProcessCommand @268
Clist_IsDocked @269
Clist_MenuProcessHotkey @270
+Clist_ContactChangeGroup @271
+Clist_ContactCompare @272
+Clist_ContactDoubleClicked @273
diff --git a/src/mir_app/src/mir_app64.def b/src/mir_app/src/mir_app64.def
index d4dbb2fe8f..a046bfaf97 100644
--- a/src/mir_app/src/mir_app64.def
+++ b/src/mir_app/src/mir_app64.def
@@ -268,3 +268,6 @@ Clist_BroadcastAsync @267
Clist_MenuProcessCommand @268
Clist_IsDocked @269
Clist_MenuProcessHotkey @270
+Clist_ContactChangeGroup @271
+Clist_ContactCompare @272
+Clist_ContactDoubleClicked @273
diff --git a/src/mir_app/src/miranda.h b/src/mir_app/src/miranda.h
index c83fa8e4bf..3f3888f216 100644
--- a/src/mir_app/src/miranda.h
+++ b/src/mir_app/src/miranda.h
@@ -123,8 +123,6 @@ extern const int skinIconStatusFlags[ MAX_STATUS_COUNT ];
extern OBJLIST<CListEvent> g_cliEvents;
-int TryProcessDoubleClick(MCONTACT hContact);
-
/**** protocols.cpp *********************************************************************/
#define OFFSET_PROTOPOS 200
diff --git a/src/mir_app/src/movetogroup.cpp b/src/mir_app/src/movetogroup.cpp
index 6f229c38d7..aa5fbb7091 100644
--- a/src/mir_app/src/movetogroup.cpp
+++ b/src/mir_app/src/movetogroup.cpp
@@ -124,7 +124,7 @@ static int OnContactMenuBuild(WPARAM wParam, LPARAM)
static INT_PTR MTG_DOMOVE(WPARAM wParam, LPARAM lParam)
{
- CallService(MS_CLIST_CONTACTCHANGEGROUP, wParam, lParam < 0 ? 0 : lParam);
+ Clist_ContactChangeGroup(wParam, lParam < 0 ? 0 : lParam);
return 0;
}