summaryrefslogtreecommitdiff
path: root/plugins/Clist_mw/src
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2014-02-10 14:42:51 +0000
committerGeorge Hazan <george.hazan@gmail.com>2014-02-10 14:42:51 +0000
commit33953cc6a0fab6a91af293c6838f8a46dd7922da (patch)
tree2dbbe718ad42545bde6c9f7672387827c530550a /plugins/Clist_mw/src
parente190a7fde521bd6af9ea485cc730f854aaf38e11 (diff)
HCONTACT, part 3
git-svn-id: http://svn.miranda-ng.org/main/trunk@8081 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Clist_mw/src')
-rw-r--r--plugins/Clist_mw/src/clc.cpp8
-rw-r--r--plugins/Clist_mw/src/clcidents.cpp11
-rw-r--r--plugins/Clist_mw/src/clcitems.cpp7
-rw-r--r--plugins/Clist_mw/src/clistmod.cpp2
4 files changed, 15 insertions, 13 deletions
diff --git a/plugins/Clist_mw/src/clc.cpp b/plugins/Clist_mw/src/clc.cpp
index b138a66c92..4f406eee21 100644
--- a/plugins/Clist_mw/src/clc.cpp
+++ b/plugins/Clist_mw/src/clc.cpp
@@ -162,14 +162,14 @@ LRESULT CALLBACK ContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wParam, L
ClcContact *contact;
ClcGroup *group;
- if (!FindItem(hwnd, dat, (HCONTACT)wParam, &contact, &group, NULL)) {
+ if (!FindItem(hwnd, dat, (HANDLE)wParam, &contact, &group, NULL)) {
if (shouldShow && CallService(MS_DB_CONTACT_IS, wParam, 0)) {
if (dat->selection>=0 && GetRowByIndex(dat,dat->selection,&selcontact,NULL) != -1)
hSelItem = (HCONTACT)pcli->pfnContactToHItem(selcontact);
AddContactToTree(hwnd, dat, (HCONTACT)wParam, 0, 0);
needsResort = 1;
recalcScrollBar = 1;
- FindItem(hwnd, dat, (HCONTACT)wParam, &contact, NULL, NULL);
+ FindItem(hwnd, dat, (HANDLE)wParam, &contact, NULL, NULL);
if (contact) {
contact->iImage = (WORD)lParam;
pcli->pfnNotifyNewContact(hwnd, (HCONTACT)wParam);
@@ -201,7 +201,7 @@ LRESULT CALLBACK ContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wParam, L
} }
if (hSelItem) {
ClcGroup *selgroup;
- if ( FindItem(hwnd,dat,hSelItem,&selcontact,&selgroup,NULL))
+ if ( FindItem(hwnd, dat, (HANDLE)hSelItem,&selcontact,&selgroup,NULL))
dat->selection = GetRowsPriorTo(&dat->list,selgroup,List_IndexOf((SortedList*)&selgroup->cl, selcontact));
else
dat->selection = -1;
@@ -220,7 +220,7 @@ LRESULT CALLBACK ContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wParam, L
ClcContact *contact;
ClcGroup *group;
- if (FindItem(hwnd, dat, (HCONTACT)wParam, &contact, &group, NULL) && contact != NULL) {
+ if (FindItem(hwnd, dat, (HANDLE)wParam, &contact, &group, NULL) && contact != NULL) {
contact->flags &= ~CONTACTF_STATUSMSG;
if (!db_get_ts((HCONTACT)wParam, "CList", "StatusMsg", &dbv)) {
int j;
diff --git a/plugins/Clist_mw/src/clcidents.cpp b/plugins/Clist_mw/src/clcidents.cpp
index 803b7b9f6b..20c361e321 100644
--- a/plugins/Clist_mw/src/clcidents.cpp
+++ b/plugins/Clist_mw/src/clcidents.cpp
@@ -111,7 +111,7 @@ void ClearClcContactCache(struct ClcData *dat,HCONTACT hContact)
{
ClcCacheEntry *cacheEntry;
- if (hContact == INVALID_HANDLE_VALUE) {
+ if (hContact == (HCONTACT)INVALID_HANDLE_VALUE) {
int i,tick;
tick = GetTickCount();
@@ -193,9 +193,10 @@ int FindItem(HWND hwnd, struct ClcData *dat, HANDLE hItem, struct ClcContact **c
continue;
}
if (nowVisible) index++;
- if ((IsHContactGroup(hItem) && group->cl.items[group->scanIndex]->type == CLCIT_GROUP && ((UINT_PTR)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 == hItem) ||
- (IsHContactInfo(hItem) && group->cl.items[group->scanIndex]->type == CLCIT_INFO && group->cl.items[group->scanIndex]->hContact == (HANDLE)((UINT_PTR)hItem&~HCONTACT_ISINFO))) {
+ if ((IsHContactGroup(hItem) && group->cl.items[group->scanIndex]->type == CLCIT_GROUP && ((UINT_PTR)hItem & ~HCONTACT_ISGROUP) == group->cl.items[group->scanIndex]->groupId) ||
+ (IsHContactContact(hItem) && group->cl.items[group->scanIndex]->type == CLCIT_CONTACT && (HANDLE)group->cl.items[group->scanIndex]->hContact == hItem) ||
+ (IsHContactInfo(hItem) && group->cl.items[group->scanIndex]->type == CLCIT_INFO && (HANDLE)group->cl.items[group->scanIndex]->hContact == (HANDLE)((UINT_PTR)hItem & ~HCONTACT_ISINFO)))
+ {
if (isVisible) {
if ( !nowVisible) *isVisible = 0;
else {
@@ -215,7 +216,7 @@ int FindItem(HWND hwnd, struct ClcData *dat, HANDLE hItem, struct ClcContact **c
if (group->cl.items[group->scanIndex]->type == CLCIT_CONTACT &&
group->cl.items[group->scanIndex]->SubAllocated>0)
for (i = 1; i<=group->cl.items[group->scanIndex]->SubAllocated; i++)
- if (IsHContactContact(hItem) && group->cl.items[group->scanIndex]->subcontacts[i-1].hContact == hItem) {
+ if (IsHContactContact(hItem) && group->cl.items[group->scanIndex]->subcontacts[i-1].hContact == (HCONTACT)hItem) {
if (contact) *contact = &group->cl.items[group->scanIndex]->subcontacts[i-1];
if (subgroup) *subgroup = group;
return 1;
diff --git a/plugins/Clist_mw/src/clcitems.cpp b/plugins/Clist_mw/src/clcitems.cpp
index 57b4a43fad..ff0e148a15 100644
--- a/plugins/Clist_mw/src/clcitems.cpp
+++ b/plugins/Clist_mw/src/clcitems.cpp
@@ -184,7 +184,7 @@ static struct ClcContact* AddContactToGroup(struct ClcData *dat,ClcGroup *group,
void AddContactToTree(HWND hwnd, ClcData *dat, HCONTACT hContact, int updateTotalCount, int checkHideOffline)
{
- if ( FindItem(hwnd,dat,hContact,NULL,NULL,NULL) == 1)
+ if ( FindItem(hwnd,dat,(HANDLE)hContact,NULL,NULL,NULL) == 1)
return;
ClcCacheEntry *cacheEntry = GetContactFullCacheEntry(hContact);
@@ -283,7 +283,7 @@ void DeleteItemFromTree(HWND hwnd, HCONTACT hItem)
ClearRowByIndexCache();
dat->needsResort = 1;
- if ( !FindItem(hwnd,dat,hItem,&contact,&group,NULL)) {
+ if ( !FindItem(hwnd,dat,(HANDLE)hItem,&contact,&group,NULL)) {
DBVARIANT dbv;
int i,nameOffset;
if ( !IsHContactContact(hItem)) return;
@@ -653,7 +653,8 @@ void SaveStateAndRebuildList(HWND hwnd,struct ClcData *dat)
for (i = 0;i<savedInfoCount;i++) {
if (savedInfo[i].parentId == -1) group = &dat->list;
else {
- if (!FindItem(hwnd, dat, (HCONTACT)(savedInfo[i].parentId | HCONTACT_ISGROUP), &contact, NULL, NULL)) continue;
+ if (!FindItem(hwnd, dat, (HANDLE)(savedInfo[i].parentId | HCONTACT_ISGROUP), &contact, NULL, NULL))
+ continue;
group = contact->group;
}
j = AddInfoItemToGroup(group,savedInfo[i].contact.flags,_T(""));
diff --git a/plugins/Clist_mw/src/clistmod.cpp b/plugins/Clist_mw/src/clistmod.cpp
index aff0c241fe..be79bfcfcf 100644
--- a/plugins/Clist_mw/src/clistmod.cpp
+++ b/plugins/Clist_mw/src/clistmod.cpp
@@ -52,7 +52,7 @@ int cli_IconFromStatusMode(const char *szProto,int nStatus, HCONTACT hContact)
if ( !db_get_b(NULL,"CLC","Meta",0) && !strcmp(szActProto,"MetaContacts")) {
// substitute params by mostonline contact datas
HCONTACT hMostOnlineContact = (HCONTACT)CallService(MS_MC_GETMOSTONLINECONTACT, (WPARAM)hActContact, 0);
- if (hMostOnlineContact && hMostOnlineContact != (HANDLE)CALLSERVICE_NOTFOUND) {
+ if (hMostOnlineContact && hMostOnlineContact != (HCONTACT)CALLSERVICE_NOTFOUND) {
ClcCacheEntry *cacheEntry = (ClcCacheEntry *)pcli->pfnGetCacheEntry(hMostOnlineContact);
if (cacheEntry && cacheEntry->szProto) {
szActProto = cacheEntry->szProto;