summaryrefslogtreecommitdiff
path: root/src/modules
diff options
context:
space:
mode:
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/addcontact/addcontact.cpp10
-rw-r--r--src/modules/chat/chat.h10
-rw-r--r--src/modules/chat/clist.cpp24
-rw-r--r--src/modules/chat/tools.cpp2
-rw-r--r--src/modules/clist/clc.cpp54
-rw-r--r--src/modules/clist/clc.h30
-rw-r--r--src/modules/clist/clcfiledrop.cpp6
-rw-r--r--src/modules/clist/clcidents.cpp4
-rw-r--r--src/modules/clist/clcitems.cpp18
-rw-r--r--src/modules/clist/clcmsgs.cpp4
-rw-r--r--src/modules/clist/clcutils.cpp2
-rw-r--r--src/modules/clist/clistevents.cpp20
-rw-r--r--src/modules/clist/clistmenus.cpp2
-rw-r--r--src/modules/clist/clistmod.cpp22
-rw-r--r--src/modules/clist/clistsettings.cpp22
-rw-r--r--src/modules/clist/clui.cpp14
-rw-r--r--src/modules/clist/contact.cpp14
-rw-r--r--src/modules/clist/genmenu.cpp2
-rw-r--r--src/modules/clist/groups.cpp4
-rw-r--r--src/modules/clist/movetogroup.cpp2
-rw-r--r--src/modules/database/dbintf.cpp2
-rw-r--r--src/modules/database/dbutils.cpp2
-rw-r--r--src/modules/extraicons/BaseExtraIcon.cpp4
-rw-r--r--src/modules/extraicons/CallbackExtraIcon.cpp6
-rw-r--r--src/modules/extraicons/DefaultExtraIcons.cpp14
-rw-r--r--src/modules/extraicons/ExtraIcon.cpp2
-rw-r--r--src/modules/extraicons/ExtraIcon.h44
-rw-r--r--src/modules/extraicons/ExtraIconGroup.cpp14
-rw-r--r--src/modules/extraicons/IcolibExtraIcon.cpp8
-rw-r--r--src/modules/extraicons/extraicons.cpp8
-rw-r--r--src/modules/extraicons/extraicons.h4
-rw-r--r--src/modules/extraicons/options_ei.cpp2
-rw-r--r--src/modules/findadd/searchresults.cpp4
-rw-r--r--src/modules/ignore/ignore.cpp22
-rw-r--r--src/modules/protocols/protoaccs.cpp10
-rw-r--r--src/modules/protocols/protochains.cpp14
-rw-r--r--src/modules/protocols/protocols.cpp18
-rw-r--r--src/modules/protocols/protoint.cpp46
-rw-r--r--src/modules/srmm/statusicon.cpp4
-rw-r--r--src/modules/utils/path.cpp14
-rw-r--r--src/modules/utils/timezones.cpp10
-rw-r--r--src/modules/utils/windowlist.cpp4
-rw-r--r--src/modules/visibility/visibility.cpp4
43 files changed, 263 insertions, 263 deletions
diff --git a/src/modules/addcontact/addcontact.cpp b/src/modules/addcontact/addcontact.cpp
index 2659705072..c9cee416f5 100644
--- a/src/modules/addcontact/addcontact.cpp
+++ b/src/modules/addcontact/addcontact.cpp
@@ -58,9 +58,9 @@ INT_PTR CALLBACK AddContactDlgProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM lp
dbei.cbBlob = db_event_getBlobSize(acs->hDbEvent);
dbei.pBlob = (PBYTE)mir_alloc(dbei.cbBlob);
db_event_get(acs->hDbEvent, &dbei);
- HCONTACT hcontact = *(HCONTACT*)(dbei.pBlob + sizeof(DWORD));
+ MCONTACT hcontact = *(MCONTACT*)(dbei.pBlob + sizeof(DWORD));
mir_free(dbei.pBlob);
- if (hcontact != (HCONTACT)INVALID_HANDLE_VALUE) {
+ if (hcontact != INVALID_CONTACT_ID) {
szName = cli.pfnGetContactDisplayName(hcontact, 0);
isSet = 1;
}
@@ -147,18 +147,18 @@ INT_PTR CALLBACK AddContactDlgProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM lp
break;
case IDOK:
{
- HCONTACT hContact = (HCONTACT)INVALID_HANDLE_VALUE;
+ MCONTACT hContact = INVALID_CONTACT_ID;
switch (acs->handleType) {
case HANDLE_EVENT:
{
DBEVENTINFO dbei = { sizeof(dbei) };
db_event_get(acs->hDbEvent, &dbei);
- hContact = (HCONTACT)CallProtoServiceInt(NULL, dbei.szModule, PS_ADDTOLISTBYEVENT, 0, (LPARAM)acs->hDbEvent);
+ hContact = (MCONTACT)CallProtoServiceInt(NULL, dbei.szModule, PS_ADDTOLISTBYEVENT, 0, (LPARAM)acs->hDbEvent);
}
break;
case HANDLE_SEARCHRESULT:
- hContact = (HCONTACT)CallProtoServiceInt(NULL, acs->szProto, PS_ADDTOLIST, 0, (LPARAM)acs->psr);
+ hContact = (MCONTACT)CallProtoServiceInt(NULL, acs->szProto, PS_ADDTOLIST, 0, (LPARAM)acs->psr);
break;
case HANDLE_CONTACT:
diff --git a/src/modules/chat/chat.h b/src/modules/chat/chat.h
index d79accdc35..fbe96ac805 100644
--- a/src/modules/chat/chat.h
+++ b/src/modules/chat/chat.h
@@ -55,11 +55,11 @@ char* Log_CreateRTF(LOGSTREAMDATA *streamData);
char* Log_SetStyle(int style);
// clist.c
-BOOL AddEvent(HCONTACT hContact, HICON hIcon, HANDLE hEvent, int type, TCHAR* fmt, ...);
-HCONTACT AddRoom(const char *pszModule, const TCHAR *pszRoom, const TCHAR *pszDisplayName, int iType);
-HCONTACT FindRoom(const char *pszModule, const TCHAR *pszRoom);
+BOOL AddEvent(MCONTACT hContact, HICON hIcon, HANDLE hEvent, int type, TCHAR* fmt, ...);
+MCONTACT AddRoom(const char *pszModule, const TCHAR *pszRoom, const TCHAR *pszDisplayName, int iType);
+MCONTACT FindRoom(const char *pszModule, const TCHAR *pszRoom);
BOOL SetAllOffline(BOOL bHide, const char *pszModule);
-BOOL SetOffline(HCONTACT hContact, BOOL bHide);
+BOOL SetOffline(MCONTACT hContact, BOOL bHide);
int RoomDoubleclicked(WPARAM wParam,LPARAM lParam);
INT_PTR EventDoubleclicked(WPARAM wParam,LPARAM lParam);
@@ -99,7 +99,7 @@ BOOL IsEventSupported(int eventType);
BOOL LogToFile(SESSION_INFO *si, GCEVENT *gce);
BOOL DoTrayIcon(SESSION_INFO *si, GCEVENT *gce);
BOOL DoPopup(SESSION_INFO *si, GCEVENT *gce);
-int ShowPopup(HCONTACT hContact, SESSION_INFO *si, HICON hIcon, char* pszProtoName, TCHAR* pszRoomName, COLORREF crBkg, const TCHAR* fmt, ...);
+int ShowPopup(MCONTACT hContact, SESSION_INFO *si, HICON hIcon, char* pszProtoName, TCHAR* pszRoomName, COLORREF crBkg, const TCHAR* fmt, ...);
const TCHAR* my_strstri(const TCHAR* s1, const TCHAR* s2);
diff --git a/src/modules/chat/clist.cpp b/src/modules/chat/clist.cpp
index cbd9fbd262..5f47aa4c4b 100644
--- a/src/modules/chat/clist.cpp
+++ b/src/modules/chat/clist.cpp
@@ -22,7 +22,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "chat.h"
-HCONTACT AddRoom(const char *pszModule, const TCHAR *pszRoom, const TCHAR *pszDisplayName, int iType)
+MCONTACT AddRoom(const char *pszModule, const TCHAR *pszRoom, const TCHAR *pszDisplayName, int iType)
{
TCHAR pszGroup[50]; *pszGroup = '\0';
ptrT groupName(db_get_tsa(NULL, CHAT_MODULE, "AddToGroup"));
@@ -42,7 +42,7 @@ HCONTACT AddRoom(const char *pszModule, const TCHAR *pszRoom, const TCHAR *pszDi
}
}
- HCONTACT hContact = ci.FindRoom(pszModule, pszRoom);
+ MCONTACT hContact = ci.FindRoom(pszModule, pszRoom);
if (hContact) { //contact exist, make sure it is in the right group
if (pszGroup[0]) {
ptrT grpName(db_get_tsa(hContact, "CList", "Group"));
@@ -56,7 +56,7 @@ HCONTACT AddRoom(const char *pszModule, const TCHAR *pszRoom, const TCHAR *pszDi
}
// here we create a new one since no one is to be found
- if ((hContact = (HCONTACT)CallService(MS_DB_CONTACT_ADD, 0, 0)) == NULL)
+ if ((hContact = (MCONTACT)CallService(MS_DB_CONTACT_ADD, 0, 0)) == NULL)
return NULL;
CallService(MS_PROTO_ADDTOCONTACT, (WPARAM)hContact, (LPARAM)pszModule);
@@ -71,7 +71,7 @@ HCONTACT AddRoom(const char *pszModule, const TCHAR *pszRoom, const TCHAR *pszDi
return hContact;
}
-BOOL SetOffline(HCONTACT hContact, BOOL bHide)
+BOOL SetOffline(MCONTACT hContact, BOOL bHide)
{
if (hContact) {
char *szProto = GetContactProto(hContact);
@@ -85,7 +85,7 @@ BOOL SetOffline(HCONTACT hContact, BOOL bHide)
BOOL SetAllOffline(BOOL bHide, const char *pszModule)
{
- for (HCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
+ for (MCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
char *szProto = GetContactProto(hContact);
if (!ci.MM_FindModule(szProto))
continue;
@@ -103,7 +103,7 @@ BOOL SetAllOffline(BOOL bHide, const char *pszModule)
int RoomDoubleclicked(WPARAM wParam, LPARAM lParam)
{
- HCONTACT hContact = (HCONTACT)wParam;
+ MCONTACT hContact = (MCONTACT)wParam;
if (!hContact)
return 0;
@@ -141,7 +141,7 @@ INT_PTR EventDoubleclicked(WPARAM wParam,LPARAM lParam)
INT_PTR JoinChat(WPARAM wParam, LPARAM lParam)
{
- HCONTACT hContact = (HCONTACT)wParam;
+ MCONTACT hContact = (MCONTACT)wParam;
if (hContact) {
char *szProto = GetContactProto(hContact);
if (szProto) {
@@ -157,7 +157,7 @@ INT_PTR JoinChat(WPARAM wParam, LPARAM lParam)
INT_PTR LeaveChat(WPARAM wParam, LPARAM lParam)
{
- HCONTACT hContact = (HCONTACT)wParam;
+ MCONTACT hContact = (MCONTACT)wParam;
if (hContact) {
char *szProto = GetContactProto(hContact);
if (szProto)
@@ -168,7 +168,7 @@ INT_PTR LeaveChat(WPARAM wParam, LPARAM lParam)
int PrebuildContactMenu(WPARAM wParam, LPARAM)
{
- HCONTACT hContact = (HCONTACT)wParam;
+ MCONTACT hContact = (MCONTACT)wParam;
if (hContact == NULL)
return 0;
@@ -201,7 +201,7 @@ INT_PTR PrebuildContactMenuSvc(WPARAM wParam, LPARAM lParam)
return PrebuildContactMenu(wParam, lParam);
}
-BOOL AddEvent(HCONTACT hContact, HICON hIcon, HANDLE hEvent, int type, TCHAR* fmt, ... )
+BOOL AddEvent(MCONTACT hContact, HICON hIcon, HANDLE hEvent, int type, TCHAR* fmt, ... )
{
TCHAR szBuf[4096];
@@ -233,9 +233,9 @@ BOOL AddEvent(HCONTACT hContact, HICON hIcon, HANDLE hEvent, int type, TCHAR* fm
return TRUE;
}
-HCONTACT FindRoom(const char *pszModule, const TCHAR *pszRoom)
+MCONTACT FindRoom(const char *pszModule, const TCHAR *pszRoom)
{
- for (HCONTACT hContact = db_find_first(pszModule); hContact; hContact = db_find_next(hContact, pszModule)) {
+ for (MCONTACT hContact = db_find_first(pszModule); hContact; hContact = db_find_next(hContact, pszModule)) {
if (!db_get_b(hContact, pszModule, "ChatRoom", 0))
continue;
diff --git a/src/modules/chat/tools.cpp b/src/modules/chat/tools.cpp
index 9001e5678b..cff0ad072e 100644
--- a/src/modules/chat/tools.cpp
+++ b/src/modules/chat/tools.cpp
@@ -166,7 +166,7 @@ static LRESULT CALLBACK PopupDlgProc(HWND hWnd, UINT message, WPARAM wParam, LPA
return DefWindowProc(hWnd, message, wParam, lParam);
}
-int ShowPopup(HCONTACT hContact, SESSION_INFO *si, HICON hIcon, char* pszProtoName, TCHAR* pszRoomName, COLORREF crBkg, const TCHAR* fmt, ...)
+int ShowPopup(MCONTACT hContact, SESSION_INFO *si, HICON hIcon, char* pszProtoName, TCHAR* pszRoomName, COLORREF crBkg, const TCHAR* fmt, ...)
{
static TCHAR szBuf[4 * 1024];
diff --git a/src/modules/clist/clc.cpp b/src/modules/clist/clc.cpp
index f087f87039..b2f3bad3fb 100644
--- a/src/modules/clist/clc.cpp
+++ b/src/modules/clist/clc.cpp
@@ -78,7 +78,7 @@ static int ClcSettingChanged(WPARAM wParam, LPARAM lParam)
if (!strcmp(cws->szModule, "CList")) {
if (!strcmp(cws->szSetting, "MyHandle")) {
- cli.pfnInvalidateDisplayNameCacheEntry((HCONTACT)wParam);
+ cli.pfnInvalidateDisplayNameCacheEntry((MCONTACT)wParam);
cli.pfnClcBroadcast(INTM_NAMECHANGED, wParam, lParam);
}
else if (!strcmp(cws->szSetting, "Group"))
@@ -93,7 +93,7 @@ static int ClcSettingChanged(WPARAM wParam, LPARAM lParam)
cli.pfnClcBroadcast(INTM_NAMEORDERCHANGED, 0, 0);
}
else {
- char *szProto = GetContactProto((HCONTACT)wParam);
+ char *szProto = GetContactProto((MCONTACT)wParam);
if (szProto != NULL) {
if (!strcmp(cws->szModule, "Protocol") && !strcmp(cws->szSetting, "p"))
cli.pfnClcBroadcast(INTM_PROTOCHANGED, wParam, lParam);
@@ -443,13 +443,13 @@ LRESULT CALLBACK fnContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wParam,
break;
case INTM_CONTACTADDED:
- cli.pfnAddContactToTree(hwnd, dat, (HCONTACT)wParam, 1, 1);
- cli.pfnNotifyNewContact(hwnd, (HCONTACT)wParam);
+ cli.pfnAddContactToTree(hwnd, dat, (MCONTACT)wParam, 1, 1);
+ cli.pfnNotifyNewContact(hwnd, (MCONTACT)wParam);
SortClcByTimer(hwnd);
break;
case INTM_CONTACTDELETED:
- cli.pfnDeleteItemFromTree(hwnd, (HCONTACT)wParam);
+ cli.pfnDeleteItemFromTree(hwnd, (MCONTACT)wParam);
SortClcByTimer(hwnd);
break;
@@ -461,10 +461,10 @@ LRESULT CALLBACK fnContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wParam,
if (dbcws->value.type == DBVT_DELETED || dbcws->value.bVal == 0) {
if (cli.pfnFindItem(hwnd, dat, (HANDLE)wParam, NULL, NULL, NULL))
break;
- cli.pfnAddContactToTree(hwnd, dat, (HCONTACT)wParam, 1, 1);
- cli.pfnNotifyNewContact(hwnd, (HCONTACT)wParam);
+ cli.pfnAddContactToTree(hwnd, dat, (MCONTACT)wParam, 1, 1);
+ cli.pfnNotifyNewContact(hwnd, (MCONTACT)wParam);
}
- else cli.pfnDeleteItemFromTree(hwnd, (HCONTACT)wParam);
+ else cli.pfnDeleteItemFromTree(hwnd, (MCONTACT)wParam);
dat->needsResort = 1;
SortClcByTimer(hwnd);
@@ -481,10 +481,10 @@ LRESULT CALLBACK fnContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wParam,
memcpy(iExtraImage, contact->iExtraImage, sizeof(iExtraImage));
flags = contact->flags;
}
- cli.pfnDeleteItemFromTree(hwnd, (HCONTACT)wParam);
- if (GetWindowLongPtr(hwnd, GWL_STYLE) & CLS_SHOWHIDDEN || !db_get_b((HCONTACT)wParam, "CList", "Hidden", 0)) {
+ cli.pfnDeleteItemFromTree(hwnd, (MCONTACT)wParam);
+ if (GetWindowLongPtr(hwnd, GWL_STYLE) & CLS_SHOWHIDDEN || !db_get_b((MCONTACT)wParam, "CList", "Hidden", 0)) {
NMCLISTCONTROL nm;
- cli.pfnAddContactToTree(hwnd, dat, (HCONTACT)wParam, 1, 1);
+ cli.pfnAddContactToTree(hwnd, dat, (MCONTACT)wParam, 1, 1);
if (cli.pfnFindItem(hwnd, dat, (HANDLE)wParam, &contact, NULL, NULL)) {
memcpy(contact->iExtraImage, iExtraImage, sizeof(iExtraImage));
if (flags & CONTACTF_CHECKED)
@@ -506,18 +506,18 @@ LRESULT CALLBACK fnContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wParam,
{
int recalcScrollBar = 0, shouldShow;
WORD status;
- HCONTACT hSelItem = NULL;
+ MCONTACT hSelItem = NULL;
ClcContact *selcontact = NULL;
- char *szProto = GetContactProto((HCONTACT)wParam);
+ char *szProto = GetContactProto((MCONTACT)wParam);
if (szProto == NULL)
status = ID_STATUS_OFFLINE;
else
- status = db_get_w((HCONTACT)wParam, szProto, "Status", ID_STATUS_OFFLINE);
+ status = db_get_w((MCONTACT)wParam, szProto, "Status", ID_STATUS_OFFLINE);
// this means an offline msg is flashing, so the contact should be shown
DWORD style = GetWindowLongPtr(hwnd, GWL_STYLE);
- shouldShow = (style & CLS_SHOWHIDDEN || !db_get_b((HCONTACT)wParam, "CList", "Hidden", 0))
+ shouldShow = (style & CLS_SHOWHIDDEN || !db_get_b((MCONTACT)wParam, "CList", "Hidden", 0))
&& (!cli.pfnIsHiddenMode(dat, status) || CallService(MS_CLIST_GETCONTACTICON, wParam, 0) != lParam);
contact = NULL;
@@ -525,13 +525,13 @@ LRESULT CALLBACK fnContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wParam,
if (!cli.pfnFindItem(hwnd, dat, (HANDLE)wParam, &contact, &group, NULL)) {
if (shouldShow && CallService(MS_DB_CONTACT_IS, wParam, 0)) {
if (dat->selection >= 0 && cli.pfnGetRowByIndex(dat, dat->selection, &selcontact, NULL) != -1)
- hSelItem = (HCONTACT)cli.pfnContactToHItem(selcontact);
- cli.pfnAddContactToTree(hwnd, dat, (HCONTACT)wParam, (style & CLS_CONTACTLIST) == 0, 0);
+ hSelItem = (MCONTACT)cli.pfnContactToHItem(selcontact);
+ cli.pfnAddContactToTree(hwnd, dat, (MCONTACT)wParam, (style & CLS_CONTACTLIST) == 0, 0);
recalcScrollBar = 1;
cli.pfnFindItem(hwnd, dat, (HANDLE)wParam, &contact, NULL, NULL);
if (contact) {
contact->iImage = (WORD) lParam;
- cli.pfnNotifyNewContact(hwnd, (HCONTACT)wParam);
+ cli.pfnNotifyNewContact(hwnd, (MCONTACT)wParam);
dat->needsResort = 1;
}
}
@@ -541,7 +541,7 @@ LRESULT CALLBACK fnContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wParam,
break;
if (!shouldShow && !(style & CLS_NOHIDEOFFLINE) && (style & CLS_HIDEOFFLINE || group->hideOffline)) {
if (dat->selection >= 0 && cli.pfnGetRowByIndex(dat, dat->selection, &selcontact, NULL) != -1)
- hSelItem = (HCONTACT)cli.pfnContactToHItem(selcontact);
+ hSelItem = (MCONTACT)cli.pfnContactToHItem(selcontact);
cli.pfnRemoveItemFromGroup(hwnd, group, contact, (style & CLS_CONTACTLIST) == 0);
recalcScrollBar = 1;
}
@@ -569,7 +569,7 @@ LRESULT CALLBACK fnContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wParam,
if (!cli.pfnFindItem(hwnd, dat, (HANDLE)wParam, &contact, NULL, NULL))
break;
- lstrcpyn(contact->szText, cli.pfnGetContactDisplayName((HCONTACT)wParam, 0), SIZEOF(contact->szText));
+ lstrcpyn(contact->szText, cli.pfnGetContactDisplayName((MCONTACT)wParam, 0), SIZEOF(contact->szText));
dat->needsResort = 1;
SortClcByTimer(hwnd);
break;
@@ -578,9 +578,9 @@ LRESULT CALLBACK fnContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wParam,
if (!cli.pfnFindItem(hwnd, dat, (HANDLE)wParam, &contact, NULL, NULL))
break;
- contact->proto = GetContactProto((HCONTACT)wParam);
- cli.pfnInvalidateDisplayNameCacheEntry((HCONTACT)wParam);
- lstrcpyn(contact->szText, cli.pfnGetContactDisplayName((HCONTACT)wParam, 0), SIZEOF(contact->szText));
+ contact->proto = GetContactProto((MCONTACT)wParam);
+ cli.pfnInvalidateDisplayNameCacheEntry((MCONTACT)wParam);
+ lstrcpyn(contact->szText, cli.pfnGetContactDisplayName((MCONTACT)wParam, 0), SIZEOF(contact->szText));
SortClcByTimer(hwnd);
break;
@@ -604,11 +604,11 @@ LRESULT CALLBACK fnContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wParam,
case INTM_APPARENTMODECHANGED:
if (cli.pfnFindItem(hwnd, dat, (HANDLE)wParam, &contact, NULL, NULL)) {
- char *szProto = GetContactProto((HCONTACT)wParam);
+ char *szProto = GetContactProto((MCONTACT)wParam);
if (szProto == NULL)
break;
- WORD apparentMode = db_get_w((HCONTACT)wParam, szProto, "ApparentMode", 0);
+ WORD apparentMode = db_get_w((MCONTACT)wParam, szProto, "ApparentMode", 0);
contact->flags &= ~(CONTACTF_INVISTO | CONTACTF_VISTO);
if (apparentMode == ID_STATUS_OFFLINE)
contact->flags |= CONTACTF_INVISTO;
@@ -626,11 +626,11 @@ LRESULT CALLBACK fnContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wParam,
case INTM_IDLECHANGED:
if (cli.pfnFindItem(hwnd, dat, (HANDLE)wParam, &contact, NULL, NULL)) {
- char *szProto = GetContactProto((HCONTACT)wParam);
+ char *szProto = GetContactProto((MCONTACT)wParam);
if (szProto == NULL)
break;
contact->flags &= ~CONTACTF_IDLE;
- if (db_get_dw((HCONTACT)wParam, szProto, "IdleTS", 0))
+ if (db_get_dw((MCONTACT)wParam, szProto, "IdleTS", 0))
contact->flags |= CONTACTF_IDLE;
cli.pfnInvalidateRect(hwnd, NULL, FALSE);
diff --git a/src/modules/clist/clc.h b/src/modules/clist/clc.h
index b95e072656..0c1a714fae 100644
--- a/src/modules/clist/clc.h
+++ b/src/modules/clist/clc.h
@@ -58,9 +58,9 @@ void fnFreeContact(ClcContact *p);
void fnFreeGroup(ClcGroup *group);
int fnAddInfoItemToGroup(ClcGroup *group, int flags, const TCHAR *pszText);
int fnAddItemToGroup(ClcGroup *group, int iAboveItem);
-void fnAddContactToTree(HWND hwnd, struct ClcData *dat, HCONTACT hContact, int updateTotalCount, int checkHideOffline);
-int fnAddContactToGroup(struct ClcData *dat, ClcGroup *group, HCONTACT hContact);
-void fnDeleteItemFromTree(HWND hwnd, HCONTACT hItem);
+void fnAddContactToTree(HWND hwnd, struct ClcData *dat, MCONTACT hContact, int updateTotalCount, int checkHideOffline);
+int fnAddContactToGroup(struct ClcData *dat, ClcGroup *group, MCONTACT hContact);
+void fnDeleteItemFromTree(HWND hwnd, MCONTACT hItem);
void fnRebuildEntireList(HWND hwnd, struct ClcData *dat);
int fnGetGroupContentsCount(ClcGroup *group, int visibleOnly);
void fnSortCLC(HWND hwnd, struct ClcData *dat, int useInsertionSort);
@@ -86,7 +86,7 @@ int fnGetDropTargetInformation(HWND hwnd, struct ClcData *dat, POINT pt);
int fnClcStatusToPf2(int status);
int fnIsHiddenMode(struct ClcData *dat, int status);
void fnHideInfoTip(HWND hwnd, struct ClcData *dat);
-void fnNotifyNewContact(HWND hwnd, HCONTACT hContact);
+void fnNotifyNewContact(HWND hwnd, MCONTACT hContact);
DWORD fnGetDefaultExStyle(void);
void fnGetSetting(int i, LOGFONT* lf, COLORREF* colour);
void fnGetDefaultFontSetting(int i, LOGFONT* lf, COLORREF* colour);
@@ -120,12 +120,12 @@ void RebuildMenuOrder(void);
INT_PTR MenuProcessCommand(WPARAM wParam, LPARAM lParam);
/* clistsettings.c */
-TCHAR* fnGetContactDisplayName(HCONTACT hContact, int mode);
+TCHAR* fnGetContactDisplayName(MCONTACT hContact, int mode);
void fnGetDefaultFontSetting(int i, LOGFONT* lf, COLORREF * colour);
-void fnInvalidateDisplayNameCacheEntry(HCONTACT hContact);
+void fnInvalidateDisplayNameCacheEntry(MCONTACT hContact);
-ClcCacheEntry* fnGetCacheEntry(HCONTACT hContact);
-ClcCacheEntry* fnCreateCacheItem (HCONTACT hContact);
+ClcCacheEntry* fnGetCacheEntry(MCONTACT hContact);
+ClcCacheEntry* fnCreateCacheItem (MCONTACT hContact);
void fnCheckCacheItem(ClcCacheEntry *p);
void fnFreeCacheItem(ClcCacheEntry *p);
@@ -137,21 +137,21 @@ void fnUnregisterFileDropping (HWND hwnd);
/* clistevents.c */
struct CListEvent* fnAddEvent(CLISTEVENT *cle);
-CLISTEVENT* fnGetEvent(HCONTACT hContact, int idx);
+CLISTEVENT* fnGetEvent(MCONTACT hContact, int idx);
struct CListEvent* fnCreateEvent(void);
void fnFreeEvent(struct CListEvent* p);
-int fnEventsProcessContactDoubleClick(HCONTACT hContact);
+int fnEventsProcessContactDoubleClick(MCONTACT hContact);
int fnEventsProcessTrayDoubleClick(int);
int fnGetImlIconIndex(HICON hIcon);
-int fnRemoveEvent(HCONTACT hContact, HANDLE dbEvent);
+int fnRemoveEvent(MCONTACT hContact, HANDLE dbEvent);
/* clistmod.c */
-int fnGetContactIcon(HCONTACT hContact);
-int fnIconFromStatusMode(const char *szProto, int status, HCONTACT hContact);
+int fnGetContactIcon(MCONTACT hContact);
+int fnIconFromStatusMode(const char *szProto, int status, MCONTACT hContact);
int fnShowHide(WPARAM wParam, LPARAM lParam);
-HICON fnGetIconFromStatusMode(HCONTACT hContact, const char *szProto, int status);
+HICON fnGetIconFromStatusMode(MCONTACT hContact, const char *szProto, int status);
TCHAR* fnGetStatusModeDescription(int wParam, int lParam);
int fnGetWindowVisibleState(HWND hWnd, int iStepX, int iStepY);
@@ -186,7 +186,7 @@ void fnCluiProtocolStatusChanged(int, const char*);
void fnDrawMenuItem(DRAWITEMSTRUCT *dis, HICON hIcon, HICON eventIcon);
/* contact.c */
-void fnChangeContactIcon (HCONTACT hContact, int iIcon, int add);
+void fnChangeContactIcon (MCONTACT hContact, int iIcon, int add);
void fnLoadContactTree (void);
int fnCompareContacts (const ClcContact *contact1, const ClcContact *contact2);
void fnSortContacts (void);
diff --git a/src/modules/clist/clcfiledrop.cpp b/src/modules/clist/clcfiledrop.cpp
index 2c79cafb7e..9cb9e01f03 100644
--- a/src/modules/clist/clcfiledrop.cpp
+++ b/src/modules/clist/clcfiledrop.cpp
@@ -70,7 +70,7 @@ ULONG CDropTarget::Release(void)
return InterlockedDecrement(&refCount);
}
-static HCONTACT HContactFromPoint(HWND hwnd, struct ClcData *dat, int x, int y, int *hitLine)
+static MCONTACT HContactFromPoint(HWND hwnd, struct ClcData *dat, int x, int y, int *hitLine)
{
DWORD hitFlags;
ClcContact *contact;
@@ -98,7 +98,7 @@ HRESULT CDropTarget::DragOver(DWORD /*grfKeyState*/, POINTL pt, DWORD * pdwEffec
struct ClcData *dat;
RECT clRect;
int hit;
- HCONTACT hContact;
+ MCONTACT hContact;
if (pDropTargetHelper && hwndCurrentDrag)
pDropTargetHelper->DragOver((POINT*)&pt, *pdwEffect);
@@ -220,7 +220,7 @@ HRESULT CDropTarget::Drop(IDataObject * pDataObj, DWORD /*fKeyState*/, POINTL pt
shortPt.x = pt.x;
shortPt.y = pt.y;
ScreenToClient(hwndCurrentDrag, &shortPt);
- HCONTACT hContact = HContactFromPoint(hwndCurrentDrag, dat, shortPt.x, shortPt.y, NULL);
+ MCONTACT hContact = HContactFromPoint(hwndCurrentDrag, dat, shortPt.x, shortPt.y, NULL);
if (hContact != NULL) {
TCHAR **ppFiles = NULL;
TCHAR szFilename[MAX_PATH];
diff --git a/src/modules/clist/clcidents.cpp b/src/modules/clist/clcidents.cpp
index 7165d61b48..40584a910d 100644
--- a/src/modules/clist/clcidents.cpp
+++ b/src/modules/clist/clcidents.cpp
@@ -99,9 +99,9 @@ int fnFindItem(HWND hwnd, struct ClcData *dat, HANDLE hItem, ClcContact **contac
if ((IsHContactGroup(hItem) && group->cl.items[group->scanIndex]->type == CLCIT_GROUP &&
((unsigned) hItem & ~HCONTACT_ISGROUP) == group->cl.items[group->scanIndex]->groupId) || (IsHContactContact(hItem) &&
group->cl.items[group->scanIndex]->type == CLCIT_CONTACT &&
- group->cl.items[group->scanIndex]->hContact == (HCONTACT)hItem) || (IsHContactInfo(hItem) &&
+ group->cl.items[group->scanIndex]->hContact == (MCONTACT)hItem) || (IsHContactInfo(hItem) &&
group->cl.items[group->scanIndex]->type == CLCIT_INFO &&
- group->cl.items[group->scanIndex]->hContact == (HCONTACT)((UINT_PTR)hItem & ~HCONTACT_ISINFO)))
+ group->cl.items[group->scanIndex]->hContact == (MCONTACT)((UINT_PTR)hItem & ~HCONTACT_ISINFO)))
{
if (isVisible) {
if (!nowVisible)
diff --git a/src/modules/clist/clcitems.cpp b/src/modules/clist/clcitems.cpp
index 690de3c4cb..9587d3f94f 100644
--- a/src/modules/clist/clcitems.cpp
+++ b/src/modules/clist/clcitems.cpp
@@ -108,7 +108,7 @@ ClcGroup* fnAddGroup(HWND hwnd, struct ClcData *dat, const TCHAR *szName, DWORD
group->totalMembers = 0;
if (flags != (DWORD) - 1 && pNextField == NULL && calcTotalMembers) {
DWORD style = GetWindowLongPtr(hwnd, GWL_STYLE);
- for (HCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
+ for (MCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
ClcCacheEntry *cache = cli.pfnGetCacheEntry(hContact);
if (!lstrcmp(cache->tszGroup, szName) && (style & CLS_SHOWHIDDEN || !cache->bIsHidden))
group->totalMembers++;
@@ -164,12 +164,12 @@ int fnAddInfoItemToGroup(ClcGroup *group, int flags, const TCHAR *pszText)
++iInfoItemUniqueHandle;
group->cl.items[i]->type = CLCIT_INFO;
group->cl.items[i]->flags = (BYTE) flags;
- group->cl.items[i]->hContact = (HCONTACT)++iInfoItemUniqueHandle;
+ group->cl.items[i]->hContact = (MCONTACT)++iInfoItemUniqueHandle;
lstrcpyn(group->cl.items[i]->szText, pszText, SIZEOF(group->cl.items[i]->szText));
return i;
}
-int fnAddContactToGroup(struct ClcData *dat, ClcGroup *group, HCONTACT hContact)
+int fnAddContactToGroup(struct ClcData *dat, ClcGroup *group, MCONTACT hContact)
{
int i, index = -1;
@@ -212,7 +212,7 @@ int fnAddContactToGroup(struct ClcData *dat, ClcGroup *group, HCONTACT hContact)
return i;
}
-void fnAddContactToTree(HWND hwnd, struct ClcData *dat, HCONTACT hContact, int updateTotalCount, int checkHideOffline)
+void fnAddContactToTree(HWND hwnd, struct ClcData *dat, MCONTACT hContact, int updateTotalCount, int checkHideOffline)
{
ClcGroup *group;
DBVARIANT dbv;
@@ -309,7 +309,7 @@ ClcGroup* fnRemoveItemFromGroup(HWND hwnd, ClcGroup *group, ClcContact *contact,
return group;
}
-void fnDeleteItemFromTree(HWND hwnd, HCONTACT hItem)
+void fnDeleteItemFromTree(HWND hwnd, MCONTACT hItem)
{
ClcContact *contact;
ClcGroup *group;
@@ -363,7 +363,7 @@ void fnRebuildEntireList(HWND hwnd, struct ClcData *dat)
cli.pfnAddGroup(hwnd, dat, szGroupName, groupFlags, i, 0);
}
- for (HCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
+ for (MCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
if (style & CLS_SHOWHIDDEN || !db_get_b(hContact, "CList", "Hidden", 0)) {
DBVARIANT dbv;
if (db_get_ts(hContact, "CList", "Group", &dbv))
@@ -545,13 +545,13 @@ void fnSortCLC(HWND hwnd, struct ClcData *dat, int useInsertionSort)
{
ClcContact *selcontact;
ClcGroup *group = &dat->list, *selgroup;
- HCONTACT hSelItem;
+ MCONTACT hSelItem;
if (dat->needsResort) {
if (cli.pfnGetRowByIndex(dat, dat->selection, &selcontact, NULL) == -1)
hSelItem = NULL;
else
- hSelItem = (HCONTACT)cli.pfnContactToHItem(selcontact);
+ hSelItem = (MCONTACT)cli.pfnContactToHItem(selcontact);
group->scanIndex = 0;
SortGroup(dat, group, useInsertionSort);
for (;;) {
@@ -580,7 +580,7 @@ void fnSortCLC(HWND hwnd, struct ClcData *dat, int useInsertionSort)
struct SavedContactState_t
{
- HCONTACT hContact;
+ MCONTACT hContact;
WORD iExtraImage[EXTRA_ICON_COUNT];
int checked;
};
diff --git a/src/modules/clist/clcmsgs.cpp b/src/modules/clist/clcmsgs.cpp
index 9ce6f5c3a9..2f839b934d 100644
--- a/src/modules/clist/clcmsgs.cpp
+++ b/src/modules/clist/clcmsgs.cpp
@@ -31,7 +31,7 @@ LRESULT fnProcessExternalMessages(HWND hwnd, struct ClcData *dat, UINT msg, WPAR
{
switch (msg) {
case CLM_ADDCONTACT:
- cli.pfnAddContactToTree(hwnd, dat, (HCONTACT)wParam, 1, 0);
+ cli.pfnAddContactToTree(hwnd, dat, (MCONTACT)wParam, 1, 0);
cli.pfnRecalcScrollBar(hwnd, dat);
cli.pfnSortCLC(hwnd, dat, 1);
break;
@@ -79,7 +79,7 @@ LRESULT fnProcessExternalMessages(HWND hwnd, struct ClcData *dat, UINT msg, WPAR
break;
case CLM_DELETEITEM:
- cli.pfnDeleteItemFromTree(hwnd, (HCONTACT)wParam);
+ cli.pfnDeleteItemFromTree(hwnd, (MCONTACT)wParam);
cli.pfnSortCLC(hwnd, dat, 1);
cli.pfnRecalcScrollBar(hwnd, dat);
break;
diff --git a/src/modules/clist/clcutils.cpp b/src/modules/clist/clcutils.cpp
index d5cb14fdbf..470936f9e4 100644
--- a/src/modules/clist/clcutils.cpp
+++ b/src/modules/clist/clcutils.cpp
@@ -633,7 +633,7 @@ void fnHideInfoTip(HWND, struct ClcData *dat)
NotifyEventHooks(hHideInfoTipEvent, 0, (LPARAM) & it);
}
-void fnNotifyNewContact(HWND hwnd, HCONTACT hContact)
+void fnNotifyNewContact(HWND hwnd, MCONTACT hContact)
{
NMCLISTCONTROL nm;
nm.hdr.code = CLN_NEWCONTACT;
diff --git a/src/modules/clist/clistevents.cpp b/src/modules/clist/clistevents.cpp
index 4acefdf247..6a99a46180 100644
--- a/src/modules/clist/clistevents.cpp
+++ b/src/modules/clist/clistevents.cpp
@@ -200,7 +200,7 @@ struct CListEvent* fnAddEvent(CLISTEVENT *cle)
// Removes an event from the contact list's queue
// Returns 0 if the event was successfully removed, or nonzero if the event was not found
-int fnRemoveEvent(HCONTACT hContact, HANDLE dbEvent)
+int fnRemoveEvent(MCONTACT hContact, HANDLE dbEvent)
{
int i;
char *szProto;
@@ -257,9 +257,9 @@ int fnRemoveEvent(HCONTACT hContact, HANDLE dbEvent)
return 0;
}
-CLISTEVENT* fnGetEvent(HCONTACT hContact, int idx)
+CLISTEVENT* fnGetEvent(MCONTACT hContact, int idx)
{
- if (hContact == (HCONTACT)INVALID_HANDLE_VALUE) {
+ if (hContact == INVALID_CONTACT_ID) {
if (idx >= cli.events.count)
return NULL;
return &cli.events.items[idx]->cle;
@@ -272,7 +272,7 @@ CLISTEVENT* fnGetEvent(HCONTACT hContact, int idx)
return NULL;
}
-int fnEventsProcessContactDoubleClick(HCONTACT hContact)
+int fnEventsProcessContactDoubleClick(MCONTACT hContact)
{
for (int i=0; i < cli.events.count; i++) {
if (cli.events.items[i]->cle.hContact == hContact) {
@@ -290,7 +290,7 @@ int fnEventsProcessTrayDoubleClick(int index)
{
BOOL click_in_first_icon = FALSE;
if (cli.events.count) {
- HCONTACT hContact;
+ MCONTACT hContact;
HANDLE hDbEvent;
int eventIndex = 0;
cli.pfnLockTray();
@@ -370,8 +370,8 @@ static int RemoveEventsForContact(WPARAM wParam, LPARAM)
for (; cli.events.count > 0;) {
for (hit = 0, j = 0; j < cli.events.count; j++) {
- if (cli.events.items[j]->cle.hContact == (HCONTACT)wParam) {
- cli.pfnRemoveEvent((HCONTACT)wParam, cli.events.items[j]->cle.hDbEvent);
+ if (cli.events.items[j]->cle.hContact == (MCONTACT)wParam) {
+ cli.pfnRemoveEvent((MCONTACT)wParam, cli.events.items[j]->cle.hDbEvent);
hit = 1;
}
}
@@ -384,7 +384,7 @@ static int RemoveEventsForContact(WPARAM wParam, LPARAM)
static int CListEventSettingsChanged(WPARAM wParam, LPARAM lParam)
{
- HCONTACT hContact = (HCONTACT)wParam;
+ MCONTACT hContact = (MCONTACT)wParam;
DBCONTACTWRITESETTING *cws = (DBCONTACTWRITESETTING*)lParam;
if (hContact == NULL && cws && cws->szModule && cws->szSetting && strcmp(cws->szModule, "CList") == 0) {
if (strcmp(cws->szSetting, "DisableTrayFlash") == 0)
@@ -399,8 +399,8 @@ static int CListEventSettingsChanged(WPARAM wParam, LPARAM lParam)
INT_PTR AddEventSyncStub(WPARAM wParam, LPARAM lParam) { return CallServiceSync(MS_CLIST_ADDEVENT"_SYNC", wParam, lParam); }
INT_PTR AddEventStub(WPARAM, LPARAM lParam) { return cli.pfnAddEvent((CLISTEVENT*)lParam) == NULL; }
-INT_PTR RemoveEventStub(WPARAM wParam, LPARAM lParam) { return cli.pfnRemoveEvent((HCONTACT)wParam, (HANDLE)lParam); }
-INT_PTR GetEventStub(WPARAM wParam, LPARAM lParam) { return (INT_PTR)cli.pfnGetEvent((HCONTACT)wParam, (int)lParam); }
+INT_PTR RemoveEventStub(WPARAM wParam, LPARAM lParam) { return cli.pfnRemoveEvent((MCONTACT)wParam, (HANDLE)lParam); }
+INT_PTR GetEventStub(WPARAM wParam, LPARAM lParam) { return (INT_PTR)cli.pfnGetEvent((MCONTACT)wParam, (int)lParam); }
int InitCListEvents(void)
{
diff --git a/src/modules/clist/clistmenus.cpp b/src/modules/clist/clistmenus.cpp
index 08c81d6a3d..1adf39e438 100644
--- a/src/modules/clist/clistmenus.cpp
+++ b/src/modules/clist/clistmenus.cpp
@@ -320,7 +320,7 @@ static INT_PTR AddContactMenuItem(WPARAM, LPARAM lParam)
static INT_PTR BuildContactMenu(WPARAM wParam, LPARAM)
{
- HCONTACT hContact = (HCONTACT)wParam;
+ MCONTACT hContact = (MCONTACT)wParam;
NotifyEventHooks(hPreBuildContactMenuEvent, (WPARAM)hContact, 0);
char *szProto = GetContactProto(hContact);
diff --git a/src/modules/clist/clistmod.cpp b/src/modules/clist/clistmod.cpp
index 5f2ae798be..28f011e93c 100644
--- a/src/modules/clist/clistmod.cpp
+++ b/src/modules/clist/clistmod.cpp
@@ -139,8 +139,8 @@ static int ProtocolAck(WPARAM, LPARAM lParam)
if ((int)ack->hProcess < ID_STATUS_ONLINE && ack->lParam >= ID_STATUS_ONLINE) {
DWORD caps = (DWORD)CallProtoServiceInt(NULL,ack->szModule, PS_GETCAPS, PFLAGNUM_1, 0);
if (caps & PF1_SERVERCLIST) {
- for (HCONTACT hContact = db_find_first(ack->szModule); hContact; ) {
- HCONTACT hNext = db_find_next(hContact, ack->szModule);
+ for (MCONTACT hContact = db_find_first(ack->szModule); hContact; ) {
+ MCONTACT hNext = db_find_next(hContact, ack->szModule);
if (db_get_b(hContact, "CList", "Delete", 0))
CallService(MS_DB_CONTACT_DELETE, (WPARAM)hContact, 0);
hContact = hNext;
@@ -152,12 +152,12 @@ static int ProtocolAck(WPARAM, LPARAM lParam)
return 0;
}
-HICON fnGetIconFromStatusMode(HCONTACT hContact, const char *szProto, int status)
+HICON fnGetIconFromStatusMode(MCONTACT hContact, const char *szProto, int status)
{
return ImageList_GetIcon(hCListImages, cli.pfnIconFromStatusMode(szProto, status, hContact), ILD_NORMAL);
}
-int fnIconFromStatusMode(const char *szProto, int status, HCONTACT)
+int fnIconFromStatusMode(const char *szProto, int status, MCONTACT)
{
int index, i;
@@ -176,7 +176,7 @@ int fnIconFromStatusMode(const char *szProto, int status, HCONTACT)
return 1;
}
-int fnGetContactIcon(HCONTACT hContact)
+int fnGetContactIcon(MCONTACT hContact)
{
char *szProto = GetContactProto(hContact);
return cli.pfnIconFromStatusMode(szProto,
@@ -185,7 +185,7 @@ int fnGetContactIcon(HCONTACT hContact)
static INT_PTR GetContactIcon(WPARAM wParam, LPARAM)
{
- return cli.pfnGetContactIcon((HCONTACT)wParam);
+ return cli.pfnGetContactIcon((MCONTACT)wParam);
}
static void AddProtoIconIndex(PROTOACCOUNT* pa)
@@ -245,7 +245,7 @@ static int ContactListAccountsChanged(WPARAM eventCode, LPARAM lParam)
static INT_PTR ContactDoubleClicked(WPARAM wParam, LPARAM)
{
// Try to process event myself
- if (cli.pfnEventsProcessContactDoubleClick((HCONTACT)wParam) == 0)
+ if (cli.pfnEventsProcessContactDoubleClick((MCONTACT)wParam) == 0)
return 0;
// Allow third-party plugins to process a dblclick
@@ -253,7 +253,7 @@ static INT_PTR ContactDoubleClicked(WPARAM wParam, LPARAM)
return 0;
// Otherwise try to execute the default action
- TryProcessDoubleClick((HCONTACT)wParam);
+ TryProcessDoubleClick((MCONTACT)wParam);
return 0;
}
@@ -425,7 +425,7 @@ extern int sortByStatus, sortByProto;
static INT_PTR CompareContacts(WPARAM wParam, LPARAM lParam)
{
- HCONTACT a = (HCONTACT)wParam, b = (HCONTACT)lParam;
+ MCONTACT a = (MCONTACT)wParam, b = (MCONTACT)lParam;
TCHAR namea[128], *nameb;
int statusa, statusb;
char *szProto1, *szProto2;
@@ -533,8 +533,8 @@ void UnloadContactListModule()
return;
//remove transitory contacts
- for (HCONTACT hContact = db_find_first(); hContact != NULL; ) {
- HCONTACT hNext = db_find_next(hContact);
+ for (MCONTACT hContact = db_find_first(); hContact != NULL; ) {
+ MCONTACT hNext = db_find_next(hContact);
if (db_get_b(hContact, "CList", "NotOnList", 0))
CallService(MS_DB_CONTACT_DELETE, (WPARAM) hContact, 0);
hContact = hNext;
diff --git a/src/modules/clist/clistsettings.cpp b/src/modules/clist/clistsettings.cpp
index 7e23fb67bc..90930e092a 100644
--- a/src/modules/clist/clistsettings.cpp
+++ b/src/modules/clist/clistsettings.cpp
@@ -54,7 +54,7 @@ void FreeDisplayNameCache(void)
// default handlers for the cache item creation and destruction
-ClcCacheEntry* fnCreateCacheItem(HCONTACT hContact)
+ClcCacheEntry* fnCreateCacheItem(MCONTACT hContact)
{
ClcCacheEntry* p = (ClcCacheEntry*)mir_calloc(sizeof(ClcCacheEntry));
if (p == NULL)
@@ -86,14 +86,14 @@ void fnFreeCacheItem(ClcCacheEntry *p)
p->bIsHidden = -1;
}
-ClcCacheEntry* fnGetCacheEntry(HCONTACT hContact)
+ClcCacheEntry* fnGetCacheEntry(MCONTACT hContact)
{
ClcCacheEntry *p;
int idx;
if (!List_GetIndex(clistCache, &hContact, &idx)) {
if ((p = cli.pfnCreateCacheItem(hContact)) != NULL) {
List_Insert(clistCache, p, idx);
- cli.pfnInvalidateDisplayNameCacheEntry((HCONTACT)p);
+ cli.pfnInvalidateDisplayNameCacheEntry((MCONTACT)p);
}
}
else p = (ClcCacheEntry*)clistCache->items[idx];
@@ -102,9 +102,9 @@ ClcCacheEntry* fnGetCacheEntry(HCONTACT hContact)
return p;
}
-void fnInvalidateDisplayNameCacheEntry(HCONTACT hContact)
+void fnInvalidateDisplayNameCacheEntry(MCONTACT hContact)
{
- if (hContact == (HCONTACT)INVALID_HANDLE_VALUE) {
+ if (hContact == INVALID_CONTACT_ID) {
FreeDisplayNameCache();
InitDisplayNameCache();
SendMessage(cli.hwndContactTree, CLM_AUTOREBUILD, 0, 0);
@@ -116,7 +116,7 @@ void fnInvalidateDisplayNameCacheEntry(HCONTACT hContact)
}
}
-TCHAR* fnGetContactDisplayName(HCONTACT hContact, int mode)
+TCHAR* fnGetContactDisplayName(MCONTACT hContact, int mode)
{
ClcCacheEntry *cacheEntry = NULL;
@@ -160,7 +160,7 @@ INT_PTR GetContactDisplayName(WPARAM wParam, LPARAM lParam)
{
static char retVal[200];
ClcCacheEntry *cacheEntry = NULL;
- HCONTACT hContact = (HCONTACT)wParam;
+ MCONTACT hContact = (MCONTACT)wParam;
if (lParam & GCDNF_UNICODE)
return (INT_PTR)cli.pfnGetContactDisplayName(hContact, lParam & ~GCDNF_UNICODE);
@@ -209,13 +209,13 @@ INT_PTR GetContactDisplayName(WPARAM wParam, LPARAM lParam)
INT_PTR InvalidateDisplayName(WPARAM wParam, LPARAM)
{
- cli.pfnInvalidateDisplayNameCacheEntry((HCONTACT)wParam);
+ cli.pfnInvalidateDisplayNameCacheEntry((MCONTACT)wParam);
return 0;
}
int ContactAdded(WPARAM wParam, LPARAM)
{
- cli.pfnChangeContactIcon((HCONTACT)wParam, cli.pfnIconFromStatusMode(GetContactProto((HCONTACT)wParam), ID_STATUS_OFFLINE, NULL), 1);
+ cli.pfnChangeContactIcon((MCONTACT)wParam, cli.pfnIconFromStatusMode(GetContactProto((MCONTACT)wParam), ID_STATUS_OFFLINE, NULL), 1);
cli.pfnSortContacts();
return 0;
}
@@ -230,7 +230,7 @@ int ContactSettingChanged(WPARAM wParam, LPARAM lParam)
{
DBCONTACTWRITESETTING *cws = (DBCONTACTWRITESETTING *) lParam;
DBVARIANT dbv;
- HCONTACT hContact = (HCONTACT)wParam;
+ MCONTACT hContact = (MCONTACT)wParam;
// Early exit
if (hContact == NULL)
@@ -270,7 +270,7 @@ int ContactSettingChanged(WPARAM wParam, LPARAM lParam)
if (!strcmp(cws->szModule, "CList")) {
if (!strcmp(cws->szSetting, "Hidden")) {
if (cws->value.type == DBVT_DELETED || cws->value.bVal == 0) {
- char *szProto = GetContactProto((HCONTACT)wParam);
+ char *szProto = GetContactProto((MCONTACT)wParam);
cli.pfnChangeContactIcon(hContact, cli.pfnIconFromStatusMode(szProto, szProto == NULL ? ID_STATUS_OFFLINE : db_get_w(hContact, szProto, "Status", ID_STATUS_OFFLINE), hContact), 1);
}
else
diff --git a/src/modules/clist/clui.cpp b/src/modules/clist/clui.cpp
index 4683169736..a5d760cfad 100644
--- a/src/modules/clist/clui.cpp
+++ b/src/modules/clist/clui.cpp
@@ -134,7 +134,7 @@ static INT_PTR CALLBACK AskForConfirmationDlgProc(HWND hWnd, UINT msg, WPARAM wP
TCHAR szFinal[256];
GetDlgItemText(hWnd, IDC_TOPLINE, szFormat, SIZEOF(szFormat));
- mir_sntprintf(szFinal, SIZEOF(szFinal), szFormat, cli.pfnGetContactDisplayName((HCONTACT)lParam, 0));
+ mir_sntprintf(szFinal, SIZEOF(szFinal), szFormat, cli.pfnGetContactDisplayName((MCONTACT)lParam, 0));
SetDlgItemText(hWnd, IDC_TOPLINE, szFinal);
}
SetFocus( GetDlgItem(hWnd, IDNO));
@@ -185,7 +185,7 @@ static INT_PTR MenuItem_DeleteContact(WPARAM wParam, LPARAM lParam)
// Delete contact
case IDYES:
{
- char *szProto = GetContactProto((HCONTACT)wParam);
+ char *szProto = GetContactProto((MCONTACT)wParam);
if (szProto != NULL) {
// Check if protocol uses server side lists
DWORD caps;
@@ -197,7 +197,7 @@ static INT_PTR MenuItem_DeleteContact(WPARAM wParam, LPARAM lParam)
status = CallProtoServiceInt(NULL,szProto, PS_GETSTATUS, 0, 0);
if (status == ID_STATUS_OFFLINE || (status >= ID_STATUS_CONNECTING && status < ID_STATUS_CONNECTING + MAX_CONNECT_RETRIES)) {
// Set a flag so we remember to delete the contact when the protocol goes online the next time
- db_set_b((HCONTACT)wParam, "CList", "Delete", 1);
+ db_set_b((MCONTACT)wParam, "CList", "Delete", 1);
MessageBox(NULL,
TranslateT("This contact is on an instant messaging system which stores its contact list on a central server. The contact will be removed from the server and from your contact list when you next connect to that network."),
TranslateT("Delete contact"), MB_ICONINFORMATION | MB_OK);
@@ -212,7 +212,7 @@ static INT_PTR MenuItem_DeleteContact(WPARAM wParam, LPARAM lParam)
// Archive contact
case IDC_HIDE:
- db_set_b((HCONTACT)wParam, "CList", "Hidden", 1);
+ db_set_b((MCONTACT)wParam, "CList", "Hidden", 1);
break;
}
@@ -222,7 +222,7 @@ static INT_PTR MenuItem_DeleteContact(WPARAM wParam, LPARAM lParam)
static INT_PTR MenuItem_AddContactToList(WPARAM wParam, LPARAM)
{
ADDCONTACTSTRUCT acs = { 0 };
- acs.hContact = (HCONTACT)wParam;
+ acs.hContact = (MCONTACT)wParam;
acs.handleType = HANDLE_CONTACT;
acs.szProto = "";
CallService(MS_ADDCONTACT_SHOW, NULL, (LPARAM)&acs);
@@ -813,7 +813,7 @@ LRESULT CALLBACK fnContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM
case CLN_NEWCONTACT:
if (nmc != NULL)
- cli.pfnSetAllExtraIcons((HCONTACT)nmc->hItem);
+ cli.pfnSetAllExtraIcons((MCONTACT)nmc->hItem);
return TRUE;
case CLN_LISTREBUILT:
@@ -867,7 +867,7 @@ LRESULT CALLBACK fnContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM
if (hItem) {
if (hitFlags & CLCHT_ONITEMEXTRA) {
if (!IsHContactGroup(hItem) && !IsHContactInfo(hItem))
- if (cli.pfnGetCacheEntry((HCONTACT)nmc->hItem))
+ if (cli.pfnGetCacheEntry((MCONTACT)nmc->hItem))
NotifyEventHooks(hEventExtraClick, (WPARAM)nmc->hItem, nmc->iColumn+1);
}
break;
diff --git a/src/modules/clist/contact.cpp b/src/modules/clist/contact.cpp
index 92f7f5deda..be856535aa 100644
--- a/src/modules/clist/contact.cpp
+++ b/src/modules/clist/contact.cpp
@@ -45,7 +45,7 @@ static const struct {
{ID_STATUS_ONTHEPHONE, 150},
{ID_STATUS_OUTTOLUNCH, 425}};
-static int GetContactStatus(HCONTACT hContact)
+static int GetContactStatus(MCONTACT hContact)
{
char *szProto = GetContactProto(hContact);
if (szProto == NULL)
@@ -53,7 +53,7 @@ static int GetContactStatus(HCONTACT hContact)
return db_get_w(hContact, szProto, "Status", ID_STATUS_OFFLINE);
}
-void fnChangeContactIcon(HCONTACT hContact, int iIcon, int add)
+void fnChangeContactIcon(MCONTACT hContact, int iIcon, int add)
{
CallService(add ? MS_CLUI_CONTACTADDED : MS_CLUI_CONTACTSETICON, (WPARAM) hContact, iIcon);
NotifyEventHooks(hContactIconChangedEvent, (WPARAM) hContact, iIcon);
@@ -78,7 +78,7 @@ void fnLoadContactTree(void)
}
int hideOffline = db_get_b(NULL, "CList", "HideOffline", SETTING_HIDEOFFLINE_DEFAULT);
- for (HCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
+ for (MCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
int status = GetContactStatus(hContact);
if ((!hideOffline || status != ID_STATUS_OFFLINE) && !db_get_b(hContact, "CList", "Hidden", 0))
cli.pfnChangeContactIcon(hContact, cli.pfnIconFromStatusMode(GetContactProto(hContact), status, hContact), 1);
@@ -90,7 +90,7 @@ void fnLoadContactTree(void)
int fnCompareContacts(const ClcContact* c1, const ClcContact* c2)
{
- HCONTACT a = c1->hContact, b = c2->hContact;
+ MCONTACT a = c1->hContact, b = c2->hContact;
TCHAR namea[128], *nameb;
int statusa, statusb;
int rc;
@@ -144,13 +144,13 @@ INT_PTR ContactChangeGroup(WPARAM wParam, LPARAM lParam)
CallService(MS_CLUI_CONTACTDELETED, wParam, 0);
if ((HANDLE) lParam == NULL)
- db_unset((HCONTACT)wParam, "CList", "Group");
+ db_unset((MCONTACT)wParam, "CList", "Group");
else {
grpChg.pszNewName = cli.pfnGetGroupName(lParam, NULL);
- db_set_ts((HCONTACT)wParam, "CList", "Group", grpChg.pszNewName);
+ db_set_ts((MCONTACT)wParam, "CList", "Group", grpChg.pszNewName);
}
CallService(MS_CLUI_CONTACTADDED, wParam,
- cli.pfnIconFromStatusMode(GetContactProto((HCONTACT)wParam), GetContactStatus((HCONTACT)wParam), (HCONTACT)wParam));
+ cli.pfnIconFromStatusMode(GetContactProto((MCONTACT)wParam), GetContactStatus((MCONTACT)wParam), (MCONTACT)wParam));
NotifyEventHooks(hGroupChangeEvent, wParam, (LPARAM)&grpChg);
return 0;
diff --git a/src/modules/clist/genmenu.cpp b/src/modules/clist/genmenu.cpp
index c453635fce..ad3657ab55 100644
--- a/src/modules/clist/genmenu.cpp
+++ b/src/modules/clist/genmenu.cpp
@@ -1096,7 +1096,7 @@ int RegisterAllIconsInIconLib()
return 0;
}
-int TryProcessDoubleClick(HCONTACT hContact)
+int TryProcessDoubleClick(MCONTACT hContact)
{
int iMenuID = GetMenuObjbyId((int)hContactMenuObject);
if (iMenuID != -1) {
diff --git a/src/modules/clist/groups.cpp b/src/modules/clist/groups.cpp
index 123ee33692..3799770865 100644
--- a/src/modules/clist/groups.cpp
+++ b/src/modules/clist/groups.cpp
@@ -178,7 +178,7 @@ static INT_PTR DeleteGroup(WPARAM wParam, LPARAM)
int i;
char str[33];
DBVARIANT dbv;
- HCONTACT hContact;
+ MCONTACT hContact;
TCHAR name[256], szNewParent[256], *pszLastBackslash;
//get the name
@@ -292,7 +292,7 @@ static int RenameGroupWithMove(int groupId, const TCHAR *szName, int move)
db_set_ts(NULL, "CListGroups", idstr, str);
//must rename setting in all child contacts too
- for (HCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
+ for (MCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
ClcCacheEntry *cache = cli.pfnGetCacheEntry(hContact);
if (!lstrcmp(cache->tszGroup, oldName)) {
db_set_ts(hContact, "CList", "Group", szName);
diff --git a/src/modules/clist/movetogroup.cpp b/src/modules/clist/movetogroup.cpp
index 3c3dc12ef2..3193dc6a20 100644
--- a/src/modules/clist/movetogroup.cpp
+++ b/src/modules/clist/movetogroup.cpp
@@ -101,7 +101,7 @@ static int OnContactMenuBuild(WPARAM wParam, LPARAM)
CallService(MS_CLIST_REMOVECONTACTMENUITEM, (WPARAM)lphGroupsItems[i], 0);
lphGroupsItems.destroy();
- ptrT szContactGroup(db_get_tsa((HCONTACT)wParam, "CList", "Group"));
+ ptrT szContactGroup(db_get_tsa((MCONTACT)wParam, "CList", "Group"));
int pos = 1000;
diff --git a/src/modules/database/dbintf.cpp b/src/modules/database/dbintf.cpp
index c07ab7502f..46719debed 100644
--- a/src/modules/database/dbintf.cpp
+++ b/src/modules/database/dbintf.cpp
@@ -48,7 +48,7 @@ static INT_PTR srvGetContactCount(WPARAM, LPARAM)
static INT_PTR srvDeleteContact(WPARAM wParam, LPARAM)
{
DBVARIANT dbv = {0};
- if (!db_get_ts((HCONTACT)wParam, "ContactPhoto", "File", &dbv)) {
+ if (!db_get_ts((MCONTACT)wParam, "ContactPhoto", "File", &dbv)) {
DeleteFile(dbv.ptszVal);
db_free(&dbv);
}
diff --git a/src/modules/database/dbutils.cpp b/src/modules/database/dbutils.cpp
index 045967ed1d..6f9bb2a9c8 100644
--- a/src/modules/database/dbutils.cpp
+++ b/src/modules/database/dbutils.cpp
@@ -112,7 +112,7 @@ static INT_PTR DbEventGetText(WPARAM wParam, LPARAM lParam)
// EVENTTYPE_AUTHREQUEST: uin(DWORD), hContact(DWORD), nick(ASCIIZ), first(ASCIIZ), last(ASCIIZ), email(ASCIIZ)
// EVENTTYPE_ADDED: uin(DWORD), hContact(HANDLE), nick(ASCIIZ), first(ASCIIZ), last(ASCIIZ), email(ASCIIZ)
DWORD uin = *(DWORD*)dbei->pBlob;
- HCONTACT hContact = (HCONTACT)*(DWORD*)(dbei->pBlob + sizeof(DWORD));
+ MCONTACT hContact = (MCONTACT)*(DWORD*)(dbei->pBlob + sizeof(DWORD));
char *buf = LPSTR(dbei->pBlob) + sizeof(DWORD)*2;
ptrT tszNick(getEventString(dbei, buf));
ptrT tszFirst(getEventString(dbei, buf));
diff --git a/src/modules/extraicons/BaseExtraIcon.cpp b/src/modules/extraicons/BaseExtraIcon.cpp
index e60276bad4..56631313e3 100644
--- a/src/modules/extraicons/BaseExtraIcon.cpp
+++ b/src/modules/extraicons/BaseExtraIcon.cpp
@@ -65,13 +65,13 @@ void BaseExtraIcon::setDescIcon(const char *icon)
szDescIcon = mir_strdup(icon);
}
-void BaseExtraIcon::onClick(HCONTACT hContact)
+void BaseExtraIcon::onClick(MCONTACT hContact)
{
if (OnClick != NULL)
OnClick((WPARAM)hContact, (LPARAM)ConvertToClistSlot(slot), onClickParam);
}
-int BaseExtraIcon::ClistSetExtraIcon(HCONTACT hContact, HANDLE hImage)
+int BaseExtraIcon::ClistSetExtraIcon(MCONTACT hContact, HANDLE hImage)
{
ExtraIcon *tmp = extraIconsByHandle[id - 1];
if (tmp != this)
diff --git a/src/modules/extraicons/CallbackExtraIcon.cpp b/src/modules/extraicons/CallbackExtraIcon.cpp
index 6c83193971..73badf0fc9 100644
--- a/src/modules/extraicons/CallbackExtraIcon.cpp
+++ b/src/modules/extraicons/CallbackExtraIcon.cpp
@@ -50,7 +50,7 @@ void CallbackExtraIcon::rebuildIcons()
RebuildIcons(0, 0);
}
-void CallbackExtraIcon::applyIcon(HCONTACT hContact)
+void CallbackExtraIcon::applyIcon(MCONTACT hContact)
{
if (!isEnabled() || hContact == NULL)
return;
@@ -61,7 +61,7 @@ void CallbackExtraIcon::applyIcon(HCONTACT hContact)
ApplyIcon((WPARAM)hContact, 0);
}
-int CallbackExtraIcon::setIcon(int id, HCONTACT hContact, HANDLE icon)
+int CallbackExtraIcon::setIcon(int id, MCONTACT hContact, HANDLE icon)
{
if (!isEnabled() || hContact == NULL || id != this->id)
return -1;
@@ -69,7 +69,7 @@ int CallbackExtraIcon::setIcon(int id, HCONTACT hContact, HANDLE icon)
return ClistSetExtraIcon(hContact, icon);
}
-int CallbackExtraIcon::setIconByName(int id, HCONTACT hContact, const char *icon)
+int CallbackExtraIcon::setIconByName(int id, MCONTACT hContact, const char *icon)
{
return -1;
}
diff --git a/src/modules/extraicons/DefaultExtraIcons.cpp b/src/modules/extraicons/DefaultExtraIcons.cpp
index fe75c5b1a8..7b03c16c96 100644
--- a/src/modules/extraicons/DefaultExtraIcons.cpp
+++ b/src/modules/extraicons/DefaultExtraIcons.cpp
@@ -33,7 +33,7 @@ ExtraIcon* GetExtraIcon(HANDLE id);
HANDLE hExtraVisibility, hExtraChat, hExtraGender, hExtraProto;
-static void SetVisibility(HCONTACT hContact, int apparentMode, bool clear)
+static void SetVisibility(MCONTACT hContact, int apparentMode, bool clear)
{
if (hContact == NULL)
return;
@@ -69,7 +69,7 @@ static void SetVisibility(HCONTACT hContact, int apparentMode, bool clear)
}
}
-static void SetGender(HCONTACT hContact, int gender, bool clear)
+static void SetGender(MCONTACT hContact, int gender, bool clear)
{
if (hContact == NULL)
return;
@@ -134,7 +134,7 @@ static Info infos[] =
&EmailOnClick },
};
-static void SetExtraIcons(HCONTACT hContact)
+static void SetExtraIcons(MCONTACT hContact)
{
if (hContact == NULL)
return;
@@ -161,7 +161,7 @@ static void SetExtraIcons(HCONTACT hContact)
static int SettingChanged(WPARAM wParam, LPARAM lParam)
{
- HCONTACT hContact = (HCONTACT)wParam;
+ MCONTACT hContact = (MCONTACT)wParam;
if (hContact == NULL)
return 0;
@@ -209,7 +209,7 @@ static int DefaultOnClick(WPARAM wParam, LPARAM lParam, LPARAM param)
if (p == NULL)
return 0;
- HCONTACT hContact = (HCONTACT)wParam;
+ MCONTACT hContact = (MCONTACT)wParam;
if (hContact == NULL)
return 0;
@@ -279,7 +279,7 @@ static ProtoInfo* FindProto(const char *proto)
static int ProtocolApplyIcon(WPARAM wParam, LPARAM lParam)
{
- HCONTACT hContact = (HCONTACT)wParam;
+ MCONTACT hContact = (MCONTACT)wParam;
char *proto = GetContactProto(hContact);
if (IsEmpty(proto))
return 0;
@@ -319,7 +319,7 @@ void DefaultExtraIcons_Load()
p.hExtraIcon = ExtraIcon_Register(p.name, p.desc, LoadSkinnedIconName(p.iSkinIcon));
}
- for (HCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
+ for (MCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
SetExtraIcons(hContact);
SetVisibility(hContact, -1, false);
SetGender(hContact, -1, false);
diff --git a/src/modules/extraicons/ExtraIcon.cpp b/src/modules/extraicons/ExtraIcon.cpp
index 0da9413ef8..c35cec4ca8 100644
--- a/src/modules/extraicons/ExtraIcon.cpp
+++ b/src/modules/extraicons/ExtraIcon.cpp
@@ -67,7 +67,7 @@ void ExtraIcon::applyIcons()
if (!isEnabled())
return;
- for (HCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
+ for (MCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
// Clear to assert that it will be cleared
Clist_SetExtraIcon(hContact, slot, INVALID_HANDLE_VALUE);
applyIcon(hContact);
diff --git a/src/modules/extraicons/ExtraIcon.h b/src/modules/extraicons/ExtraIcon.h
index de259cbd9c..6a3f4a79f2 100644
--- a/src/modules/extraicons/ExtraIcon.h
+++ b/src/modules/extraicons/ExtraIcon.h
@@ -35,12 +35,12 @@ public:
virtual void rebuildIcons() = 0;
virtual void applyIcons();
- virtual void applyIcon(HCONTACT hContact) =0 ;
- virtual void onClick(HCONTACT hContact) = 0;
+ virtual void applyIcon(MCONTACT hContact) =0 ;
+ virtual void onClick(MCONTACT hContact) = 0;
- virtual int setIcon(int id, HCONTACT hContact, HANDLE icon) = 0;
- virtual int setIconByName(int id, HCONTACT hContact, const char* icon) = 0;
- virtual void storeIcon(HCONTACT hContact, void *icon) {};
+ virtual int setIcon(int id, MCONTACT hContact, HANDLE icon) = 0;
+ virtual int setIconByName(int id, MCONTACT hContact, const char* icon) = 0;
+ virtual void storeIcon(MCONTACT hContact, void *icon) {};
virtual const char *getName() const;
virtual const TCHAR *getDescription() const = 0;
@@ -55,7 +55,7 @@ public:
virtual bool isEnabled() const;
- virtual int ClistSetExtraIcon(HCONTACT hContact, HANDLE hImage) = 0;
+ virtual int ClistSetExtraIcon(MCONTACT hContact, HANDLE hImage) = 0;
int hLangpack;
@@ -82,10 +82,10 @@ public:
virtual void setDescIcon(const char *icon);
virtual int getType() const =0;
- virtual void onClick(HCONTACT hContact);
+ virtual void onClick(MCONTACT hContact);
virtual void setOnClick(MIRANDAHOOKPARAM OnClick, LPARAM param);
- virtual int ClistSetExtraIcon(HCONTACT hContact, HANDLE hImage);
+ virtual int ClistSetExtraIcon(MCONTACT hContact, HANDLE hImage);
protected:
int id;
@@ -108,10 +108,10 @@ public:
virtual int getType() const;
virtual void rebuildIcons();
- virtual void applyIcon(HCONTACT hContact);
+ virtual void applyIcon(MCONTACT hContact);
- virtual int setIcon(int id, HCONTACT hContact, HANDLE icon);
- virtual int setIconByName(int id, HCONTACT hContact, const char* icon);
+ virtual int setIcon(int id, MCONTACT hContact, HANDLE icon);
+ virtual int setIconByName(int id, MCONTACT hContact, const char* icon);
private:
int(*RebuildIcons)(WPARAM wParam, LPARAM lParam);
@@ -132,11 +132,11 @@ public:
virtual int getType() const;
virtual void rebuildIcons();
- virtual void applyIcon(HCONTACT hContact);
+ virtual void applyIcon(MCONTACT hContact);
- virtual int setIcon(int id, HCONTACT hContact, HANDLE icon);
- virtual int setIconByName(int id, HCONTACT hContact, const char* icon);
- virtual void storeIcon(HCONTACT hContact, void *icon);
+ virtual int setIcon(int id, MCONTACT hContact, HANDLE icon);
+ virtual int setIconByName(int id, MCONTACT hContact, const char* icon);
+ virtual void storeIcon(MCONTACT hContact, void *icon);
};
/////////////////////////////////////////////////////////////////////////////////////////
@@ -144,7 +144,7 @@ public:
class ExtraIconGroup : public ExtraIcon
{
- int internalSetIcon(int id, HCONTACT hContact, HANDLE icon, bool bByName);
+ int internalSetIcon(int id, MCONTACT hContact, HANDLE icon, bool bByName);
public:
ExtraIconGroup(const char *name);
virtual ~ExtraIconGroup();
@@ -152,11 +152,11 @@ public:
virtual void addExtraIcon(BaseExtraIcon *extra);
virtual void rebuildIcons();
- virtual void applyIcon(HCONTACT hContact);
- virtual void onClick(HCONTACT hContact);
+ virtual void applyIcon(MCONTACT hContact);
+ virtual void onClick(MCONTACT hContact);
- virtual int setIcon(int id, HCONTACT hContact, HANDLE icon);
- virtual int setIconByName(int id, HCONTACT hContact, const char *icon);
+ virtual int setIcon(int id, MCONTACT hContact, HANDLE icon);
+ virtual int setIconByName(int id, MCONTACT hContact, const char *icon);
virtual const TCHAR* getDescription() const;
virtual const char* getDescIcon() const;
@@ -167,14 +167,14 @@ public:
LIST<BaseExtraIcon> items;
- virtual int ClistSetExtraIcon(HCONTACT hContact, HANDLE hImage);
+ virtual int ClistSetExtraIcon(MCONTACT hContact, HANDLE hImage);
protected:
ptrT tszDescription;
bool setValidExtraIcon;
bool insideApply;
- virtual ExtraIcon *getCurrentItem(HCONTACT hContact) const;
+ virtual ExtraIcon *getCurrentItem(MCONTACT hContact) const;
};
#endif // __EXTRAICON_H__
diff --git a/src/modules/extraicons/ExtraIconGroup.cpp b/src/modules/extraicons/ExtraIconGroup.cpp
index 9df088c1c8..1cc7d43c18 100644
--- a/src/modules/extraicons/ExtraIconGroup.cpp
+++ b/src/modules/extraicons/ExtraIconGroup.cpp
@@ -54,7 +54,7 @@ void ExtraIconGroup::rebuildIcons()
items[i]->rebuildIcons();
}
-void ExtraIconGroup::applyIcon(HCONTACT hContact)
+void ExtraIconGroup::applyIcon(MCONTACT hContact)
{
if (!isEnabled() || hContact == NULL)
return;
@@ -91,7 +91,7 @@ void ExtraIconGroup::setSlot(int slot)
items[i]->setSlot(slot);
}
-ExtraIcon * ExtraIconGroup::getCurrentItem(HCONTACT hContact) const
+ExtraIcon * ExtraIconGroup::getCurrentItem(MCONTACT hContact) const
{
int id = (int)db_get_dw(hContact, MODULE_NAME, szName, 0);
if (id < 1)
@@ -104,24 +104,24 @@ ExtraIcon * ExtraIconGroup::getCurrentItem(HCONTACT hContact) const
return NULL;
}
-void ExtraIconGroup::onClick(HCONTACT hContact)
+void ExtraIconGroup::onClick(MCONTACT hContact)
{
ExtraIcon *extra = getCurrentItem(hContact);
if (extra != NULL)
extra->onClick(hContact);
}
-int ExtraIconGroup::setIcon(int id, HCONTACT hContact, HANDLE value)
+int ExtraIconGroup::setIcon(int id, MCONTACT hContact, HANDLE value)
{
return internalSetIcon(id, hContact, (void*)value, false);
}
-int ExtraIconGroup::setIconByName(int id, HCONTACT hContact, const char *value)
+int ExtraIconGroup::setIconByName(int id, MCONTACT hContact, const char *value)
{
return internalSetIcon(id, hContact, (void*)value, true);
}
-int ExtraIconGroup::internalSetIcon(int id, HCONTACT hContact, void *value, bool bByName)
+int ExtraIconGroup::internalSetIcon(int id, MCONTACT hContact, void *value, bool bByName)
{
if (insideApply) {
for (int i=0; i < items.getCount(); i++)
@@ -208,7 +208,7 @@ int ExtraIconGroup::getType() const
return EXTRAICON_TYPE_GROUP;
}
-int ExtraIconGroup::ClistSetExtraIcon(HCONTACT hContact, HANDLE hImage)
+int ExtraIconGroup::ClistSetExtraIcon(MCONTACT hContact, HANDLE hImage)
{
if (hImage != INVALID_HANDLE_VALUE)
setValidExtraIcon = true;
diff --git a/src/modules/extraicons/IcolibExtraIcon.cpp b/src/modules/extraicons/IcolibExtraIcon.cpp
index acf38d3ead..3013ae087b 100644
--- a/src/modules/extraicons/IcolibExtraIcon.cpp
+++ b/src/modules/extraicons/IcolibExtraIcon.cpp
@@ -46,7 +46,7 @@ void IcolibExtraIcon::rebuildIcons()
{
}
-void IcolibExtraIcon::applyIcon(HCONTACT hContact)
+void IcolibExtraIcon::applyIcon(MCONTACT hContact)
{
if (!isEnabled() || hContact == NULL)
return;
@@ -60,7 +60,7 @@ void IcolibExtraIcon::applyIcon(HCONTACT hContact)
ClistSetExtraIcon(hContact, hImage);
}
-int IcolibExtraIcon::setIcon(int id, HCONTACT hContact, HANDLE hIcoLib)
+int IcolibExtraIcon::setIcon(int id, MCONTACT hContact, HANDLE hIcoLib)
{
if (hContact == NULL || id != this->id)
return -1;
@@ -84,7 +84,7 @@ int IcolibExtraIcon::setIcon(int id, HCONTACT hContact, HANDLE hIcoLib)
return 0;
}
-int IcolibExtraIcon::setIconByName(int id, HCONTACT hContact, const char *icon)
+int IcolibExtraIcon::setIconByName(int id, MCONTACT hContact, const char *icon)
{
if (hContact == NULL || id != this->id)
return -1;
@@ -106,7 +106,7 @@ int IcolibExtraIcon::setIconByName(int id, HCONTACT hContact, const char *icon)
return 0;
}
-void IcolibExtraIcon::storeIcon(HCONTACT hContact, void *icon)
+void IcolibExtraIcon::storeIcon(MCONTACT hContact, void *icon)
{
if (hContact == NULL)
return;
diff --git a/src/modules/extraicons/extraicons.cpp b/src/modules/extraicons/extraicons.cpp
index a85fb18a28..8cb0acadac 100644
--- a/src/modules/extraicons/extraicons.cpp
+++ b/src/modules/extraicons/extraicons.cpp
@@ -82,7 +82,7 @@ int ExtraImage_ExtraIDToColumnNum(int extra)
return (extra < 1 || extra > EXTRA_ICON_COUNT) ? -1 : extra-1;
}
-int Clist_SetExtraIcon(HCONTACT hContact, int slot, HANDLE hImage)
+int Clist_SetExtraIcon(MCONTACT hContact, int slot, HANDLE hImage)
{
if (cli.hwndContactTree == 0)
return -1;
@@ -248,7 +248,7 @@ int ClistExtraListRebuild(WPARAM wParam, LPARAM lParam)
int ClistExtraImageApply(WPARAM wParam, LPARAM lParam)
{
- HCONTACT hContact = (HCONTACT)wParam;
+ MCONTACT hContact = (MCONTACT)wParam;
if (hContact == NULL)
return 0;
@@ -262,7 +262,7 @@ int ClistExtraImageApply(WPARAM wParam, LPARAM lParam)
int ClistExtraClick(WPARAM wParam, LPARAM lParam)
{
- HCONTACT hContact = (HCONTACT)wParam;
+ MCONTACT hContact = (MCONTACT)wParam;
if (hContact == NULL)
return 0;
@@ -313,7 +313,7 @@ void fnReloadExtraIcons()
bImageCreated = true;
}
-void fnSetAllExtraIcons(HCONTACT hContact)
+void fnSetAllExtraIcons(MCONTACT hContact)
{
if (cli.hwndContactTree == 0)
return;
diff --git a/src/modules/extraicons/extraicons.h b/src/modules/extraicons/extraicons.h
index cedddefb0c..2b34ecbbd9 100644
--- a/src/modules/extraicons/extraicons.h
+++ b/src/modules/extraicons/extraicons.h
@@ -41,14 +41,14 @@ ExtraIcon * GetExtraIconBySlot(int slot);
int GetNumberOfSlots();
int ConvertToClistSlot(int slot);
-int Clist_SetExtraIcon(HCONTACT hContact, int slot, HANDLE hImage);
+int Clist_SetExtraIcon(MCONTACT hContact, int slot, HANDLE hImage);
void DefaultExtraIcons_Load();
HANDLE ExtraIcon_Add(HICON hIcon);
void fnReloadExtraIcons();
-void fnSetAllExtraIcons(HCONTACT hContact);
+void fnSetAllExtraIcons(MCONTACT hContact);
static inline BOOL IsEmpty(const char *str)
{
diff --git a/src/modules/extraicons/options_ei.cpp b/src/modules/extraicons/options_ei.cpp
index 19117a0de8..3300e279ac 100644
--- a/src/modules/extraicons/options_ei.cpp
+++ b/src/modules/extraicons/options_ei.cpp
@@ -70,7 +70,7 @@ BOOL ScreenToClient(HWND hWnd, LPRECT lpRect)
static void RemoveExtraIcons(int slot)
{
- for (HCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact))
+ for (MCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact))
Clist_SetExtraIcon(hContact, slot, INVALID_HANDLE_VALUE);
}
diff --git a/src/modules/findadd/searchresults.cpp b/src/modules/findadd/searchresults.cpp
index 726ce32bcd..ed608a13e9 100644
--- a/src/modules/findadd/searchresults.cpp
+++ b/src/modules/findadd/searchresults.cpp
@@ -377,13 +377,13 @@ void ShowMoreOptionsMenu(HWND hwndDlg, int x, int y)
}
case IDC_DETAILS:
{
- HCONTACT hContact = (HCONTACT)CallProtoServiceInt(NULL, lsr->szProto, PS_ADDTOLIST, PALF_TEMPORARY, (LPARAM)&lsr->psr);
+ MCONTACT hContact = (MCONTACT)CallProtoServiceInt(NULL, lsr->szProto, PS_ADDTOLIST, PALF_TEMPORARY, (LPARAM)&lsr->psr);
CallService(MS_USERINFO_SHOWDIALOG, (WPARAM)hContact, 0);
break;
}
case IDC_SENDMESSAGE:
{
- HCONTACT hContact = (HCONTACT)CallProtoServiceInt(NULL, lsr->szProto, PS_ADDTOLIST, PALF_TEMPORARY, (LPARAM)&lsr->psr);
+ MCONTACT hContact = (MCONTACT)CallProtoServiceInt(NULL, lsr->szProto, PS_ADDTOLIST, PALF_TEMPORARY, (LPARAM)&lsr->psr);
CallService(MS_MSG_SENDMESSAGE, (WPARAM)hContact, (LPARAM)(const char*)NULL);
break;
}
diff --git a/src/modules/ignore/ignore.cpp b/src/modules/ignore/ignore.cpp
index 74683b5c18..f50384ae6a 100644
--- a/src/modules/ignore/ignore.cpp
+++ b/src/modules/ignore/ignore.cpp
@@ -29,7 +29,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
static const DWORD ignoreIdToPf1[IGNOREEVENT_MAX] = {PF1_IMRECV, PF1_URLRECV, PF1_FILERECV, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF};
static const DWORD ignoreIdToPf4[IGNOREEVENT_MAX] = {0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, PF4_SUPPORTTYPING};
-static DWORD GetMask(HCONTACT hContact)
+static DWORD GetMask(MCONTACT hContact)
{
DWORD mask = db_get_dw(hContact, "Ignore", "Mask1", (DWORD)(-1));
if (mask == (DWORD)(-1)) {
@@ -145,7 +145,7 @@ static void SetIconsForColumn(HWND hwndList, HANDLE hItem, HANDLE hItemAll, int
}
}
-static void InitialiseItem(HWND hwndList, HCONTACT hContact, HANDLE hItem, DWORD proto1Caps, DWORD proto4Caps)
+static void InitialiseItem(HWND hwndList, MCONTACT hContact, HANDLE hItem, DWORD proto1Caps, DWORD proto4Caps)
{
DWORD mask = GetMask(hContact);
for (int i=0; i < IGNOREEVENT_MAX; i++)
@@ -156,7 +156,7 @@ static void InitialiseItem(HWND hwndList, HCONTACT hContact, HANDLE hItem, DWORD
SendMessage(hwndList, CLM_SETEXTRAIMAGE, (WPARAM)hItem, MAKELPARAM(IGNOREEVENT_MAX+1, 2));
}
-static void SaveItemMask(HWND hwndList, HCONTACT hContact, HANDLE hItem, const char *pszSetting)
+static void SaveItemMask(HWND hwndList, MCONTACT hContact, HANDLE hItem, const char *pszSetting)
{
DWORD mask = 0;
for (int i=0; i < IGNOREEVENT_MAX; i++) {
@@ -169,7 +169,7 @@ static void SaveItemMask(HWND hwndList, HCONTACT hContact, HANDLE hItem, const c
static void SetAllContactIcons(HWND hwndList)
{
- for (HCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
+ for (MCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
HANDLE hItem = (HANDLE)SendMessage(hwndList, CLM_FINDCONTACT, (WPARAM)hContact, 0);
if (hItem && SendMessage(hwndList, CLM_GETEXTRAIMAGE, (WPARAM)hItem, MAKELPARAM(IGNOREEVENT_MAX, 0)) == EMPTY_EXTRA_ICON) {
DWORD proto1Caps, proto4Caps;
@@ -296,7 +296,7 @@ static INT_PTR CALLBACK DlgProcIgnoreOpts(HWND hwndDlg, UINT msg, WPARAM, LPARAM
case 0:
switch (((LPNMHDR)lParam)->code) {
case PSN_APPLY:
- for (HCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
+ for (MCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
HANDLE hItem = (HANDLE)SendDlgItemMessage(hwndDlg, IDC_LIST, CLM_FINDCONTACT, (WPARAM)hContact, 0);
if (hItem) SaveItemMask( GetDlgItem(hwndDlg, IDC_LIST), hContact, hItem, "Mask1");
if (SendDlgItemMessage(hwndDlg, IDC_LIST, CLM_GETCHECKMARK, (WPARAM)hItem, 0))
@@ -338,7 +338,7 @@ static int IgnoreOptInitialise(WPARAM wParam, LPARAM)
static INT_PTR IsIgnored(WPARAM wParam, LPARAM lParam)
{
- DWORD mask = GetMask((HCONTACT)wParam);
+ DWORD mask = GetMask((MCONTACT)wParam);
if (lParam < 1 || lParam > IGNOREEVENT_MAX)
return 1;
return (mask >> (lParam-1))&1;
@@ -346,20 +346,20 @@ static INT_PTR IsIgnored(WPARAM wParam, LPARAM lParam)
static INT_PTR Ignore(WPARAM wParam, LPARAM lParam)
{
- DWORD mask = GetMask((HCONTACT)wParam);
+ DWORD mask = GetMask((MCONTACT)wParam);
if ((lParam < 1 || lParam > IGNOREEVENT_MAX) && lParam != IGNOREEVENT_ALL)
return 1;
if (lParam == IGNOREEVENT_ALL)
mask = (1 << IGNOREEVENT_MAX)-1;
else
mask |= 1 << (lParam-1);
- db_set_dw((HCONTACT)wParam, "Ignore", "Mask1", mask);
+ db_set_dw((MCONTACT)wParam, "Ignore", "Mask1", mask);
return 0;
}
static INT_PTR Unignore(WPARAM wParam, LPARAM lParam)
{
- DWORD mask = GetMask((HCONTACT)wParam);
+ DWORD mask = GetMask((MCONTACT)wParam);
if ((lParam < 1 || lParam > IGNOREEVENT_MAX) && lParam != IGNOREEVENT_ALL)
return 1;
@@ -367,7 +367,7 @@ static INT_PTR Unignore(WPARAM wParam, LPARAM lParam)
mask = 0;
else
mask &= ~(1 << (lParam-1));
- db_set_dw((HCONTACT)wParam, "Ignore", "Mask1", mask);
+ db_set_dw((MCONTACT)wParam, "Ignore", "Mask1", mask);
return 0;
}
@@ -403,7 +403,7 @@ static int IgnoreAddedNotify(WPARAM, LPARAM lParam)
{
DBEVENTINFO *dbei = (DBEVENTINFO*)lParam;
if (dbei && dbei->eventType == EVENTTYPE_ADDED && dbei->pBlob != NULL) {
- HCONTACT hContact = DbGetAuthEventContact(dbei);
+ MCONTACT hContact = DbGetAuthEventContact(dbei);
if (CallService(MS_DB_CONTACT_IS, (WPARAM)hContact, 0) && IsIgnored((WPARAM)hContact, IGNOREEVENT_YOUWEREADDED))
return 1;
}
diff --git a/src/modules/protocols/protoaccs.cpp b/src/modules/protocols/protoaccs.cpp
index e3ef2977c5..2a0e2c4699 100644
--- a/src/modules/protocols/protoaccs.cpp
+++ b/src/modules/protocols/protoaccs.cpp
@@ -199,7 +199,7 @@ void WriteDbAccounts()
/////////////////////////////////////////////////////////////////////////////////////////
static int OnContactDeleted(WPARAM wParam, LPARAM lParam)
{
- HCONTACT hContact = (HCONTACT)wParam;
+ MCONTACT hContact = (MCONTACT)wParam;
if (hContact) {
PROTOACCOUNT* pa = Proto_GetAccount(hContact);
if (Proto_IsAccountEnabled(pa) && pa->ppro)
@@ -210,7 +210,7 @@ static int OnContactDeleted(WPARAM wParam, LPARAM lParam)
static int OnDbSettingsChanged(WPARAM wParam, LPARAM lParam)
{
- HCONTACT hContact = (HCONTACT)wParam;
+ MCONTACT hContact = (MCONTACT)wParam;
if (hContact) {
PROTOACCOUNT* pa = Proto_GetAccount(hContact);
if (Proto_IsAccountEnabled(pa) && pa->ppro)
@@ -317,7 +317,7 @@ static INT_PTR stub11(PROTO_INTERFACE* ppi, WPARAM wParam, LPARAM lParam)
static INT_PTR stub12(PROTO_INTERFACE* ppi, WPARAM wParam, LPARAM lParam)
{
- return (INT_PTR)ppi->GetCaps(wParam, (HCONTACT)lParam);
+ return (INT_PTR)ppi->GetCaps(wParam, (MCONTACT)lParam);
}
static INT_PTR stub13(PROTO_INTERFACE* ppi, WPARAM wParam, LPARAM)
@@ -550,9 +550,9 @@ void DeactivateAccount(PROTOACCOUNT* pa, bool bIsDynamic, bool bErase)
void EraseAccount(const char* pszModuleName)
{
// remove protocol contacts first
- HCONTACT hContact = db_find_first();
+ MCONTACT hContact = db_find_first();
while (hContact != NULL) {
- HCONTACT h1 = hContact;
+ MCONTACT h1 = hContact;
hContact = db_find_next(h1);
char *szProto = GetContactProto(hContact);
diff --git a/src/modules/protocols/protochains.cpp b/src/modules/protocols/protochains.cpp
index cc55405227..bf13ecd7d1 100644
--- a/src/modules/protocols/protochains.cpp
+++ b/src/modules/protocols/protochains.cpp
@@ -56,7 +56,7 @@ static int GetProtocolP(MCONTACT hContact, char *szBuf, int cbLen)
/////////////////////////////////////////////////////////////////////////////////////////
-INT_PTR CallContactService(HCONTACT hContact, const char *szProtoService, WPARAM wParam, LPARAM lParam)
+INT_PTR CallContactService(MCONTACT hContact, const char *szProtoService, WPARAM wParam, LPARAM lParam)
{
INT_PTR ret;
CCSDATA ccs = { hContact, szProtoService, wParam, lParam };
@@ -161,7 +161,7 @@ static INT_PTR Proto_RecvChain(WPARAM wParam, LPARAM lParam)
return ret;
}
-PROTOACCOUNT* __fastcall Proto_GetAccount(HCONTACT hContact)
+PROTOACCOUNT* __fastcall Proto_GetAccount(MCONTACT hContact)
{
if (hContact == NULL)
return NULL;
@@ -175,13 +175,13 @@ PROTOACCOUNT* __fastcall Proto_GetAccount(HCONTACT hContact)
static INT_PTR Proto_GetContactBaseProto(WPARAM wParam, LPARAM)
{
- PROTOACCOUNT *pa = Proto_GetAccount((HCONTACT)wParam);
+ PROTOACCOUNT *pa = Proto_GetAccount((MCONTACT)wParam);
return (INT_PTR)(Proto_IsAccountEnabled(pa) ? pa->szModuleName : NULL);
}
static INT_PTR Proto_GetContactBaseAccount(WPARAM wParam, LPARAM)
{
- PROTOACCOUNT *pa = Proto_GetAccount((HCONTACT)wParam);
+ PROTOACCOUNT *pa = Proto_GetAccount((MCONTACT)wParam);
return (INT_PTR)(pa ? pa->szModuleName : NULL);
}
@@ -210,14 +210,14 @@ static INT_PTR Proto_AddToContact(WPARAM wParam, LPARAM lParam)
if (pd == NULL) {
PROTOACCOUNT *pa = Proto_GetAccount(szProto);
if (pa) {
- db_set_s((HCONTACT)wParam, "Protocol", "p", szProto);
+ db_set_s((MCONTACT)wParam, "Protocol", "p", szProto);
return 0;
}
return 1;
}
if (pd->type == PROTOTYPE_PROTOCOL || pd->type == PROTOTYPE_VIRTUAL)
- db_set_s((HCONTACT)wParam, "Protocol", "p", szProto);
+ db_set_s((MCONTACT)wParam, "Protocol", "p", szProto);
return 0;
}
@@ -228,7 +228,7 @@ static INT_PTR Proto_RemoveFromContact(WPARAM wParam, LPARAM lParam)
case 0:
return 1;
case -1:
- db_unset((HCONTACT)wParam, "Protocol", "p");
+ db_unset((MCONTACT)wParam, "Protocol", "p");
}
return 0;
diff --git a/src/modules/protocols/protocols.cpp b/src/modules/protocols/protocols.cpp
index f2a30976e7..03ff01a69c 100644
--- a/src/modules/protocols/protocols.cpp
+++ b/src/modules/protocols/protocols.cpp
@@ -203,7 +203,7 @@ static INT_PTR Proto_AuthRecv(WPARAM wParam, LPARAM lParam)
/////////////////////////////////////////////////////////////////////////////////////////
// User Typing Notification services
-static int Proto_ValidTypingContact(HCONTACT hContact, char *szProto)
+static int Proto_ValidTypingContact(MCONTACT hContact, char *szProto)
{
if (!hContact || !szProto)
return 0;
@@ -214,11 +214,11 @@ static int Proto_ValidTypingContact(HCONTACT hContact, char *szProto)
static INT_PTR Proto_SelfIsTyping(WPARAM wParam, LPARAM lParam)
{
if (lParam == PROTOTYPE_SELFTYPING_OFF || lParam == PROTOTYPE_SELFTYPING_ON) {
- char *szProto = GetContactProto((HCONTACT)wParam);
+ char *szProto = GetContactProto((MCONTACT)wParam);
if (!szProto)
return 0;
- if (Proto_ValidTypingContact((HCONTACT)wParam, szProto))
+ if (Proto_ValidTypingContact((MCONTACT)wParam, szProto))
CallProtoServiceInt(NULL,szProto, PSS_USERISTYPING, wParam, lParam);
}
@@ -228,7 +228,7 @@ static INT_PTR Proto_SelfIsTyping(WPARAM wParam, LPARAM lParam)
static INT_PTR Proto_ContactIsTyping(WPARAM wParam, LPARAM lParam)
{
int type = (int)lParam;
- char *szProto = GetContactProto((HCONTACT)wParam);
+ char *szProto = GetContactProto((MCONTACT)wParam);
if (!szProto)
return 0;
@@ -238,7 +238,7 @@ static INT_PTR Proto_ContactIsTyping(WPARAM wParam, LPARAM lParam)
if (type < PROTOTYPE_CONTACTTYPING_OFF)
return 0;
- if (Proto_ValidTypingContact((HCONTACT)wParam, szProto))
+ if (Proto_ValidTypingContact((MCONTACT)wParam, szProto))
NotifyEventHooks(hTypeEvent, wParam, lParam);
return 0;
@@ -372,7 +372,7 @@ INT_PTR CallProtoService(const char* szModule, const char* szService, WPARAM wPa
return CallProtoServiceInt(NULL, szModule, szService, wParam, lParam);
}
-INT_PTR CallProtoServiceInt(HCONTACT hContact, const char *szModule, const char *szService, WPARAM wParam, LPARAM lParam)
+INT_PTR CallProtoServiceInt(MCONTACT hContact, const char *szModule, const char *szService, WPARAM wParam, LPARAM lParam)
{
PROTOACCOUNT* pa = Proto_GetAccount(szModule);
if (pa && !pa->bOldProto) {
@@ -442,7 +442,7 @@ INT_PTR CallProtoServiceInt(HCONTACT hContact, const char *szModule, const char
else
return (INT_PTR)ppi->FileResume((HANDLE)wParam, &pfr->action, (const PROTOCHAR**)&pfr->szFilename);
}
- case 12: return (INT_PTR)ppi->GetCaps(wParam, (HCONTACT)lParam);
+ case 12: return (INT_PTR)ppi->GetCaps(wParam, (MCONTACT)lParam);
case 13: return (INT_PTR)Proto_GetIcon(ppi, wParam);
case 14: return (INT_PTR)ppi->GetInfo(hContact, wParam);
case 15:
@@ -469,7 +469,7 @@ INT_PTR CallProtoServiceInt(HCONTACT hContact, const char *szModule, const char
case 21: return (INT_PTR)ppi->RecvFile(hContact, (PROTOFILEEVENT*)lParam);
case 22: return (INT_PTR)ppi->RecvMsg(hContact, (PROTORECVEVENT*)lParam);
case 23: return (INT_PTR)ppi->RecvUrl(hContact, (PROTORECVEVENT*)lParam);
- case 24: return (INT_PTR)ppi->SendContacts(hContact, LOWORD(wParam), HIWORD(wParam), (HCONTACT*)lParam);
+ case 24: return (INT_PTR)ppi->SendContacts(hContact, LOWORD(wParam), HIWORD(wParam), (MCONTACT*)lParam);
case 25:
if (ppi->m_iVersion > 1) {
TCHAR** files = Proto_FilesMatrixU((char**)lParam);
@@ -490,7 +490,7 @@ INT_PTR CallProtoServiceInt(HCONTACT hContact, const char *szModule, const char
return (INT_PTR)ppi->SetAwayMsg(wParam, StrConvT((char*)lParam));
else
return (INT_PTR)ppi->SetAwayMsg(wParam, (TCHAR*)lParam);
- case 34: return (INT_PTR)ppi->UserIsTyping((HCONTACT)wParam, lParam);
+ case 34: return (INT_PTR)ppi->UserIsTyping((MCONTACT)wParam, lParam);
case 35: lstrcpynA((char*)lParam, ppi->m_szModuleName, wParam); return 0;
case 36: return ppi->m_iStatus;
diff --git a/src/modules/protocols/protoint.cpp b/src/modules/protocols/protoint.cpp
index 75099e8c95..a1b7ab0469 100644
--- a/src/modules/protocols/protoint.cpp
+++ b/src/modules/protocols/protoint.cpp
@@ -47,14 +47,14 @@ void FreeFilesMatrix(TCHAR ***files)
struct DEFAULT_PROTO_INTERFACE : public PROTO_INTERFACE
{
- HCONTACT __cdecl AddToList(int flags, PROTOSEARCHRESULT* psr)
+ MCONTACT __cdecl AddToList(int flags, PROTOSEARCHRESULT* psr)
{
- return (HCONTACT)ProtoCallService(m_szModuleName, PS_ADDTOLIST, flags, (LPARAM)psr);
+ return (MCONTACT)ProtoCallService(m_szModuleName, PS_ADDTOLIST, flags, (LPARAM)psr);
}
- HCONTACT __cdecl AddToListByEvent(int flags, int iContact, HANDLE hDbEvent)
+ MCONTACT __cdecl AddToListByEvent(int flags, int iContact, HANDLE hDbEvent)
{
- return (HCONTACT)ProtoCallService(m_szModuleName, PS_ADDTOLISTBYEVENT, MAKELONG(flags, iContact), (LPARAM)hDbEvent);
+ return (MCONTACT)ProtoCallService(m_szModuleName, PS_ADDTOLISTBYEVENT, MAKELONG(flags, iContact), (LPARAM)hDbEvent);
}
int __cdecl Authorize(HANDLE hDbEvent)
@@ -67,13 +67,13 @@ struct DEFAULT_PROTO_INTERFACE : public PROTO_INTERFACE
return (int)ProtoCallService(m_szModuleName, PS_AUTHDENY, (WPARAM)hDbEvent, (LPARAM)StrConvA(szReason));
}
- int __cdecl AuthRecv(HCONTACT hContact, PROTORECVEVENT* evt)
+ int __cdecl AuthRecv(MCONTACT hContact, PROTORECVEVENT* evt)
{
CCSDATA ccs = { hContact, PSR_AUTH, 0, (LPARAM)evt };
return (int)ProtoCallService(m_szModuleName, PSR_AUTH, 0, (LPARAM)&ccs);
}
- int __cdecl AuthRequest(HCONTACT hContact, const TCHAR* szMessage)
+ int __cdecl AuthRequest(MCONTACT hContact, const TCHAR* szMessage)
{
CCSDATA ccs = { hContact, PSS_AUTHREQUEST, 0, (LPARAM)szMessage };
ccs.lParam = (LPARAM)mir_t2a(szMessage);
@@ -87,7 +87,7 @@ struct DEFAULT_PROTO_INTERFACE : public PROTO_INTERFACE
return (HANDLE)ProtoCallService(m_szModuleName, PS_CHANGEINFO, iInfoType, (LPARAM)pInfoData);
}
- HANDLE __cdecl FileAllow(HCONTACT hContact, HANDLE hTransfer, const PROTOCHAR* szPath)
+ HANDLE __cdecl FileAllow(MCONTACT hContact, HANDLE hTransfer, const PROTOCHAR* szPath)
{
CCSDATA ccs = { hContact, PSS_FILEALLOW, (WPARAM)hTransfer, (LPARAM)szPath };
@@ -97,13 +97,13 @@ struct DEFAULT_PROTO_INTERFACE : public PROTO_INTERFACE
return res;
}
- int __cdecl FileCancel(HCONTACT hContact, HANDLE hTransfer)
+ int __cdecl FileCancel(MCONTACT hContact, HANDLE hTransfer)
{
CCSDATA ccs = { hContact, PSS_FILECANCEL, (WPARAM)hTransfer, 0 };
return (int)ProtoCallService(m_szModuleName, PSS_FILECANCEL, 0, (LPARAM)&ccs);
}
- int __cdecl FileDeny(HCONTACT hContact, HANDLE hTransfer, const PROTOCHAR* szReason)
+ int __cdecl FileDeny(MCONTACT hContact, HANDLE hTransfer, const PROTOCHAR* szReason)
{
CCSDATA ccs = { hContact, PSS_FILEDENY, (WPARAM)hTransfer, (LPARAM)szReason };
@@ -125,7 +125,7 @@ struct DEFAULT_PROTO_INTERFACE : public PROTO_INTERFACE
return res;
}
- DWORD_PTR __cdecl GetCaps(int type, HCONTACT hContact)
+ DWORD_PTR __cdecl GetCaps(int type, MCONTACT hContact)
{
return (DWORD_PTR)ProtoCallService(m_szModuleName, PS_GETCAPS, type, (LPARAM)hContact);
}
@@ -135,7 +135,7 @@ struct DEFAULT_PROTO_INTERFACE : public PROTO_INTERFACE
return (HICON)ProtoCallService(m_szModuleName, PS_LOADICON, iconIndex, 0);
}
- int __cdecl GetInfo(HCONTACT hContact, int flags)
+ int __cdecl GetInfo(MCONTACT hContact, int flags)
{
CCSDATA ccs = { hContact, PSS_GETINFO, flags, 0 };
return ProtoCallService(m_szModuleName, PSS_GETINFO, 0, (LPARAM)&ccs);
@@ -176,37 +176,37 @@ struct DEFAULT_PROTO_INTERFACE : public PROTO_INTERFACE
return (HWND)ProtoCallService(m_szModuleName, PS_CREATEADVSEARCHUI, 0, (LPARAM)owner);
}
- int __cdecl RecvContacts(HCONTACT hContact, PROTORECVEVENT* evt)
+ int __cdecl RecvContacts(MCONTACT hContact, PROTORECVEVENT* evt)
{
CCSDATA ccs = { hContact, PSR_CONTACTS, 0, (LPARAM)evt };
return (int)ProtoCallService(m_szModuleName, PSR_CONTACTS, 0, (LPARAM)&ccs);
}
- int __cdecl RecvFile(HCONTACT hContact, PROTOFILEEVENT* evt)
+ int __cdecl RecvFile(MCONTACT hContact, PROTOFILEEVENT* evt)
{
CCSDATA ccs = { hContact, PSR_FILE, 0, (LPARAM)evt };
return ProtoCallService(m_szModuleName, PSR_FILE, 0, (LPARAM)&ccs);
}
- int __cdecl RecvMsg(HCONTACT hContact, PROTORECVEVENT* evt)
+ int __cdecl RecvMsg(MCONTACT hContact, PROTORECVEVENT* evt)
{
CCSDATA ccs = { hContact, PSR_MESSAGE, 0, (LPARAM)evt };
return (int)ProtoCallService(m_szModuleName, PSR_MESSAGE, 0, (LPARAM)&ccs);
}
- int __cdecl RecvUrl(HCONTACT hContact, PROTORECVEVENT* evt)
+ int __cdecl RecvUrl(MCONTACT hContact, PROTORECVEVENT* evt)
{
CCSDATA ccs = { hContact, PSR_URL, 0, (LPARAM)evt };
return (int)ProtoCallService(m_szModuleName, PSR_URL, 0, (LPARAM)&ccs);
}
- int __cdecl SendContacts(HCONTACT hContact, int flags, int nContacts, HCONTACT *hContactsList)
+ int __cdecl SendContacts(MCONTACT hContact, int flags, int nContacts, MCONTACT *hContactsList)
{
CCSDATA ccs = { hContact, PSS_CONTACTS, MAKEWPARAM(flags, nContacts), (LPARAM)hContactsList };
return (int)ProtoCallService(m_szModuleName, PSS_CONTACTS, 0, (LPARAM)&ccs);
}
- HANDLE __cdecl SendFile(HCONTACT hContact, const PROTOCHAR* szDescription, PROTOCHAR** ppszFiles)
+ HANDLE __cdecl SendFile(MCONTACT hContact, const PROTOCHAR* szDescription, PROTOCHAR** ppszFiles)
{
CCSDATA ccs = { hContact, PSS_FILE, (WPARAM)szDescription, (LPARAM)ppszFiles };
@@ -218,19 +218,19 @@ struct DEFAULT_PROTO_INTERFACE : public PROTO_INTERFACE
return res;
}
- int __cdecl SendMsg(HCONTACT hContact, int flags, const char* msg)
+ int __cdecl SendMsg(MCONTACT hContact, int flags, const char* msg)
{
CCSDATA ccs = { hContact, PSS_MESSAGE, flags, (LPARAM)msg };
return (int)ProtoCallService(m_szModuleName, PSS_MESSAGE, 0, (LPARAM)&ccs);
}
- int __cdecl SendUrl(HCONTACT hContact, int flags, const char* url)
+ int __cdecl SendUrl(MCONTACT hContact, int flags, const char* url)
{
CCSDATA ccs = { hContact, PSS_URL, flags, (LPARAM)url };
return (int)ProtoCallService(m_szModuleName, PSS_URL, 0, (LPARAM)&ccs);
}
- int __cdecl SetApparentMode(HCONTACT hContact, int mode)
+ int __cdecl SetApparentMode(MCONTACT hContact, int mode)
{
CCSDATA ccs = { hContact, PSS_SETAPPARENTMODE, mode, 0 };
return (int)ProtoCallService(m_szModuleName, PSS_SETAPPARENTMODE, 0, (LPARAM)&ccs);
@@ -241,13 +241,13 @@ struct DEFAULT_PROTO_INTERFACE : public PROTO_INTERFACE
return (int)ProtoCallService(m_szModuleName, PS_SETSTATUS, iNewStatus, 0);
}
- HANDLE __cdecl GetAwayMsg(HCONTACT hContact)
+ HANDLE __cdecl GetAwayMsg(MCONTACT hContact)
{
CCSDATA ccs = { hContact, PSS_GETAWAYMSG, 0, 0 };
return (HANDLE)ProtoCallService(m_szModuleName, PSS_GETAWAYMSG, 0, (LPARAM)&ccs);
}
- int __cdecl RecvAwayMsg(HCONTACT hContact, int statusMode, PROTORECVEVENT* evt)
+ int __cdecl RecvAwayMsg(MCONTACT hContact, int statusMode, PROTORECVEVENT* evt)
{
CCSDATA ccs = { hContact, PSR_AWAYMSG, statusMode, (LPARAM)evt };
return (int)ProtoCallService(m_szModuleName, PSR_AWAYMSG, 0, (LPARAM)&ccs);
@@ -258,7 +258,7 @@ struct DEFAULT_PROTO_INTERFACE : public PROTO_INTERFACE
return (int)ProtoCallService(m_szModuleName, PS_SETAWAYMSG, iStatus, (LPARAM)StrConvA(msg));
}
- int __cdecl UserIsTyping(HCONTACT hContact, int type)
+ int __cdecl UserIsTyping(MCONTACT hContact, int type)
{
CCSDATA ccs = { hContact, PSS_USERISTYPING, (WPARAM)hContact, type };
return ProtoCallService(m_szModuleName, PSS_USERISTYPING, 0, (LPARAM)&ccs);
diff --git a/src/modules/srmm/statusicon.cpp b/src/modules/srmm/statusicon.cpp
index d74d5eac0b..e1cc7bc0f0 100644
--- a/src/modules/srmm/statusicon.cpp
+++ b/src/modules/srmm/statusicon.cpp
@@ -32,7 +32,7 @@ struct StatusIconChild : public MZeroedObject
mir_free(tszTooltip);
}
- HCONTACT hContact;
+ MCONTACT hContact;
HICON hIcon, hIconDisabled;
int flags;
TCHAR *tszTooltip;
@@ -88,7 +88,7 @@ INT_PTR ModifyStatusIcon(WPARAM wParam, LPARAM lParam)
if (p == NULL)
return 1;
- HCONTACT hContact = (HCONTACT)wParam;
+ MCONTACT hContact = (MCONTACT)wParam;
if (hContact == NULL) {
mir_free(p->sid.szModule);
mir_free(p->sid.szTooltip);
diff --git a/src/modules/utils/path.cpp b/src/modules/utils/path.cpp
index 0f47fdb23a..3520a749b0 100644
--- a/src/modules/utils/path.cpp
+++ b/src/modules/utils/path.cpp
@@ -68,7 +68,7 @@ static INT_PTR createDirTreeW(WPARAM, LPARAM lParam)
return CreateDirectoryTreeW((WCHAR*)lParam);
}
-TCHAR *GetContactID(HCONTACT hContact)
+TCHAR *GetContactID(MCONTACT hContact)
{
TCHAR *theValue = {0};
char *szProto = GetContactProto(hContact);
@@ -114,12 +114,12 @@ static __forceinline char *_xstrselect(char *, char *s1, TCHAR *s2) { return s1;
static __forceinline char *_itox(char *, int a) { return itoa(a, (char *)mir_alloc(sizeof(char)*20), 10); }
static __forceinline char *mir_a2x(char *, char *s) { return mir_strdup(s); }
-static __forceinline char *GetContactNickX(char *, HCONTACT hContact)
+static __forceinline char *GetContactNickX(char *, MCONTACT hContact)
{
return mir_strdup((char *)CallService(MS_CLIST_GETCONTACTDISPLAYNAME, (WPARAM)hContact, 0));
}
-static __forceinline char *GetContactIDX(char *, HCONTACT hContact)
+static __forceinline char *GetContactIDX(char *, MCONTACT hContact)
{
TCHAR *id = GetContactID(hContact);
char* res = mir_t2a(id);
@@ -201,12 +201,12 @@ static __forceinline TCHAR *_xstrselect(TCHAR *, char *s1, TCHAR *s2) { return s
static __forceinline TCHAR *_itox(TCHAR *, int a) { return _itot(a, (TCHAR *)mir_alloc(sizeof(TCHAR)*20), 10); }
static __forceinline TCHAR *mir_a2x(TCHAR *, char *s) { return mir_a2t(s); }
-static __forceinline TCHAR *GetContactNickX(TCHAR *, HCONTACT hContact)
+static __forceinline TCHAR *GetContactNickX(TCHAR *, MCONTACT hContact)
{
return mir_tstrdup((TCHAR *)CallService(MS_CLIST_GETCONTACTDISPLAYNAME, (WPARAM)hContact, GCDNF_TCHAR));
}
-static __forceinline TCHAR *GetContactIDX(TCHAR *, HCONTACT hContact)
+static __forceinline TCHAR *GetContactIDX(TCHAR *, MCONTACT hContact)
{
return GetContactID(hContact);
}
@@ -277,7 +277,7 @@ static __forceinline TCHAR *GetPathVarX(TCHAR *, int code)
}
template<typename XCHAR>
-XCHAR *GetInternalVariable(XCHAR *key, size_t keyLength, HCONTACT hContact)
+XCHAR *GetInternalVariable(XCHAR *key, size_t keyLength, MCONTACT hContact)
{
XCHAR *theValue = NULL;
XCHAR *theKey = (XCHAR *)_alloca(sizeof(XCHAR) * (keyLength + 1));
@@ -323,7 +323,7 @@ XCHAR *GetInternalVariable(XCHAR *key, size_t keyLength, HCONTACT hContact)
}
template<typename XCHAR>
-XCHAR *GetVariableFromArray(REPLACEVARSARRAY *vars, XCHAR *key, size_t keyLength, HCONTACT hContact, bool *bFree)
+XCHAR *GetVariableFromArray(REPLACEVARSARRAY *vars, XCHAR *key, size_t keyLength, MCONTACT hContact, bool *bFree)
{
*bFree = false;
for (REPLACEVARSARRAY *var = vars; var && var->lptzKey; ++var)
diff --git a/src/modules/utils/timezones.cpp b/src/modules/utils/timezones.cpp
index ec3442c471..dab7f94089 100644
--- a/src/modules/utils/timezones.cpp
+++ b/src/modules/utils/timezones.cpp
@@ -168,7 +168,7 @@ static HANDLE timeapiGetInfoByName(LPCTSTR tszName, DWORD dwFlags)
return tz;
}
-static HANDLE timeapiGetInfoByContact(HCONTACT hContact, DWORD dwFlags)
+static HANDLE timeapiGetInfoByContact(MCONTACT hContact, DWORD dwFlags)
{
if (hContact == NULL)
return (dwFlags & (TZF_DIFONLY | TZF_KNOWNONLY)) ? NULL : &myInfo.myTZ;
@@ -227,7 +227,7 @@ static HANDLE timeapiGetInfoByContact(HCONTACT hContact, DWORD dwFlags)
return (dwFlags & (TZF_DIFONLY | TZF_KNOWNONLY)) ? NULL : &myInfo.myTZ;
}
-static void timeapiSetInfoByContact(HCONTACT hContact, HANDLE hTZ)
+static void timeapiSetInfoByContact(MCONTACT hContact, HANDLE hTZ)
{
MIM_TIMEZONE *tz = (MIM_TIMEZONE*)hTZ;
@@ -354,7 +354,7 @@ static const ListMessages *GetListMessages(HWND hWnd, DWORD dwFlags)
}
-static int timeapiSelectListItem(HCONTACT hContact, HWND hWnd, DWORD dwFlags)
+static int timeapiSelectListItem(MCONTACT hContact, HWND hWnd, DWORD dwFlags)
{
if (hWnd == NULL) // nothing to do
return -1;
@@ -386,7 +386,7 @@ static int timeapiSelectListItem(HCONTACT hContact, HWND hWnd, DWORD dwFlags)
}
-static int timeapiPrepareList(HCONTACT hContact, HWND hWnd, DWORD dwFlags)
+static int timeapiPrepareList(MCONTACT hContact, HWND hWnd, DWORD dwFlags)
{
if (hWnd == NULL) // nothing to do
return 0;
@@ -408,7 +408,7 @@ static int timeapiPrepareList(HCONTACT hContact, HWND hWnd, DWORD dwFlags)
}
-static void timeapiStoreListResult(HCONTACT hContact, HWND hWnd, DWORD dwFlags)
+static void timeapiStoreListResult(MCONTACT hContact, HWND hWnd, DWORD dwFlags)
{
const ListMessages *lstMsg = GetListMessages(hWnd, dwFlags);
if (lstMsg == NULL) return;
diff --git a/src/modules/utils/windowlist.cpp b/src/modules/utils/windowlist.cpp
index 1337795f2d..80c84906f4 100644
--- a/src/modules/utils/windowlist.cpp
+++ b/src/modules/utils/windowlist.cpp
@@ -26,12 +26,12 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
struct TWindowListItem
{
- TWindowListItem(HCONTACT _contact, HWND _wnd) :
+ TWindowListItem(MCONTACT _contact, HWND _wnd) :
hContact(_contact),
hWnd(_wnd)
{}
- HCONTACT hContact;
+ MCONTACT hContact;
HWND hWnd;
};
diff --git a/src/modules/visibility/visibility.cpp b/src/modules/visibility/visibility.cpp
index 449467c3e9..d9043ee9e3 100644
--- a/src/modules/visibility/visibility.cpp
+++ b/src/modules/visibility/visibility.cpp
@@ -107,7 +107,7 @@ static void ResetListOptions(HWND hwndList)
static void SetAllContactIcons(HWND hwndList)
{
- for (HCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
+ for (MCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
HANDLE hItem = (HANDLE)SendMessage(hwndList, CLM_FINDCONTACT, (WPARAM)hContact, 0);
if (hItem == NULL)
continue;
@@ -244,7 +244,7 @@ static INT_PTR CALLBACK DlgProcVisibilityOpts(HWND hwndDlg, UINT msg, WPARAM, LP
case 0:
if (((LPNMHDR)lParam)->code == PSN_APPLY) {
- for (HCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
+ for (MCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
HANDLE hItem = (HANDLE)SendDlgItemMessage(hwndDlg, IDC_LIST, CLM_FINDCONTACT, (WPARAM)hContact, 0);
if (hItem == NULL)
continue;