summaryrefslogtreecommitdiff
path: root/plugins/Clist_nicer
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_nicer
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_nicer')
-rw-r--r--plugins/Clist_nicer/src/clc.cpp34
-rw-r--r--plugins/Clist_nicer/src/clcidents.cpp5
-rw-r--r--plugins/Clist_nicer/src/clcmsgs.cpp8
-rw-r--r--plugins/Clist_nicer/src/clistmenus.cpp12
4 files changed, 30 insertions, 29 deletions
diff --git a/plugins/Clist_nicer/src/clc.cpp b/plugins/Clist_nicer/src/clc.cpp
index 00d7be37d2..973cb5a267 100644
--- a/plugins/Clist_nicer/src/clc.cpp
+++ b/plugins/Clist_nicer/src/clc.cpp
@@ -282,7 +282,7 @@ LBL_Def:
{
WORD iExtraImage[EXTRA_ICON_COUNT];
BYTE flags = 0;
- if (!FindItem(hwnd, dat, (HCONTACT)wParam, &contact, NULL, NULL))
+ if (!FindItem(hwnd, dat, (HANDLE)wParam, &contact, NULL, NULL))
memset(iExtraImage, 0xFF, sizeof(iExtraImage));
else {
memcpy(iExtraImage, contact->iExtraImage, sizeof(iExtraImage));
@@ -291,7 +291,7 @@ LBL_Def:
pcli->pfnDeleteItemFromTree(hwnd, (HCONTACT)wParam);
if (GetWindowLongPtr(hwnd, GWL_STYLE) & CLS_SHOWHIDDEN || !CLVM_GetContactHiddenStatus((HCONTACT)wParam, NULL, dat)) {
pcli->pfnAddContactToTree(hwnd, dat, (HCONTACT)wParam, 1, 1);
- if (FindItem(hwnd, dat, (HCONTACT)wParam, &contact, NULL, NULL)) {
+ if (FindItem(hwnd, dat, (HANDLE)wParam, &contact, NULL, NULL)) {
memcpy(contact->iExtraImage, iExtraImage, sizeof(iExtraImage));
if (flags & CONTACTF_CHECKED)
contact->flags |= CONTACTF_CHECKED;
@@ -329,13 +329,13 @@ LBL_Def:
!CLVM_GetContactHiddenStatus(hContact, szProto, dat)) && ((cfg::dat.bFilterEffective ? TRUE : !pcli->pfnIsHiddenMode(dat, status)) ||
pcli->pfnGetContactIcon(hContact) != lParam); // XXX CLVM changed - this means an offline msg is flashing, so the contact should be shown
- if (!FindItem(hwnd, dat, hContact, &contact, &group, NULL)) {
+ if (!FindItem(hwnd, dat, (HANDLE)hContact, &contact, &group, NULL)) {
if (shouldShow && CallService(MS_DB_CONTACT_IS, wParam, 0)) {
if (dat->selection >= 0 && pcli->pfnGetRowByIndex(dat, dat->selection, &selcontact, NULL) != -1)
hSelItem = (HCONTACT)pcli->pfnContactToHItem(selcontact);
pcli->pfnAddContactToTree(hwnd, dat, hContact, 0, 0);
recalcScrollBar = 1;
- FindItem(hwnd, dat, hContact, &contact, NULL, NULL);
+ FindItem(hwnd, dat, (HANDLE)hContact, &contact, NULL, NULL);
if (contact) {
contact->iImage = (WORD)lParam;
pcli->pfnNotifyNewContact(hwnd, hContact);
@@ -364,7 +364,7 @@ LBL_Def:
}
if (hSelItem) {
ClcGroup *selgroup;
- if (pcli->pfnFindItem(hwnd, dat, hSelItem, &selcontact, &selgroup, NULL))
+ if (pcli->pfnFindItem(hwnd, dat, (HANDLE)hSelItem, &selcontact, &selgroup, NULL))
dat->selection = pcli->pfnGetRowsPriorTo(&dat->list, selgroup, List_IndexOf((SortedList*)& selgroup->cl, selcontact));
else
dat->selection = -1;
@@ -378,7 +378,7 @@ LBL_Def:
goto LBL_Def;
case INTM_METACHANGED:
- if (!pcli->pfnFindItem(hwnd, dat, (HCONTACT)wParam, &contact, NULL, NULL))
+ if (!pcli->pfnFindItem(hwnd, dat, (HANDLE)wParam, &contact, NULL, NULL))
break;
if (contact->bIsMeta && cfg::dat.bMetaAvail && !(cfg::dat.dwFlags & CLUI_USEMETAICONS)) {
@@ -388,7 +388,7 @@ LBL_Def:
if (contact->pExtra) {
TExtraCache *pSub = cfg::getCache(contact->hSubContact, contact->metaProto);
ClcContact *subContact;
- if (!pcli->pfnFindItem(hwnd, dat, (HCONTACT)contact->hSubContact, &subContact, NULL, NULL))
+ if (!pcli->pfnFindItem(hwnd, dat, (HANDLE)contact->hSubContact, &subContact, NULL, NULL))
break;
contact->pExtra->proto_status_item = GetProtocolStatusItem(contact->metaProto);
@@ -402,7 +402,7 @@ LBL_Def:
goto LBL_Def;
case INTM_METACHANGEDEVENT:
- if (!FindItem(hwnd, dat, (HCONTACT)wParam, &contact, NULL, NULL))
+ if (!FindItem(hwnd, dat, (HANDLE)wParam, &contact, NULL, NULL))
break;
if (lParam == 0)
SendMessage(hwnd, CLM_AUTOREBUILD, 0, 0);
@@ -410,7 +410,7 @@ LBL_Def:
case INTM_NAMECHANGED:
ClcContact *contact;
- if (!FindItem(hwnd, dat, (HCONTACT)wParam, &contact, NULL, NULL))
+ if (!FindItem(hwnd, dat, (HANDLE)wParam, &contact, NULL, NULL))
break;
lstrcpyn(contact->szText, pcli->pfnGetContactDisplayName((HCONTACT)wParam, 0), SIZEOF(contact->szText));
@@ -421,7 +421,7 @@ LBL_Def:
goto LBL_Def;
case INTM_CODEPAGECHANGED:
- if (!FindItem(hwnd, dat, (HCONTACT)wParam, &contact, NULL, NULL))
+ if (!FindItem(hwnd, dat, (HANDLE)wParam, &contact, NULL, NULL))
break;
contact->codePage = cfg::getDword((HCONTACT)wParam, "Tab_SRMsg", "ANSIcodepage", cfg::getDword((HCONTACT)wParam, "UserInfo", "ANSIcodepage", CP_ACP));
PostMessage(hwnd, INTM_INVALIDATE, 0, 0);
@@ -440,7 +440,7 @@ LBL_Def:
goto LBL_Def;
}
- if (!FindItem(hwnd, dat, (HCONTACT)wParam, &contact, NULL, NULL))
+ if (!FindItem(hwnd, dat, (HANDLE)wParam, &contact, NULL, NULL))
return 0;
contact->ace = cEntry;
if (cEntry == NULL)
@@ -466,7 +466,7 @@ LBL_Def:
TExtraCache *p;
char *szProto = NULL;
- if (!FindItem(hwnd, dat, (HCONTACT)wParam, &contact, NULL, NULL))
+ if (!FindItem(hwnd, dat, (HANDLE)wParam, &contact, NULL, NULL))
p = cfg::getCache((HCONTACT)wParam, NULL);
else {
p = contact->pExtra;
@@ -478,7 +478,7 @@ LBL_Def:
goto LBL_Def;
case INTM_STATUSCHANGED:
- if (FindItem(hwnd, dat, (HCONTACT)wParam, &contact, NULL, NULL)) {
+ if (FindItem(hwnd, dat, (HANDLE)wParam, &contact, NULL, NULL)) {
WORD wStatus = cfg::getWord((HCONTACT)wParam, contact->proto, "Status", ID_STATUS_OFFLINE);
if (cfg::dat.bNoOfflineAvatars && wStatus != ID_STATUS_OFFLINE && contact->wStatus == ID_STATUS_OFFLINE) {
contact->wStatus = wStatus;
@@ -491,7 +491,7 @@ LBL_Def:
break;
case INTM_PROTOCHANGED:
- if (!FindItem(hwnd, dat, (HCONTACT)wParam, &contact, NULL, NULL))
+ if (!FindItem(hwnd, dat, (HANDLE)wParam, &contact, NULL, NULL))
break;
contact->proto = GetContactProto((HCONTACT)wParam);
@@ -513,7 +513,7 @@ LBL_Def:
goto LBL_Def;
case INTM_INVALIDATECONTACT:
- if (!FindItem(hwnd, dat, (HCONTACT)wParam, &contact, &group, NULL))
+ if (!FindItem(hwnd, dat, (HANDLE)wParam, &contact, &group, NULL))
break;
if (contact == 0 || group == 0)
@@ -538,7 +538,7 @@ LBL_Def:
goto LBL_Def;
case INTM_IDLECHANGED:
- if (FindItem(hwnd, dat, (HCONTACT)wParam, &contact, NULL, NULL)) {
+ if (FindItem(hwnd, dat, (HANDLE)wParam, &contact, NULL, NULL)) {
DBCONTACTWRITESETTING *cws = (DBCONTACTWRITESETTING *) lParam;
char *szProto = (char*)cws->szModule;
if (szProto == NULL)
@@ -560,7 +560,7 @@ LBL_Def:
HCONTACT hContact = (HCONTACT)wParam;
TExtraCache *p;
- if (!FindItem(hwnd, dat, hContact, &contact, NULL, NULL)) {
+ if (!FindItem(hwnd, dat, (HANDLE)hContact, &contact, NULL, NULL)) {
p = cfg::getCache(hContact, szProto);
if (!dat->bisEmbedded && cfg::dat.bMetaAvail && szProto) { // may be a subcontact, forward the xstatus
if (cfg::getByte(hContact, cfg::dat.szMetaName, "IsSubcontact", 0)) {
diff --git a/plugins/Clist_nicer/src/clcidents.cpp b/plugins/Clist_nicer/src/clcidents.cpp
index 3b6f294188..18dae02c34 100644
--- a/plugins/Clist_nicer/src/clcidents.cpp
+++ b/plugins/Clist_nicer/src/clcidents.cpp
@@ -65,7 +65,10 @@ int FindItem(HWND hwnd, struct ClcData *dat, HANDLE hItem, ClcContact **contact,
}
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 && group->cl.items[group->scanIndex]->hContact == (HCONTACT)hItem) ||
+ (IsHContactInfo(hItem) && group->cl.items[group->scanIndex]->type == CLCIT_INFO && group->cl.items[group->scanIndex]->hContact == (HCONTACT)((UINT_PTR) hItem & ~HCONTACT_ISINFO)))
+ {
if (isVisible) {
if ( !nowVisible)
*isVisible = 0;
diff --git a/plugins/Clist_nicer/src/clcmsgs.cpp b/plugins/Clist_nicer/src/clcmsgs.cpp
index def28802ac..5eace41b51 100644
--- a/plugins/Clist_nicer/src/clcmsgs.cpp
+++ b/plugins/Clist_nicer/src/clcmsgs.cpp
@@ -35,7 +35,7 @@ LRESULT ProcessExternalMessages(HWND hwnd, struct ClcData *dat, UINT msg, WPARAM
{
ClcContact *contact;
ClcGroup *group;
- if (wParam == 0 || !FindItem(hwnd, dat, (HCONTACT)wParam, &contact, &group, NULL))
+ if (wParam == 0 || !FindItem(hwnd, dat, (HANDLE)wParam, &contact, &group, NULL))
return 0;
if (lParam)
@@ -48,7 +48,7 @@ LRESULT ProcessExternalMessages(HWND hwnd, struct ClcData *dat, UINT msg, WPARAM
case CLM_GETSTATUSMSG:
if (wParam) {
ClcContact *contact = NULL;
- if (!FindItem(hwnd, dat, (HCONTACT)wParam, &contact, NULL, NULL))
+ if (!FindItem(hwnd, dat, (HANDLE)wParam, &contact, NULL, NULL))
return 0;
if (contact->type != CLCIT_CONTACT)
@@ -67,7 +67,7 @@ LRESULT ProcessExternalMessages(HWND hwnd, struct ClcData *dat, UINT msg, WPARAM
case CLM_TOGGLEPRIORITYCONTACT:
if (wParam) {
ClcContact *contact = NULL;
- if (!FindItem(hwnd, dat, (HCONTACT)wParam, &contact, NULL, NULL))
+ if (!FindItem(hwnd, dat, (HANDLE)wParam, &contact, NULL, NULL))
return 0;
if (contact->type != CLCIT_CONTACT)
return 0;
@@ -80,7 +80,7 @@ LRESULT ProcessExternalMessages(HWND hwnd, struct ClcData *dat, UINT msg, WPARAM
case CLM_QUERYPRIORITYCONTACT:
if (wParam) {
ClcContact *contact = NULL;
- if (!FindItem(hwnd, dat, (HCONTACT)wParam, &contact, NULL, NULL))
+ if (!FindItem(hwnd, dat, (HANDLE)wParam, &contact, NULL, NULL))
return 0;
if (contact->type != CLCIT_CONTACT)
return 0;
diff --git a/plugins/Clist_nicer/src/clistmenus.cpp b/plugins/Clist_nicer/src/clistmenus.cpp
index a5d2ca8255..1fec1b1175 100644
--- a/plugins/Clist_nicer/src/clistmenus.cpp
+++ b/plugins/Clist_nicer/src/clistmenus.cpp
@@ -109,7 +109,7 @@ static INT_PTR CALLBACK IgnoreDialogProc(HWND hWnd, UINT msg, WPARAM wParam, LPA
SendDlgItemMessage(hWnd, IDC_SECONDLINEMODE, CB_INSERTSTRING, -1, (LPARAM)TranslateT("When needed by status message"));
if (cfg::clcdat) {
- FindItem(pcli->hwndContactTree, cfg::clcdat, hContact, &contact, NULL, NULL);
+ FindItem(pcli->hwndContactTree, cfg::clcdat, (HANDLE)hContact, &contact, NULL, NULL);
if (contact && contact->type != CLCIT_CONTACT) {
DestroyWindow(hWnd);
return FALSE;
@@ -189,9 +189,8 @@ static INT_PTR CALLBACK IgnoreDialogProc(HWND hWnd, UINT msg, WPARAM wParam, LPA
case IDC_IGN_ADDPERMANENTLY:
{
ADDCONTACTSTRUCT acs = {0};
- acs.handle = hContact;
+ acs.hContact = hContact;
acs.handleType = HANDLE_CONTACT;
- acs.szProto = 0;
CallService(MS_ADDCONTACT_SHOW, (WPARAM)hWnd, (LPARAM)&acs);
Utils::enableDlgControl(hWnd, IDC_IGN_ADDPERMANENTLY, cfg::getByte(hContact, "CList", "NotOnList", 0));
break;
@@ -221,7 +220,7 @@ static INT_PTR CALLBACK IgnoreDialogProc(HWND hWnd, UINT msg, WPARAM wParam, LPA
LRESULT checked = 0;
int i = 0;
- FindItem(pcli->hwndContactTree, cfg::clcdat, hContact, &contact, NULL, NULL);
+ FindItem(pcli->hwndContactTree, cfg::clcdat, (HANDLE)hContact, &contact, NULL, NULL);
if (iSel != CB_ERR) {
dwFlags &= ~(ECF_FORCEAVATAR | ECF_HIDEAVATAR);
@@ -308,8 +307,7 @@ static INT_PTR CALLBACK IgnoreDialogProc(HWND hWnd, UINT msg, WPARAM wParam, LPA
case WM_USER + 120: // set visibility status
{
ClcContact *contact = NULL;
-
- if (FindItem(pcli->hwndContactTree, cfg::clcdat, hContact, &contact, NULL, NULL)) {
+ if (FindItem(pcli->hwndContactTree, cfg::clcdat, (HANDLE)hContact, &contact, NULL, NULL)) {
if (contact) {
WORD wApparentMode = cfg::getWord(contact->hContact, contact->proto, "ApparentMode", 0);
@@ -323,7 +321,7 @@ static INT_PTR CALLBACK IgnoreDialogProc(HWND hWnd, UINT msg, WPARAM wParam, LPA
{
ClcContact *contact = NULL;
- if (FindItem(pcli->hwndContactTree, cfg::clcdat, hContact, &contact, NULL, NULL)) {
+ if (FindItem(pcli->hwndContactTree, cfg::clcdat, (HANDLE)hContact, &contact, NULL, NULL)) {
if (contact) {
WORD wApparentMode = 0, oldApparentMode = cfg::getWord(hContact, contact->proto, "ApparentMode", 0);