summaryrefslogtreecommitdiff
path: root/plugins/MetaContacts
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2014-02-10 08:04:30 +0000
committerGeorge Hazan <george.hazan@gmail.com>2014-02-10 08:04:30 +0000
commitddba4ede6b451d0cfcd0d32b5180fbd0689966bf (patch)
tree5d74f37a7013d13b92c182628d6b68a58e148ae4 /plugins/MetaContacts
parentc39340bf493a1745a41317bbf937fc7eb6cbb26a (diff)
- HANDLE hContact => HCONTACT
- GCF_* prefix was added to chat constants to avoid name conflicts git-svn-id: http://svn.miranda-ng.org/main/trunk@8078 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/MetaContacts')
-rw-r--r--plugins/MetaContacts/src/addto.cpp14
-rw-r--r--plugins/MetaContacts/src/edit.cpp35
-rw-r--r--plugins/MetaContacts/src/meta_api.cpp51
-rw-r--r--plugins/MetaContacts/src/meta_main.cpp2
-rw-r--r--plugins/MetaContacts/src/meta_menu.cpp48
-rwxr-xr-xplugins/MetaContacts/src/meta_services.cpp137
-rw-r--r--plugins/MetaContacts/src/meta_utils.cpp73
-rw-r--r--plugins/MetaContacts/src/metacontacts.h34
8 files changed, 189 insertions, 205 deletions
diff --git a/plugins/MetaContacts/src/addto.cpp b/plugins/MetaContacts/src/addto.cpp
index cd68607d51..40d3c30b86 100644
--- a/plugins/MetaContacts/src/addto.cpp
+++ b/plugins/MetaContacts/src/addto.cpp
@@ -56,7 +56,7 @@ int FillList(HWND list, BOOL sort)
int i=0;
// The DB is searched through, to get all the metacontacts
- for (HANDLE hMetaUser = db_find_first(); hMetaUser; hMetaUser = db_find_next(hMetaUser)) {
+ for (HCONTACT hMetaUser = db_find_first(); hMetaUser; hMetaUser = db_find_next(hMetaUser)) {
// if it's not a MetaContact, go to the next
if ( db_get_dw(hMetaUser, META_PROTO, META_ID, (DWORD)-1) == (DWORD)-1)
continue;
@@ -124,7 +124,7 @@ INT_PTR CALLBACK Meta_SelectDialogProc(HWND hwndDlg, UINT msg, WPARAM wParam, LP
case WM_INITDIALOG:
TranslateDialogDefault( hwndDlg );
- if ( db_get_dw((HANDLE)lParam, META_PROTO, META_ID, (DWORD)-1) != (DWORD)-1) {
+ if ( db_get_dw((HCONTACT)lParam, META_PROTO, META_ID, (DWORD)-1) != (DWORD)-1) {
MessageBox(hwndDlg,
TranslateT("This contact is a MetaContact.\nYou can't add a MetaContact to another MetaContact.\n\nPlease choose another."),
TranslateT("MetaContact Conflict"),MB_ICONERROR);
@@ -132,7 +132,7 @@ INT_PTR CALLBACK Meta_SelectDialogProc(HWND hwndDlg, UINT msg, WPARAM wParam, LP
return TRUE;
}
- if ( db_get_dw((HANDLE)lParam, META_PROTO, META_LINK, (DWORD)-1) != (DWORD)-1) {
+ if ( db_get_dw((HCONTACT)lParam, META_PROTO, META_LINK, (DWORD)-1) != (DWORD)-1) {
MessageBox(hwndDlg,
TranslateT("This contact is already associated to a MetaContact.\nYou cannot add a contact to multiple MetaContacts."),
TranslateT("Multiple MetaContacts"),MB_ICONERROR);
@@ -155,7 +155,7 @@ INT_PTR CALLBACK Meta_SelectDialogProc(HWND hwndDlg, UINT msg, WPARAM wParam, LP
}
else {
// get contact display name from clist
- TCHAR *ptszCDN = pcli->pfnGetContactDisplayName((HANDLE)lParam, GCDNF_TCHAR);
+ TCHAR *ptszCDN = pcli->pfnGetContactDisplayName((HCONTACT)lParam, GCDNF_TCHAR);
if (!ptszCDN)
ptszCDN = TranslateT("a contact");
@@ -178,9 +178,9 @@ INT_PTR CALLBACK Meta_SelectDialogProc(HWND hwndDlg, UINT msg, WPARAM wParam, LP
if (item == -1)
return IDOK == MessageBox(hwndDlg, TranslateT("Please select a MetaContact"), TranslateT("No MetaContact selected"), MB_ICONHAND);
- HANDLE hContact = (HANDLE)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
- HANDLE hMeta = (HANDLE)SendMessage(GetDlgItem(hwndDlg, IDC_METALIST), LB_GETITEMDATA, (WPARAM)item, 0);
- if ( !Meta_Assign(hContact,hMeta, FALSE))
+ HCONTACT hContact = (HCONTACT)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
+ HCONTACT hMeta = (HCONTACT)SendMessage(GetDlgItem(hwndDlg, IDC_METALIST), LB_GETITEMDATA, (WPARAM)item, 0);
+ if (!Meta_Assign(hContact, hMeta, FALSE))
MessageBox(hwndDlg, TranslateT("Assignment to the MetaContact failed."), TranslateT("Assignment failure"),MB_ICONERROR);
}
case IDCANCEL:
diff --git a/plugins/MetaContacts/src/edit.cpp b/plugins/MetaContacts/src/edit.cpp
index f5977e27c2..859ad8aafd 100644
--- a/plugins/MetaContacts/src/edit.cpp
+++ b/plugins/MetaContacts/src/edit.cpp
@@ -29,13 +29,13 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
//! Holds the differents changes that have to made
typedef struct tag_CHANGES {
- HANDLE hMeta; //!< \c HANDLE of the MetaContact that is edited.
- HANDLE hDefaultContact; //!< \c HANDLE of the new default contact
- HANDLE hOfflineContact;
+ HCONTACT hMeta; //!< \c HANDLE of the MetaContact that is edited.
+ HCONTACT hDefaultContact; //!< \c HANDLE of the new default contact
+ HCONTACT hOfflineContact;
int num_deleted, //!< \c DWORD number of deleted contacts
num_contacts; //!< \c DWORD number of contacts
- HANDLE hDeletedContacts[MAX_CONTACTS]; //!< \c HANDLEs of the subcontacts to be removed from this metacontact
- HANDLE hContact[MAX_CONTACTS]; //!< \c HANDLEs of the subcontacts, in the order they should be in
+ HCONTACT hDeletedContacts[MAX_CONTACTS]; //!< \c HANDLEs of the subcontacts to be removed from this metacontact
+ HCONTACT hContact[MAX_CONTACTS]; //!< \c HANDLEs of the subcontacts, in the order they should be in
int force_default;
} CHANGES;
@@ -134,7 +134,6 @@ void SetListSelection(HWND hList, int sel)
void ApplyChanges(CHANGES *chg)
{
- HANDLE most_online;
int i;
// remove removed contacts
@@ -168,7 +167,7 @@ void ApplyChanges(CHANGES *chg)
db_set_dw(chg->hMeta, META_PROTO, "OfflineSend", (DWORD)-1);
// fix nick
- most_online = Meta_GetMostOnline(chg->hMeta);
+ HCONTACT most_online = Meta_GetMostOnline(chg->hMeta);
Meta_CopyContactNick(chg->hMeta, most_online);
// fix status
@@ -271,17 +270,17 @@ INT_PTR CALLBACK Meta_EditDialogProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR
EnableWindow(GetDlgItem(hwndDlg, IDC_BTN_UP), FALSE);
EnableWindow(GetDlgItem(hwndDlg, IDC_BTN_DOWN), FALSE);
- int nb_contacts = db_get_dw((HANDLE)lParam, META_PROTO, "NumContacts", 0);
- int default_contact_number = db_get_dw((HANDLE)lParam, META_PROTO, "Default", (DWORD)-1);
- int offline_contact_number = db_get_dw((HANDLE)lParam, META_PROTO, "OfflineSend", (DWORD)-1);
+ int nb_contacts = db_get_dw((HCONTACT)lParam, META_PROTO, "NumContacts", 0);
+ int default_contact_number = db_get_dw((HCONTACT)lParam, META_PROTO, "Default", (DWORD)-1);
+ int offline_contact_number = db_get_dw((HCONTACT)lParam, META_PROTO, "OfflineSend", (DWORD)-1);
- changes.hMeta = (HANDLE)lParam;
+ changes.hMeta = (HCONTACT)lParam;
changes.num_contacts = nb_contacts;
changes.num_deleted = 0;
- changes.hDefaultContact = Meta_GetContactHandle((HANDLE)lParam, default_contact_number);
- changes.hOfflineContact = Meta_GetContactHandle((HANDLE)lParam, offline_contact_number);
+ changes.hDefaultContact = Meta_GetContactHandle((HCONTACT)lParam, default_contact_number);
+ changes.hOfflineContact = Meta_GetContactHandle((HCONTACT)lParam, offline_contact_number);
for (i = 0; i < nb_contacts; i++)
- changes.hContact[i] = Meta_GetContactHandle((HANDLE)lParam, i);
+ changes.hContact[i] = Meta_GetContactHandle((HCONTACT)lParam, i);
changes.force_default = MetaAPI_GetForceState((WPARAM)lParam, 0);
SendMessage(hwndDlg, WMU_SETTITLE, 0, lParam);
@@ -294,7 +293,7 @@ INT_PTR CALLBACK Meta_EditDialogProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR
case WMU_SETTITLE:
{
- TCHAR *ptszCDN = pcli->pfnGetContactDisplayName((HANDLE)lParam, GCDNF_TCHAR);
+ TCHAR *ptszCDN = pcli->pfnGetContactDisplayName((HCONTACT)lParam, GCDNF_TCHAR);
if (ptszCDN == NULL)
ptszCDN = TranslateT("(Unknown Contact)");
@@ -414,9 +413,9 @@ INT_PTR CALLBACK Meta_EditDialogProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR
hwnd = GetDlgItem(hwndDlg, IDC_LST_CONTACTS);
sel = ListView_GetNextItem(hwnd, -1, LVNI_FOCUSED | LVNI_SELECTED);
{
- HANDLE temp = changes.hContact[sel];
+ HCONTACT temp = changes.hContact[sel];
changes.hContact[sel] = changes.hContact[sel - 1];
- changes.hContact[sel - 1] = temp;
+ changes.hContact[sel-1] = temp;
}
FillContactList(hwndDlg, &changes);
sel--;
@@ -431,7 +430,7 @@ INT_PTR CALLBACK Meta_EditDialogProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR
hwnd = GetDlgItem(hwndDlg, IDC_LST_CONTACTS);
sel = ListView_GetNextItem(hwnd, -1, LVNI_FOCUSED | LVNI_SELECTED);
{
- HANDLE temp = changes.hContact[sel];
+ HCONTACT temp = changes.hContact[sel];
changes.hContact[sel] = changes.hContact[sel + 1];
changes.hContact[sel + 1] = temp;
}
diff --git a/plugins/MetaContacts/src/meta_api.cpp b/plugins/MetaContacts/src/meta_api.cpp
index 8835733c15..77a09a6a4a 100644
--- a/plugins/MetaContacts/src/meta_api.cpp
+++ b/plugins/MetaContacts/src/meta_api.cpp
@@ -32,7 +32,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
//lParam=0
//returns a handle to the parent metacontact, or null if this contact is not a subcontact
INT_PTR MetaAPI_GetMeta(WPARAM wParam, LPARAM lParam) {
- return (INT_PTR)(HANDLE)db_get_dw((HANDLE)wParam, META_PROTO, "Handle", 0);
+ return (INT_PTR)(HANDLE)db_get_dw((HCONTACT)wParam, META_PROTO, "Handle", 0);
}
//gets the handle for the default contact
@@ -40,9 +40,9 @@ INT_PTR MetaAPI_GetMeta(WPARAM wParam, LPARAM lParam) {
//lParam=0
//returns a handle to the default contact, or null on failure
INT_PTR MetaAPI_GetDefault(WPARAM wParam, LPARAM lParam) {
- DWORD default_contact_number = db_get_dw((HANDLE)wParam, META_PROTO, "Default", -1);
+ DWORD default_contact_number = db_get_dw((HCONTACT)wParam, META_PROTO, "Default", -1);
if (default_contact_number != -1) {
- return (INT_PTR)Meta_GetContactHandle((HANDLE)wParam, default_contact_number);
+ return (INT_PTR)Meta_GetContactHandle((HCONTACT)wParam, default_contact_number);
}
return 0;
}
@@ -52,7 +52,7 @@ INT_PTR MetaAPI_GetDefault(WPARAM wParam, LPARAM lParam) {
//lParam=0
//returns a DWORD contact number, or -1 on failure
INT_PTR MetaAPI_GetDefaultNum(WPARAM wParam, LPARAM lParam) {
- return db_get_dw((HANDLE)wParam, META_PROTO, "Default", -1);
+ return db_get_dw((HCONTACT)wParam, META_PROTO, "Default", -1);
}
//gets the handle for the 'most online' contact
@@ -60,7 +60,7 @@ INT_PTR MetaAPI_GetDefaultNum(WPARAM wParam, LPARAM lParam) {
//lParam=0
//returns a handle to the 'most online' contact
INT_PTR MetaAPI_GetMostOnline(WPARAM wParam, LPARAM lParam) {
- return (INT_PTR)Meta_GetMostOnline((HANDLE)wParam);
+ return (INT_PTR)Meta_GetMostOnline((HCONTACT)wParam);
}
//gets the number of subcontacts for a metacontact
@@ -68,7 +68,7 @@ INT_PTR MetaAPI_GetMostOnline(WPARAM wParam, LPARAM lParam) {
//lParam=0
//returns a DWORD representing the number of subcontacts for the given metacontact
INT_PTR MetaAPI_GetNumContacts(WPARAM wParam, LPARAM lParam) {
- DWORD num_contacts = db_get_dw((HANDLE)wParam, META_PROTO, "NumContacts", -1);
+ DWORD num_contacts = db_get_dw((HCONTACT)wParam, META_PROTO, "NumContacts", -1);
return num_contacts;
}
@@ -77,7 +77,7 @@ INT_PTR MetaAPI_GetNumContacts(WPARAM wParam, LPARAM lParam) {
//lParam=(DWORD)contact number
//returns a handle to the specified subcontact
INT_PTR MetaAPI_GetContact(WPARAM wParam, LPARAM lParam) {
- return (INT_PTR)Meta_GetContactHandle((HANDLE)wParam, (DWORD)lParam);
+ return (INT_PTR)Meta_GetContactHandle((HCONTACT)wParam, (DWORD)lParam);
}
//sets the default contact, using the subcontact's contact number
@@ -85,15 +85,15 @@ INT_PTR MetaAPI_GetContact(WPARAM wParam, LPARAM lParam) {
//lParam=(DWORD)contact number
//returns 0 on success
INT_PTR MetaAPI_SetDefaultContactNum(WPARAM wParam, LPARAM lParam) {
- DWORD num_contacts = db_get_dw((HANDLE)wParam, META_PROTO, "NumContacts", -1);
+ DWORD num_contacts = db_get_dw((HCONTACT)wParam, META_PROTO, "NumContacts", -1);
if (num_contacts == -1)
return 1;
if ((DWORD)lParam >= num_contacts || (DWORD)lParam < 0)
return 1;
- if (db_set_dw((HANDLE)wParam, META_PROTO, "Default", (DWORD)lParam))
+ if (db_set_dw((HCONTACT)wParam, META_PROTO, "Default", (DWORD)lParam))
return 1;
- NotifyEventHooks(hEventDefaultChanged, wParam, (LPARAM)Meta_GetContactHandle((HANDLE)wParam, (int)lParam));
+ NotifyEventHooks(hEventDefaultChanged, wParam, (LPARAM)Meta_GetContactHandle((HCONTACT)wParam, (int)lParam));
return 0;
}
@@ -102,8 +102,8 @@ INT_PTR MetaAPI_SetDefaultContactNum(WPARAM wParam, LPARAM lParam) {
//lParam=(HANDLE)hSubcontact
//returns 0 on success
INT_PTR MetaAPI_SetDefaultContact(WPARAM wParam, LPARAM lParam) {
- HANDLE hMeta = (HANDLE)db_get_dw((HANDLE)lParam, META_PROTO, "Handle", 0);
- DWORD contact_number = Meta_GetContactNumber((HANDLE)lParam);
+ HCONTACT hMeta = (HCONTACT)db_get_dw((HCONTACT)lParam, META_PROTO, "Handle", 0);
+ DWORD contact_number = Meta_GetContactNumber((HCONTACT)lParam);
if (contact_number == -1 || !hMeta || hMeta != (HANDLE)wParam)
return 1;
if (db_set_dw(hMeta, META_PROTO, "Default", contact_number))
@@ -118,9 +118,9 @@ INT_PTR MetaAPI_SetDefaultContact(WPARAM wParam, LPARAM lParam) {
//lParam=(DWORD)contact number
//returns 0 on success
INT_PTR MetaAPI_ForceSendContactNum(WPARAM wParam, LPARAM lParam) {
- HANDLE hContact = Meta_GetContactHandle((HANDLE)wParam, (int)lParam);
- HANDLE hMeta = (HANDLE)db_get_dw(hContact, META_PROTO, "Handle", 0);
- if ( !hContact || !hMeta || hMeta != (HANDLE)wParam || db_get_b(hMeta, META_PROTO, "ForceDefault", 0))
+ HCONTACT hContact = Meta_GetContactHandle((HCONTACT)wParam, (int)lParam);
+ HCONTACT hMeta = (HCONTACT)db_get_dw(hContact, META_PROTO, "Handle", 0);
+ if (!hContact || !hMeta || hMeta != (HANDLE)wParam || db_get_b(hMeta, META_PROTO, "ForceDefault", 0))
return 1;
db_set_dw(hMeta, META_PROTO, "ForceSend", (DWORD)hContact);
@@ -134,8 +134,8 @@ INT_PTR MetaAPI_ForceSendContactNum(WPARAM wParam, LPARAM lParam) {
//lParam=(HANDLE)hSubcontact
//returns 0 on success (will fail if 'force default' is in effect)
INT_PTR MetaAPI_ForceSendContact(WPARAM wParam, LPARAM lParam) {
- HANDLE hContact = (HANDLE)lParam;
- HANDLE hMeta = (HANDLE)db_get_dw(hContact, META_PROTO, "Handle", 0);
+ HCONTACT hContact = (HCONTACT)lParam;
+ HCONTACT hMeta = (HCONTACT)db_get_dw(hContact, META_PROTO, "Handle", 0);
if ( !hContact || !hMeta || hMeta != (HANDLE)wParam || db_get_b(hMeta, META_PROTO, "ForceDefault", 0))
return 1;
@@ -150,10 +150,10 @@ INT_PTR MetaAPI_ForceSendContact(WPARAM wParam, LPARAM lParam) {
//lParam=0
//returns 0 on success (will fail if 'force default' is in effect)
INT_PTR MetaAPI_UnforceSendContact(WPARAM wParam, LPARAM lParam) {
- if (db_get_b((HANDLE)wParam, META_PROTO, "ForceDefault", 0))
+ if (db_get_b((HCONTACT)wParam, META_PROTO, "ForceDefault", 0))
return 1;
- db_set_dw((HANDLE)wParam, META_PROTO, "ForceSend", 0);
+ db_set_dw((HCONTACT)wParam, META_PROTO, "ForceSend", 0);
NotifyEventHooks(hEventUnforceSend, wParam, lParam);
return 0;
@@ -169,7 +169,7 @@ INT_PTR MetaAPI_UnforceSendContact(WPARAM wParam, LPARAM lParam) {
INT_PTR MetaAPI_ForceDefault(WPARAM wParam, LPARAM lParam) {
// forward to menu function
Meta_ForceDefault(wParam, lParam);
- return db_get_b((HANDLE)wParam, META_PROTO, "ForceDefault", 0);
+ return db_get_b((HCONTACT)wParam, META_PROTO, "ForceDefault", 0);
}
// method to get state of 'force' for a metacontact
@@ -179,18 +179,15 @@ INT_PTR MetaAPI_ForceDefault(WPARAM wParam, LPARAM lParam) {
// or if none is in force, the value (DWORD)-1 will be copied
// (v0.8.0.8+ returns 1 if 'force default' is true with *lParam == default contact number, else returns 0 with *lParam as above)
INT_PTR MetaAPI_GetForceState(WPARAM wParam, LPARAM lParam) {
- HANDLE hMeta = (HANDLE)wParam;
- HANDLE hContact;
-
+ HCONTACT hMeta = (HCONTACT)wParam;
if ( !hMeta) return 0;
if (db_get_b(hMeta, META_PROTO, "ForceDefault", 0)) {
- if (lParam) *(DWORD *)lParam = db_get_dw((HANDLE)wParam, META_PROTO, "Default", -1);
+ if (lParam) *(DWORD *)lParam = db_get_dw((HCONTACT)wParam, META_PROTO, "Default", -1);
return 1;
}
- hContact = (HANDLE)db_get_dw(hMeta, META_PROTO, "ForceSend", 0);
-
+ HCONTACT hContact = (HCONTACT)db_get_dw(hMeta, META_PROTO, "ForceSend", 0);
if ( !hContact) {
if (lParam) *(DWORD *)lParam = -1;
} else {
@@ -219,7 +216,7 @@ INT_PTR MetaAPI_ConvertToMeta(WPARAM wParam, LPARAM lParam) {
// lParam=(HANDLE)hMeta
// add an existing contact to a metacontact
INT_PTR MetaAPI_AddToMeta(WPARAM wParam, LPARAM lParam) {
- return Meta_Assign((HANDLE)wParam, (HANDLE)lParam, FALSE);
+ return Meta_Assign((HCONTACT)wParam, (HCONTACT)lParam, FALSE);
}
// added 0.9.5.0 (22/3/05)
diff --git a/plugins/MetaContacts/src/meta_main.cpp b/plugins/MetaContacts/src/meta_main.cpp
index cdd2b6f20f..f251c1020d 100644
--- a/plugins/MetaContacts/src/meta_main.cpp
+++ b/plugins/MetaContacts/src/meta_main.cpp
@@ -151,7 +151,7 @@ extern "C" __declspec(dllexport) int Load(void)
db_set_resident(META_PROTO, "WindowOpen");
//set all contacts to 'offline', and initialize subcontact counter for db consistency check
- for (HANDLE hContact = db_find_first(META_PROTO); hContact; hContact = db_find_next(hContact, META_PROTO)) {
+ for (HCONTACT hContact = db_find_first(META_PROTO); hContact; hContact = db_find_next(hContact, META_PROTO)) {
db_set_w(hContact, META_PROTO, "Status", ID_STATUS_OFFLINE);
db_set_dw(hContact, META_PROTO, "IdleTS", 0);
db_set_b(hContact, META_PROTO, "ContactCountCheck", 0);
diff --git a/plugins/MetaContacts/src/meta_menu.cpp b/plugins/MetaContacts/src/meta_menu.cpp
index fecb0520fe..53ed386ff6 100644
--- a/plugins/MetaContacts/src/meta_menu.cpp
+++ b/plugins/MetaContacts/src/meta_menu.cpp
@@ -42,13 +42,13 @@ INT_PTR Meta_Convert(WPARAM wParam, LPARAM lParam)
char *group = 0;
// Get some information about the selected contact.
- if ( !db_get_utf((HANDLE)wParam, "CList", "Group", &dbv)) {
+ if ( !db_get_utf((HCONTACT)wParam, "CList", "Group", &dbv)) {
group = _strdup(dbv.pszVal);
db_free(&dbv);
}
// Create a new metacontact
- HANDLE hMetaContact = (HANDLE)CallService(MS_DB_CONTACT_ADD,0,0);
+ HCONTACT hMetaContact = (HCONTACT)CallService(MS_DB_CONTACT_ADD,0,0);
if (hMetaContact) {
db_set_dw(hMetaContact, META_PROTO, META_ID,nextMetaID);
db_set_dw(hMetaContact, META_PROTO, "NumContacts",0);
@@ -61,7 +61,7 @@ INT_PTR Meta_Convert(WPARAM wParam, LPARAM lParam)
db_set_utf(hMetaContact, "CList", "Group", group);
// Assign the contact to the MetaContact just created (and make default).
- if ( !Meta_Assign((HANDLE)wParam, hMetaContact, TRUE)) {
+ if ( !Meta_Assign((HCONTACT)wParam, hMetaContact, TRUE)) {
MessageBox(0, TranslateT("There was a problem in assigning the contact to the MetaContact"), TranslateT("Error"), MB_ICONEXCLAMATION);
CallService(MS_DB_CONTACT_DELETE, (WPARAM)hMetaContact, 0);
return 0;
@@ -106,7 +106,7 @@ INT_PTR Meta_Edit(WPARAM wParam,LPARAM lParam)
return 0;
}
-void Meta_RemoveContactNumber(HANDLE hMeta, int number)
+void Meta_RemoveContactNumber(HCONTACT hMeta, int number)
{
int num_contacts = db_get_dw(hMeta, META_PROTO, "NumContacts", 0);
int default_contact = db_get_dw(hMeta, META_PROTO, "Default", -1);
@@ -114,7 +114,7 @@ void Meta_RemoveContactNumber(HANDLE hMeta, int number)
return;
// get the handle
- HANDLE hContact = Meta_GetContactHandle(hMeta, number);
+ HCONTACT hContact = Meta_GetContactHandle(hMeta, number);
// make sure this contact thinks it's part of this metacontact
if ((HANDLE)db_get_dw(hContact, META_PROTO, "Handle", 0) == hMeta) {
@@ -207,7 +207,7 @@ INT_PTR Meta_Delete(WPARAM wParam,LPARAM lParam)
DWORD metaID;
// The wParam is a metacontact
- if ((metaID = db_get_dw((HANDLE)wParam, META_PROTO, META_ID, (DWORD)-1)) != (DWORD)-1) {
+ if ((metaID = db_get_dw((HCONTACT)wParam, META_PROTO, META_ID, (DWORD)-1)) != (DWORD)-1) {
if ( !lParam) { // check from recursion - see second half of this function
if ( MessageBox((HWND)CallService(MS_CLUI_GETHWND,0,0),
TranslateT("This will remove the MetaContact permanently.\n\nProceed Anyway?"),
@@ -215,7 +215,7 @@ INT_PTR Meta_Delete(WPARAM wParam,LPARAM lParam)
return 0;
}
- for (HANDLE hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
+ for (HCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
// This contact is assigned to the MetaContact that will be deleted, clear the "MetaContacts" information
if ( db_get_dw(hContact, META_PROTO, META_LINK,(DWORD)-1) == metaID) {
db_unset(hContact, META_PROTO, "IsSubcontact");
@@ -237,7 +237,7 @@ INT_PTR Meta_Delete(WPARAM wParam,LPARAM lParam)
CallService(MS_DB_CONTACT_DELETE,wParam,0);
}
else {
- HANDLE hMeta = (HANDLE)db_get_dw((HANDLE)wParam, META_PROTO, "Handle", 0);
+ HCONTACT hMeta = (HCONTACT)db_get_dw((HCONTACT)wParam, META_PROTO, "Handle", 0);
DWORD num_contacts = db_get_dw(hMeta, META_PROTO, "NumContacts", -1);
if (num_contacts == 1) {
@@ -247,7 +247,7 @@ INT_PTR Meta_Delete(WPARAM wParam,LPARAM lParam)
return 0;
}
- Meta_RemoveContactNumber(hMeta, db_get_dw((HANDLE)wParam, META_PROTO, "ContactNumber", -1));
+ Meta_RemoveContactNumber(hMeta, db_get_dw((HCONTACT)wParam, META_PROTO, "ContactNumber", -1));
}
return 0;
}
@@ -262,12 +262,12 @@ INT_PTR Meta_Delete(WPARAM wParam,LPARAM lParam)
*/
INT_PTR Meta_Default(WPARAM wParam,LPARAM lParam)
{
- HANDLE hMeta;
+ HCONTACT hMeta;
// the wParam is a subcontact
- if ((hMeta = (HANDLE)db_get_dw((HANDLE)wParam, META_PROTO, "Handle",0)) != 0) {
- db_set_dw(hMeta, META_PROTO, "Default", (DWORD)Meta_GetContactNumber((HANDLE)wParam));
- NotifyEventHooks(hEventDefaultChanged, (WPARAM)hMeta, (LPARAM)(HANDLE)wParam);
+ if ((hMeta = (HCONTACT)db_get_dw((HCONTACT)wParam, META_PROTO, "Handle",0)) != 0) {
+ db_set_dw(hMeta, META_PROTO, "Default", (DWORD)Meta_GetContactNumber((HCONTACT)wParam));
+ NotifyEventHooks(hEventDefaultChanged, (WPARAM)hMeta, (LPARAM)wParam);
}
return 0;
}
@@ -284,15 +284,15 @@ INT_PTR Meta_Default(WPARAM wParam,LPARAM lParam)
INT_PTR Meta_ForceDefault(WPARAM wParam,LPARAM lParam)
{
// the wParam is a MetaContact
- if (db_get_dw((HANDLE)wParam, META_PROTO, META_ID, (DWORD)-1) != (DWORD)-1) {
- BOOL current = db_get_b((HANDLE)wParam, META_PROTO, "ForceDefault", 0);
+ if (db_get_dw((HCONTACT)wParam, META_PROTO, META_ID, (DWORD)-1) != (DWORD)-1) {
+ BOOL current = db_get_b((HCONTACT)wParam, META_PROTO, "ForceDefault", 0);
current = !current;
- db_set_b((HANDLE)wParam, META_PROTO, "ForceDefault", (BYTE)current);
+ db_set_b((HCONTACT)wParam, META_PROTO, "ForceDefault", (BYTE)current);
- db_set_dw((HANDLE)wParam, META_PROTO, "ForceSend", 0);
+ db_set_dw((HCONTACT)wParam, META_PROTO, "ForceSend", 0);
if (current)
- NotifyEventHooks(hEventForceSend, wParam, (LPARAM)Meta_GetContactHandle((HANDLE)wParam, db_get_dw((HANDLE)wParam, META_PROTO, "Default", -1)));
+ NotifyEventHooks(hEventForceSend, wParam, (LPARAM)Meta_GetContactHandle((HCONTACT)wParam, db_get_dw((HCONTACT)wParam, META_PROTO, "Default", -1)));
else
NotifyEventHooks(hEventUnforceSend, wParam, 0);
}
@@ -317,7 +317,7 @@ int Meta_ModifyMenu(WPARAM wParam, LPARAM lParam)
WORD status;
CLISTMENUITEM mi = { sizeof(mi) };
- if (db_get_dw((HANDLE)wParam, META_PROTO, META_ID,-1) != (DWORD)-1) {
+ if (db_get_dw((HCONTACT)wParam, META_PROTO, META_ID,-1) != (DWORD)-1) {
// save the mouse pos in case they open a subcontact menu
GetCursorPos(&menuMousePoint);
@@ -333,14 +333,14 @@ int Meta_ModifyMenu(WPARAM wParam, LPARAM lParam)
Menu_ModifyItem(hMenuDelete, &mi);
//show subcontact menu items
- int num_contacts = db_get_dw((HANDLE)wParam, META_PROTO, "NumContacts", 0);
+ int num_contacts = db_get_dw((HCONTACT)wParam, META_PROTO, "NumContacts", 0);
for (int i = 0; i < MAX_CONTACTS; i++) {
if (i >= num_contacts) {
Menu_ShowItem(hMenuContact[i], false);
continue;
}
- HANDLE hContact = Meta_GetContactHandle((HANDLE)wParam, i);
+ HCONTACT hContact = Meta_GetContactHandle((HCONTACT)wParam, i);
char *szProto = GetContactProto(hContact);
if ( !szProto)
status = ID_STATUS_OFFLINE;
@@ -351,7 +351,7 @@ int Meta_ModifyMenu(WPARAM wParam, LPARAM lParam)
strcpy(buf, "Login");
strcat(buf, _itoa(i, idStr, 10));
- db_get((HANDLE)wParam, META_PROTO, buf, &dbv);
+ db_get((HCONTACT)wParam, META_PROTO, buf, &dbv);
switch(dbv.type) {
case DBVT_ASCIIZ:
mir_snprintf(buf,512,"%s",dbv.pszVal);
@@ -391,7 +391,7 @@ int Meta_ModifyMenu(WPARAM wParam, LPARAM lParam)
// wParam = char *szProto
// lParam = BOOL show
char serviceFunc[256];
- mir_snprintf(serviceFunc, 256, "%s%s", GetContactProto( Meta_GetMostOnline((HANDLE)wParam)), PS_SEND_NUDGE);
+ mir_snprintf(serviceFunc, 256, "%s%s", GetContactProto( Meta_GetMostOnline((HCONTACT)wParam)), PS_SEND_NUDGE);
CallService(MS_NUDGE_SHOWMENU, (WPARAM)META_PROTO, (LPARAM)ServiceExists(serviceFunc));
}
else { // This is a simple contact
@@ -403,7 +403,7 @@ int Meta_ModifyMenu(WPARAM wParam, LPARAM lParam)
Menu_ShowItem(hMenuConvert, false);
Menu_ShowItem(hMenuEdit, false);
}
- else if (db_get_dw((HANDLE)wParam, META_PROTO, META_LINK,(DWORD)-1)!=(DWORD)-1) {
+ else if (db_get_dw((HCONTACT)wParam, META_PROTO, META_LINK,(DWORD)-1)!=(DWORD)-1) {
// The contact is affected to a metacontact.
Menu_ShowItem(hMenuDefault, true);
diff --git a/plugins/MetaContacts/src/meta_services.cpp b/plugins/MetaContacts/src/meta_services.cpp
index 2f5aad2654..f829412474 100755
--- a/plugins/MetaContacts/src/meta_services.cpp
+++ b/plugins/MetaContacts/src/meta_services.cpp
@@ -190,10 +190,10 @@ INT_PTR Meta_GetStatus(WPARAM wParam,LPARAM lParam)
struct TFakeAckParams
{
- HANDLE hEvent;
- HANDLE hContact;
- LONG id;
- char msg[512];
+ HANDLE hEvent;
+ HCONTACT hContact;
+ LONG id;
+ char msg[512];
};
static DWORD CALLBACK sttFakeAckFail( LPVOID param )
@@ -202,7 +202,7 @@ static DWORD CALLBACK sttFakeAckFail( LPVOID param )
WaitForSingleObject( tParam->hEvent, INFINITE );
Sleep( 100 );
- ProtoBroadcastAck(META_PROTO, tParam->hContact, ACKTYPE_MESSAGE, ACKRESULT_FAILED, ( HANDLE )tParam->id, (WPARAM)tParam->msg );
+ ProtoBroadcastAck(META_PROTO, tParam->hContact, ACKTYPE_MESSAGE, ACKRESULT_FAILED, (HANDLE)tParam->id, (WPARAM)tParam->msg );
CloseHandle( tParam->hEvent );
mir_free(tParam);
@@ -222,9 +222,9 @@ static DWORD CALLBACK sttFakeAckFail( LPVOID param )
INT_PTR MetaFilter_SendMessage(WPARAM wParam,LPARAM lParam)
{
CCSDATA *ccs = (CCSDATA*)lParam;
- HANDLE hMeta;
+ HCONTACT hMeta;
- if ((hMeta = (HANDLE)db_get_dw(ccs->hContact, META_PROTO, "Handle", 0)) == 0)
+ if ((hMeta = (HCONTACT)db_get_dw(ccs->hContact, META_PROTO, "Handle", 0)) == 0)
return CallService(MS_PROTO_CHAINSEND, wParam, lParam); // Can't find the MetaID of the metacontact linked to
// if subcontact sending, add db event to keep metacontact history correct
@@ -261,7 +261,7 @@ INT_PTR MetaFilter_SendMessage(WPARAM wParam,LPARAM lParam)
INT_PTR Meta_SendNudge(WPARAM wParam,LPARAM lParam)
{
- HANDLE hSubContact = Meta_GetMostOnline((HANDLE)wParam);
+ HCONTACT hSubContact = Meta_GetMostOnline((HCONTACT)wParam);
return ProtoCallService(GetContactProto(hSubContact), PS_SEND_NUDGE, (WPARAM)hSubContact, lParam);
}
@@ -289,7 +289,7 @@ INT_PTR Meta_SendMessage(WPARAM wParam,LPARAM lParam)
return CallService(MS_PROTO_CHAINSEND, wParam, lParam);
}
- HANDLE most_online = Meta_GetMostOnline(ccs->hContact);
+ HCONTACT most_online = Meta_GetMostOnline(ccs->hContact);
if ( !most_online) {
DWORD dwThreadId;
@@ -359,10 +359,10 @@ INT_PTR MetaFilter_RecvMessage(WPARAM wParam,LPARAM lParam)
DBEVENTINFO dbei;
CCSDATA *ccs = (CCSDATA*)lParam;
PROTORECVEVENT *pre = (PROTORECVEVENT *) ccs->lParam;
- HANDLE hMeta;
+ HCONTACT hMeta;
// Can't find the MetaID of the metacontact linked to this contact, let through the protocol chain
- if ((hMeta = (HANDLE)db_get_dw(ccs->hContact, META_PROTO, "Handle", 0)) == 0)
+ if ((hMeta = (HCONTACT)db_get_dw(ccs->hContact, META_PROTO, "Handle", 0)) == 0)
return CallService(MS_PROTO_CHAINRECV, wParam, (LPARAM)ccs);
if (options.set_default_on_recv) {
@@ -404,7 +404,7 @@ INT_PTR MetaFilter_RecvMessage(WPARAM wParam,LPARAM lParam)
// use the subcontact's protocol 'recv' service to add the meta's history (AIMOSCAR removes HTML here!) if possible
char *proto = GetContactProto(ccs->hContact);
if (proto) {
- HANDLE hSub = ccs->hContact;
+ HCONTACT hSub = ccs->hContact;
DWORD flags = pre->flags;
ccs->hContact = hMeta;
pre->flags |= (db_get_b(hMeta, META_PROTO, "WindowOpen", 0) ? 0 : PREF_CREATEREAD);
@@ -437,7 +437,7 @@ INT_PTR MetaFilter_RecvMessage(WPARAM wParam,LPARAM lParam)
return CallService(MS_PROTO_CHAINRECV, wParam, (LPARAM)ccs);
}
- HANDLE hSub = ccs->hContact;
+ HCONTACT hSub = ccs->hContact;
ccs->hContact = hMeta; // Forward to the associated MetaContact.
CallService(MS_PROTO_CHAINRECV, 0, (LPARAM)ccs);
ccs->hContact = hSub;
@@ -467,7 +467,7 @@ INT_PTR Meta_RecvMessage(WPARAM wParam, LPARAM lParam)
if (options.use_proto_recv) {
// use the subcontact's protocol to add the db if possible (AIMOSCAR removes HTML here!)
- HANDLE most_online = Meta_GetMostOnline(ccs->hContact);
+ HCONTACT most_online = Meta_GetMostOnline(ccs->hContact);
if (char *subProto = GetContactProto(most_online))
if ( ProtoCallService(subProto, PSR_MESSAGE, wParam, lParam) != CALLSERVICE_NOTFOUND)
return 0;
@@ -503,9 +503,9 @@ information about the ACK.
int Meta_HandleACK(WPARAM wParam, LPARAM lParam)
{
ACKDATA *ack = (ACKDATA*) lParam;
- HANDLE hUser;
+ HCONTACT hUser;
- if (ack->hContact == 0 || (hUser = (HANDLE)db_get_dw(ack->hContact, META_PROTO, "Handle",0)) == 0)
+ if (ack->hContact == 0 || (hUser = (HCONTACT)db_get_dw(ack->hContact, META_PROTO, "Handle",0)) == 0)
return 0; // Can't find the MetaID, let through the protocol chain
@@ -524,11 +524,10 @@ int Meta_HandleACK(WPARAM wParam, LPARAM lParam)
// change the hContact in the avatar info struct, if it's the avatar we're using - else drop it
if (ack->type == ACKTYPE_AVATAR) {
if (ack->result == ACKRESULT_SUCCESS || ack->result == ACKRESULT_FAILED || ack->result == ACKRESULT_STATUS) {
- HANDLE most_online;
DBVARIANT dbv;
// change avatar if the most online supporting avatars changes, or if we don't have one
- most_online = Meta_GetMostOnlineSupporting(hUser, PFLAGNUM_4, PF4_AVATARS);
+ HCONTACT most_online = Meta_GetMostOnlineSupporting(hUser, PFLAGNUM_4, PF4_AVATARS);
//if (AI.hContact == 0 || AI.hContact != most_online) {
if (ack->hContact == 0 || ack->hContact != most_online) {
return 0;
@@ -572,7 +571,7 @@ int Meta_SettingChanged(WPARAM wParam, LPARAM lParam)
DBCONTACTWRITESETTING *dcws = (DBCONTACTWRITESETTING *)lParam;
char buffer[512], szId[40];
int contact_number;
- HANDLE hMeta, most_online;
+ HCONTACT hMeta, most_online;
// hide metacontacts when groups disabled
if (wParam == 0
@@ -589,7 +588,7 @@ int Meta_SettingChanged(WPARAM wParam, LPARAM lParam)
// import process has just been run...call startup routines...
Meta_SetHandles();
- for (HANDLE hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
+ for (HCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
int meta_id;
if ((meta_id = db_get_dw(hContact, META_PROTO, META_ID,(DWORD)-1)) != (DWORD)-1)
Meta_CopyData(hContact);
@@ -602,22 +601,22 @@ int Meta_SettingChanged(WPARAM wParam, LPARAM lParam)
// from here on, we're just interested in contact settings
if (wParam == 0) return 0;
- if ((hMeta=(HANDLE)db_get_dw((HANDLE)wParam, META_PROTO, "Handle",0))!=0 && CallService(MS_DB_CONTACT_IS, (WPARAM)hMeta, 0)) // just to be safe
+ if ((hMeta=(HCONTACT)db_get_dw((HCONTACT)wParam, META_PROTO, "Handle",0))!=0 && CallService(MS_DB_CONTACT_IS, (WPARAM)hMeta, 0)) // just to be safe
{
// This contact is attached to a MetaContact.
- contact_number = Meta_GetContactNumber((HANDLE)wParam);
+ contact_number = Meta_GetContactNumber((HCONTACT)wParam);
if (contact_number == -1) return 0; // exit - db corruption
if ( !meta_group_hack_disabled && !strcmp(dcws->szModule, "CList") && !strcmp(dcws->szSetting, "Group") &&
- Meta_IsEnabled() && db_get_b((HANDLE)wParam, META_PROTO, "Hidden", 0) == 0 && !Miranda_Terminated()) {
+ Meta_IsEnabled() && db_get_b((HCONTACT)wParam, META_PROTO, "Hidden", 0) == 0 && !Miranda_Terminated()) {
if ((dcws->value.type == DBVT_ASCIIZ || dcws->value.type == DBVT_UTF8) && !Meta_IsHiddenGroup(dcws->value.pszVal)) {
// subcontact group reassigned - copy to saved group
- db_set((HANDLE)wParam, META_PROTO, "OldCListGroup", &dcws->value);
- db_set_s((HANDLE)wParam, "CList", "Group", META_HIDDEN_GROUP);
+ db_set((HCONTACT)wParam, META_PROTO, "OldCListGroup", &dcws->value);
+ db_set_s((HCONTACT)wParam, "CList", "Group", META_HIDDEN_GROUP);
} else if (dcws->value.type == DBVT_DELETED) {
- db_unset((HANDLE)wParam, META_PROTO, "OldCListGroup");
- db_set_s((HANDLE)wParam, "CList", "Group", META_HIDDEN_GROUP);
+ db_unset((HCONTACT)wParam, META_PROTO, "OldCListGroup");
+ db_set_s((HCONTACT)wParam, "CList", "Group", META_HIDDEN_GROUP);
}
}
else if ( !strcmp(dcws->szSetting, "IP")) {
@@ -650,15 +649,13 @@ int Meta_SettingChanged(WPARAM wParam, LPARAM lParam)
}
}
else if ( !strcmp(dcws->szSetting, "Nick") && !dcws->value.type == DBVT_DELETED) {
- HANDLE most_online;
-
// subcontact nick has changed - update metacontact
strcpy(buffer, "Nick");
strcat(buffer, _itoa(contact_number, szId, 10));
db_set(hMeta, META_PROTO, buffer, &dcws->value);
DBVARIANT dbv;
- if (Mydb_get((HANDLE)wParam, "CList", "MyHandle", &dbv)) {
+ if (Mydb_get((HCONTACT)wParam, "CList", "MyHandle", &dbv)) {
strcpy(buffer, "CListName");
strcat(buffer, _itoa(contact_number, szId, 10));
db_set(hMeta, META_PROTO, buffer, &dcws->value);
@@ -666,7 +663,7 @@ int Meta_SettingChanged(WPARAM wParam, LPARAM lParam)
else db_free(&dbv);
// copy nick to metacontact, if it's the most online
- most_online = Meta_GetMostOnline(hMeta);
+ HCONTACT most_online = Meta_GetMostOnline(hMeta);
Meta_CopyContactNick(hMeta, most_online);
return 0;
@@ -684,15 +681,13 @@ int Meta_SettingChanged(WPARAM wParam, LPARAM lParam)
db_set_dw(hMeta, META_PROTO, "LogonTS", 0);
}
else if ( !strcmp(dcws->szModule, "CList") && !strcmp(dcws->szSetting, "MyHandle")) {
- HANDLE most_online;
-
if (dcws->value.type == DBVT_DELETED) {
- char *proto = GetContactProto((HANDLE)wParam);
+ char *proto = GetContactProto((HCONTACT)wParam);
strcpy(buffer, "CListName");
strcat(buffer, _itoa(contact_number, szId, 10));
DBVARIANT dbv;
- if (proto && !Mydb_get((HANDLE)wParam, proto, "Nick", &dbv)) {
+ if (proto && !Mydb_get((HCONTACT)wParam, proto, "Nick", &dbv)) {
db_set(hMeta, META_PROTO, buffer, &dbv);
db_free(&dbv);
} else {
@@ -707,7 +702,7 @@ int Meta_SettingChanged(WPARAM wParam, LPARAM lParam)
}
// copy nick to metacontact, if it's the most online
- most_online = Meta_GetMostOnline(hMeta);
+ HCONTACT most_online = Meta_GetMostOnline(hMeta);
Meta_CopyContactNick(hMeta, most_online);
return 0;
@@ -757,11 +752,11 @@ int Meta_SettingChanged(WPARAM wParam, LPARAM lParam)
Meta_CopyData(hMeta);
}
else if ( !meta_group_hack_disabled && !strcmp(dcws->szModule, "CList") && !strcmp(dcws->szSetting, "Hidden")) {
- if ((dcws->value.type == DBVT_DELETED || db_get_b((HANDLE)wParam, "CList", "Hidden", 0) == 0)
- && db_get_b((HANDLE)wParam, META_PROTO, "Hidden", 0) == 1)
+ if ((dcws->value.type == DBVT_DELETED || db_get_b((HCONTACT)wParam, "CList", "Hidden", 0) == 0)
+ && db_get_b((HCONTACT)wParam, META_PROTO, "Hidden", 0) == 1)
{
// a subcontact we hid (e.g. jabber) has been unhidden - hide it again :(
- db_set_b((HANDLE)wParam, "CList", "Hidden", 1);
+ db_set_b((HCONTACT)wParam, "CList", "Hidden", 1);
}
}
}
@@ -772,21 +767,21 @@ int Meta_SettingChanged(WPARAM wParam, LPARAM lParam)
int Meta_ContactDeleted(WPARAM wParam, LPARAM lParam)
{
// is a subcontact - update meta contact
- HANDLE hMeta = (HANDLE)db_get_dw((HANDLE)wParam, META_PROTO, "Handle", 0);
+ HCONTACT hMeta = (HCONTACT)db_get_dw((HCONTACT)wParam, META_PROTO, "Handle", 0);
if (hMeta) {
- Meta_RemoveContactNumber(hMeta, db_get_dw((HANDLE)wParam, META_PROTO, "ContactNumber", -1));
+ Meta_RemoveContactNumber(hMeta, db_get_dw((HCONTACT)wParam, META_PROTO, "ContactNumber", -1));
NotifyEventHooks(hSubcontactsChanged, (WPARAM)hMeta, 0);
return 0;
}
// not a subcontact - is it a metacontact?
- int num_contacts = db_get_dw((HANDLE)wParam, META_PROTO, "NumContacts", 0);
+ int num_contacts = db_get_dw((HCONTACT)wParam, META_PROTO, "NumContacts", 0);
if (num_contacts)
NotifyEventHooks(hSubcontactsChanged, (WPARAM)wParam, 0);
// remove & restore all subcontacts
for (int i = 0; i < num_contacts; i++) {
- HANDLE hContact = Meta_GetContactHandle((HANDLE)wParam, i);
+ HCONTACT hContact = Meta_GetContactHandle((HCONTACT)wParam, i);
if (hContact && (HANDLE)db_get_dw(hContact, META_PROTO, "Handle", 0) == (HANDLE)wParam) {
if (db_get_b(hContact, META_PROTO, "IsSubcontact", 0) == 1)
db_unset(hContact, META_PROTO, "IsSubcontact");
@@ -812,13 +807,13 @@ int Meta_ContactDeleted(WPARAM wParam, LPARAM lParam)
INT_PTR Meta_UserIsTyping(WPARAM wParam, LPARAM lParam)
{
// This is a simple contact, let through the stack of protocols
- if (db_get_dw((HANDLE)wParam, META_PROTO, META_ID,(DWORD)-1) == (DWORD)-1)
+ if (db_get_dw((HCONTACT)wParam, META_PROTO, META_ID,(DWORD)-1) == (DWORD)-1)
return 0;
// forward to sending protocol, if supported
- HANDLE most_online = Meta_GetMostOnline((HANDLE)wParam);
- Meta_CopyContactNick((HANDLE)wParam, most_online);
+ HCONTACT most_online = Meta_GetMostOnline((HCONTACT)wParam);
+ Meta_CopyContactNick((HCONTACT)wParam, most_online);
if ( !most_online)
return 0;
@@ -837,8 +832,8 @@ INT_PTR Meta_UserIsTyping(WPARAM wParam, LPARAM lParam)
*/
int Meta_ContactIsTyping(WPARAM wParam, LPARAM lParam)
{
- HANDLE hMeta;
- if ((hMeta = (HANDLE)db_get_dw((HANDLE)wParam, META_PROTO, "Handle",0)) != 0 && Meta_IsEnabled()) {
+ HCONTACT hMeta;
+ if ((hMeta = (HCONTACT)db_get_dw((HCONTACT)wParam, META_PROTO, "Handle",0)) != 0 && Meta_IsEnabled()) {
// This contact is attached to a MetaContact.
if ( !options.subcontact_windows) { // we don't want clicking on the clist notification icon to open the metacontact message window
// try to remove any clist events we added for subcontact
@@ -860,12 +855,12 @@ int Meta_ContactIsTyping(WPARAM wParam, LPARAM lParam)
int Meta_UserInfo(WPARAM wParam, LPARAM lParam)
{
- DWORD default_contact_number = db_get_dw((HANDLE)lParam, META_PROTO, "Default", (DWORD)-1);
+ DWORD default_contact_number = db_get_dw((HCONTACT)lParam, META_PROTO, "Default", (DWORD)-1);
if (default_contact_number == -1) // not a meta contact
return 0;
- CallService(MS_USERINFO_SHOWDIALOG, (WPARAM)Meta_GetContactHandle((HANDLE)lParam, default_contact_number), 0);
+ CallService(MS_USERINFO_SHOWDIALOG, (WPARAM)Meta_GetContactHandle((HCONTACT)lParam, default_contact_number), 0);
return 1;
}
@@ -873,11 +868,11 @@ int Meta_UserInfo(WPARAM wParam, LPARAM lParam)
// let received messages through and add db history to metacontact, or vice versa
int Meta_MessageWindowEvent(WPARAM wParam, LPARAM lParam) {
MessageWindowEventData *mwed = (MessageWindowEventData *)lParam;
- HANDLE hMeta = 0;
+ HCONTACT hMeta = 0;
message_window_api_enabled = TRUE;
- if ((hMeta = (HANDLE)db_get_dw(mwed->hContact, META_PROTO, "Handle", 0)) != 0
+ if ((hMeta = (HCONTACT)db_get_dw(mwed->hContact, META_PROTO, "Handle", 0)) != 0
|| db_get_dw(mwed->hContact, META_PROTO, META_ID, (DWORD)-1) != (DWORD)-1)
{
// contact is subcontact of metacontact, or an actual metacontact - record whether window is open or closed
@@ -912,11 +907,11 @@ int Meta_MessageWindowEvent(WPARAM wParam, LPARAM lParam) {
int Meta_ClistDoubleClicked(WPARAM wParam, LPARAM lParam)
{
- if (db_get_dw((HANDLE)wParam, META_PROTO, "Default",(WORD)-1) == (WORD)-1)
+ if (db_get_dw((HCONTACT)wParam, META_PROTO, "Default",(WORD)-1) == (WORD)-1)
return 0;
// -1 indicates no specific capability but respect 'ForceDefault'
- HANDLE most_online = Meta_GetMostOnlineSupporting((HANDLE)wParam, PFLAGNUM_1, -1);
+ HCONTACT most_online = Meta_GetMostOnlineSupporting((HCONTACT)wParam, PFLAGNUM_1, -1);
if ( !most_online)
return 0;
@@ -949,7 +944,7 @@ int Meta_ClistDoubleClicked(WPARAM wParam, LPARAM lParam)
INT_PTR Meta_ClistMessageEventClicked(WPARAM wParam, LPARAM lParam)
{
- HANDLE hContact = ((CLISTEVENT *)lParam)->hContact;
+ HCONTACT hContact = ((CLISTEVENT *)lParam)->hContact;
return Meta_ClistDoubleClicked((WPARAM)hContact, (LPARAM)((CLISTEVENT *)lParam)->hDbEvent);
}
@@ -1046,7 +1041,7 @@ int Meta_ModulesLoaded(WPARAM wParam, LPARAM lParam)
// loop and copy data from subcontacts
if (options.copydata) {
int meta_id;
- for (HANDLE hContact = db_find_first(); hContact; hContact = db_find_next(hContact))
+ for (HCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact))
if ((meta_id = db_get_dw(hContact, META_PROTO, META_ID,(DWORD)-1))!=(DWORD)-1)
Meta_CopyData(hContact);
}
@@ -1098,7 +1093,7 @@ static VOID CALLBACK sttMenuThread( PVOID param )
INT_PTR Meta_ContactMenuFunc(WPARAM wParam, LPARAM lParam)
{
- HANDLE hContact = Meta_GetContactHandle((HANDLE)wParam, (int)lParam);
+ HCONTACT hContact = Meta_GetContactHandle((HCONTACT)wParam, (int)lParam);
if (options.menu_function == FT_MSG) {
// open message window if protocol supports message sending or chat, else simulate double click
@@ -1117,7 +1112,7 @@ INT_PTR Meta_ContactMenuFunc(WPARAM wParam, LPARAM lParam)
if ((caps & PF1_IMSEND) || (caps & PF1_CHAT) || (proto && strcmp(proto, "IRC") == 0)) {
// set default contact for sending/status and open message window
- db_set_dw((HANDLE)wParam, META_PROTO, "Default", (DWORD)(int)lParam);
+ db_set_dw((HCONTACT)wParam, META_PROTO, "Default", (DWORD)(int)lParam);
NotifyEventHooks(hEventDefaultChanged, wParam, (LPARAM)hContact);
CallService(MS_MSG_SENDMESSAGE, wParam, 0);
} else
@@ -1157,12 +1152,7 @@ INT_PTR Meta_FileSend(WPARAM wParam, LPARAM lParam)
}
else
{
- HANDLE most_online;
- //DBEVENTINFO dbei;
- //char szServiceName[100];
-
- most_online = Meta_GetMostOnlineSupporting(ccs->hContact, PFLAGNUM_1, PF1_FILESEND);
-
+ HCONTACT most_online = Meta_GetMostOnlineSupporting(ccs->hContact, PFLAGNUM_1, PF1_FILESEND);
if ( !most_online) {
//PUShowMessage("no most online for ft", SM_NOTIFY);
return 0;
@@ -1189,10 +1179,7 @@ INT_PTR Meta_GetAwayMsg(WPARAM wParam, LPARAM lParam)
}
else
{
- HANDLE most_online;
-
- most_online = Meta_GetMostOnlineSupporting(ccs->hContact, PFLAGNUM_1, PF1_MODEMSGRECV);
-
+ HCONTACT most_online = Meta_GetMostOnlineSupporting(ccs->hContact, PFLAGNUM_1, PF1_MODEMSGRECV);
if ( !most_online)
return 0;
@@ -1221,8 +1208,8 @@ INT_PTR Meta_GetAvatarInfo(WPARAM wParam, LPARAM lParam) {
}
else
{
- HANDLE hMeta = AI->hContact;
- HANDLE hSub = Meta_GetMostOnlineSupporting(AI->hContact, PFLAGNUM_4, PF4_AVATARS);
+ HCONTACT hMeta = AI->hContact;
+ HCONTACT hSub = Meta_GetMostOnlineSupporting(AI->hContact, PFLAGNUM_4, PF4_AVATARS);
if ( !hSub)
return GAIR_NOAVATAR;
@@ -1249,7 +1236,7 @@ INT_PTR Meta_GetInfo(WPARAM wParam, LPARAM lParam)
if ((default_contact_number = db_get_dw(ccs->hContact, META_PROTO, "Default",(DWORD)-1)) == (DWORD)-1)
return 0;
- HANDLE most_online = Meta_GetMostOnlineSupporting(ccs->hContact, PFLAGNUM_4, PF4_AVATARS);
+ HCONTACT most_online = Meta_GetMostOnlineSupporting(ccs->hContact, PFLAGNUM_4, PF4_AVATARS);
if ( !most_online)
return 0;
@@ -1305,16 +1292,16 @@ int Meta_OptInit(WPARAM wParam, LPARAM lParam)
int Meta_CallMostOnline(WPARAM wParam, LPARAM lParam)
{
- HANDLE most_online_im = Meta_GetMostOnline((HANDLE)wParam);
+ HCONTACT most_online_im = Meta_GetMostOnline((HCONTACT)wParam);
// fix nick
- Meta_CopyContactNick((HANDLE)wParam, most_online_im);
+ Meta_CopyContactNick((HCONTACT)wParam, most_online_im);
// fix status
- Meta_FixStatus((HANDLE)wParam);
+ Meta_FixStatus((HCONTACT)wParam);
// copy all other data
- Meta_CopyData((HANDLE) wParam);
+ Meta_CopyData((HCONTACT) wParam);
return 0;
}
diff --git a/plugins/MetaContacts/src/meta_utils.cpp b/plugins/MetaContacts/src/meta_utils.cpp
index 5a9130b585..cc2b70ce98 100644
--- a/plugins/MetaContacts/src/meta_utils.cpp
+++ b/plugins/MetaContacts/src/meta_utils.cpp
@@ -28,7 +28,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
HANDLE invisiGroup;
POINT menuMousePoint;
-INT_PTR Mydb_get(HANDLE hContact, const char *szModule, const char *szSetting, DBVARIANT *dbv)
+INT_PTR Mydb_get(HCONTACT hContact, const char *szModule, const char *szSetting, DBVARIANT *dbv)
{
memset(dbv, 0, sizeof(DBVARIANT));
return db_get_s(hContact, szModule, szSetting, dbv, 0);
@@ -86,7 +86,7 @@ int Meta_EqualDBV(DBVARIANT *dbv, DBVARIANT *id) {
* @return a \c HANDLE to the specified contact or \c NULL
if no contact has been found.
*/
-HANDLE Meta_GetHandle(const char *protocol, DBVARIANT *id)
+HCONTACT Meta_GetHandle(const char *protocol, DBVARIANT *id)
{
char *field;
DBVARIANT dbv;
@@ -98,7 +98,7 @@ HANDLE Meta_GetHandle(const char *protocol, DBVARIANT *id)
field = (char *)CallProtoService(protocol,PS_GETCAPS,PFLAG_UNIQUEIDSETTING,0);
- for (HANDLE hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
+ for (HCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
// Scan the database and retrieve the field for each contact
if ( !db_get(hContact, protocol, field, &dbv)) {
if (dbv.type == id->type) {
@@ -209,12 +209,12 @@ int Meta_SetNick(char *szProto)
*
* @return TRUE on success, FALSE otherwise
*/
-BOOL Meta_Assign(HANDLE src, HANDLE dest, BOOL set_as_default)
+BOOL Meta_Assign(HCONTACT src, HCONTACT dest, BOOL set_as_default)
{
DWORD metaID, num_contacts;
char buffer[512], szId[40];
WORD status;
- HANDLE most_online;
+ HCONTACT most_online;
if ((metaID = db_get_dw(dest, META_PROTO, META_ID,(DWORD)-1))==-1) {
MessageBox(0, TranslateT("Could not get MetaContact ID"), TranslateT("Assignment error"), MB_OK | MB_ICONWARNING);
@@ -377,7 +377,7 @@ BOOL Meta_Assign(HANDLE src, HANDLE dest, BOOL set_as_default)
* Convenience method - get most online contact supporting messaging
*
*/
-HANDLE Meta_GetMostOnline(HANDLE hMeta) {
+HCONTACT Meta_GetMostOnline(HCONTACT hMeta) {
return Meta_GetMostOnlineSupporting(hMeta, PFLAGNUM_1, PF1_IM);
}
/** Get the 'most online' contact for a meta contact (according to above order) which supports the specified
@@ -388,9 +388,9 @@ HANDLE Meta_GetMostOnline(HANDLE hMeta) {
* @return \c HANDLE to a contact
*/
-HANDLE Meta_GetMostOnlineSupporting(HANDLE hMeta, int pflagnum, unsigned long capability) {
+HCONTACT Meta_GetMostOnlineSupporting(HCONTACT hMeta, int pflagnum, unsigned long capability) {
int most_online_status = ID_STATUS_OFFLINE;
- HANDLE most_online_contact = NULL, hContact;
+ HCONTACT most_online_contact = NULL, hContact;
int i, status, default_contact_number, num_contacts;
unsigned long caps = 0;
char *szProto, *most_online_proto;
@@ -416,7 +416,7 @@ HANDLE Meta_GetMostOnlineSupporting(HANDLE hMeta, int pflagnum, unsigned long ca
return most_online_contact;
// a subcontact is being temporarily 'forced' to do sending
- if ((most_online_contact = (HANDLE)db_get_dw(hMeta, META_PROTO, "ForceSend", 0))) {
+ if ((most_online_contact = (HCONTACT)db_get_dw(hMeta, META_PROTO, "ForceSend", 0))) {
caps = szProto ? CallProtoService(szProto, PS_GETCAPS, (WPARAM)pflagnum, 0) : 0;
if (szProto && strcmp(szProto, "IRC") == 0) caps |= PF1_IM;
if (szProto && (caps & capability) == capability && capability != 0) // capability is 0 when we're working out status
@@ -477,7 +477,7 @@ HANDLE Meta_GetMostOnlineSupporting(HANDLE hMeta, int pflagnum, unsigned long ca
// no online contacts? if we're trying to message, use 'send offline' contact
if (most_online_status == ID_STATUS_OFFLINE && capability == PF1_IM) {
- HANDLE hOffline = Meta_GetContactHandle(hMeta, db_get_dw(hMeta, META_PROTO, "OfflineSend", (DWORD)-1));
+ HCONTACT hOffline = Meta_GetContactHandle(hMeta, db_get_dw(hMeta, META_PROTO, "OfflineSend", (DWORD)-1));
if (hOffline)
most_online_contact = hOffline;
}
@@ -485,7 +485,7 @@ HANDLE Meta_GetMostOnlineSupporting(HANDLE hMeta, int pflagnum, unsigned long ca
return most_online_contact;
}
-int Meta_GetContactNumber(HANDLE hContact) {
+int Meta_GetContactNumber(HCONTACT hContact) {
return db_get_dw(hContact, META_PROTO, "ContactNumber", -1);
}
@@ -509,12 +509,12 @@ BOOL dbv_same(DBVARIANT *dbv1, DBVARIANT *dbv2) {
}
}
- void copy_settings_array(HANDLE hMeta, char *module, const char *settings[], int num_settings) {
+ void copy_settings_array(HCONTACT hMeta, char *module, const char *settings[], int num_settings) {
int num_contacts = db_get_dw(hMeta, META_PROTO, "NumContacts", (DWORD)-1),
default_contact = db_get_dw(hMeta, META_PROTO, "Default", (DWORD)-1),
most_online = Meta_GetContactNumber(Meta_GetMostOnline(hMeta));
- HANDLE hContact;
+ HCONTACT hContact;
int i, j;
char *used_mod;
@@ -613,12 +613,12 @@ const char *MBirthdaySettings[3] =
// szProto:
// clist: "StatusMsg"
-void CopyStatusData(HANDLE hMeta)
+void CopyStatusData(HCONTACT hMeta)
{
int num_contacts = db_get_dw(hMeta, META_PROTO, "NumContacts", (DWORD)-1),
most_online = Meta_GetContactNumber(Meta_GetMostOnline(hMeta));
WORD status = db_get_w(hMeta, META_PROTO, "Status", ID_STATUS_OFFLINE);
- HANDLE hContact;
+ HCONTACT hContact;
BOOL bDoneStatus = FALSE, bDoneXStatus = FALSE;
for (int i = 0; i < num_contacts; i++) {
@@ -667,7 +667,7 @@ void CopyStatusData(HANDLE hMeta)
}
}
-void Meta_CopyData(HANDLE hMeta)
+void Meta_CopyData(HCONTACT hMeta)
{
if (options.copydata) {
CopyStatusData(hMeta);
@@ -682,7 +682,7 @@ void Meta_CopyData(HANDLE hMeta)
}
-HANDLE Meta_GetContactHandle(HANDLE hMeta, int contact_number)
+HCONTACT Meta_GetContactHandle(HCONTACT hMeta, int contact_number)
{
char buffer[512], buffer2[512];
int num_contacts = db_get_dw(hMeta, META_PROTO, "NumContacts", 0);
@@ -691,13 +691,13 @@ HANDLE Meta_GetContactHandle(HANDLE hMeta, int contact_number)
strcpy(buffer, "Handle");
strcat(buffer, _itoa(contact_number, buffer2, 10));
- return (HANDLE)db_get_dw(hMeta, META_PROTO, buffer, 0);
+ return (HCONTACT)db_get_dw(hMeta, META_PROTO, buffer, 0);
}
int Meta_SetHandles(void)
{
DWORD meta_id, num_contacts, contact_number;
- HANDLE hContact2, hContact = db_find_first(), hNextContact;
+ HCONTACT hContact2, hContact = db_find_first(), hNextContact;
char buffer[512];
TCHAR nick_buffer[128], buffer2[40];
BOOL found;
@@ -875,7 +875,7 @@ int Meta_HideLinkedContacts(void) {
char *szProto, *group_name;
int hGroup = 1;
- HANDLE hContact2, hContact = db_find_first();
+ HCONTACT hContact2, hContact = db_find_first();
// ensure the hidden group does not exist (how this occurs i wonder but there have been reports!)
// (sometimes protocol server side groups are to blame - msn and icq)
@@ -890,7 +890,7 @@ int Meta_HideLinkedContacts(void) {
hGroup++;
} while(group_name);
- while ( hContact != NULL ) {
+ while (hContact != NULL) {
if ((meta_id = db_get_dw(hContact, META_PROTO, META_LINK,(DWORD)-1))!=(DWORD)-1) {
// get contact number
contact_number = db_get_dw(hContact, META_PROTO, "ContactNumber", (DWORD)-1);
@@ -961,7 +961,7 @@ int Meta_HideLinkedContacts(void) {
while ( hContact != NULL ) {
if (db_get_dw(hContact, META_PROTO, META_ID,(DWORD)-1)!=(DWORD)-1) {
// is a meta contact
- HANDLE hMostOnline = Meta_GetMostOnline(hContact); // set nick
+ HCONTACT hMostOnline = Meta_GetMostOnline(hContact); // set nick
Meta_CopyContactNick(hContact, hMostOnline);
Meta_FixStatus(hContact);
@@ -979,7 +979,7 @@ int Meta_HideLinkedContacts(void) {
*/
int Meta_UnhideLinkedContacts(void)
{
- for (HANDLE hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
+ for (HCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
if (db_get_dw(hContact, META_PROTO, META_LINK,(DWORD)-1)!=(DWORD)-1) {
// has a link - unhide it
// restore old group
@@ -996,7 +996,7 @@ int Meta_HideMetaContacts(int hide)
if (hide) Meta_SuppressStatus(FALSE);
else Meta_SuppressStatus(options.suppress_status);
- for (HANDLE hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
+ for (HCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
if (db_get_dw(hContact, META_PROTO, META_ID,(DWORD)-1)!=(DWORD)-1) {
// is a meta contact
if (hide)
@@ -1016,7 +1016,7 @@ int Meta_HideMetaContacts(int hide)
return 0;
}
-void Meta_RestoreGroup(HANDLE hContact) {
+void Meta_RestoreGroup(HCONTACT hContact) {
if (meta_group_hack_disabled) return; // clist has called api function to disable group hack - yay!
@@ -1057,7 +1057,7 @@ void Meta_RestoreGroup(HANDLE hContact) {
else {
// put back into metacontact's group
DBVARIANT dbv;
- HANDLE hMeta = (HANDLE)db_get_dw(hContact, META_PROTO, "Handle", 0);
+ HCONTACT hMeta = (HCONTACT)db_get_dw(hContact, META_PROTO, "Handle", 0);
if (hMeta && !Mydb_get(hMeta, "CList", "Group", &dbv)) {
db_set(hContact, "CList", "Group", &dbv);
db_free(&dbv);
@@ -1082,7 +1082,7 @@ void Meta_RestoreGroup(HANDLE hContact) {
db_unset(hContact, "CList", "Hidden");
}
-void Meta_SetGroup(HANDLE hContact) {
+void Meta_SetGroup(HCONTACT hContact) {
char *szProto, *uid;
if (meta_group_hack_disabled) return; // clist has called api function to disable group hack - yay!
@@ -1118,7 +1118,7 @@ void Meta_SetGroup(HANDLE hContact) {
int Meta_SuppressStatus(BOOL suppress)
{
- for (HANDLE hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
+ for (HCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
if (db_get_dw(hContact, META_PROTO, META_LINK,(DWORD)-1)!=(DWORD)-1) {
// is a subcontact
if (suppress)
@@ -1131,7 +1131,7 @@ int Meta_SuppressStatus(BOOL suppress)
return 0;
}
-int Meta_CopyContactNick(HANDLE hMeta, HANDLE hContact) {
+int Meta_CopyContactNick(HCONTACT hMeta, HCONTACT hContact) {
DBVARIANT dbv, dbv_proto;
char *szProto;
@@ -1170,9 +1170,9 @@ int Meta_CopyContactNick(HANDLE hMeta, HANDLE hContact) {
int Meta_SetAllNicks()
{
- for (HANDLE hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
+ for (HCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
if (db_get_dw(hContact, META_PROTO, META_ID,(DWORD)-1)!=(DWORD)-1) {
- HANDLE most_online = Meta_GetMostOnline(hContact);
+ HCONTACT most_online = Meta_GetMostOnline(hContact);
Meta_CopyContactNick(hContact, most_online);
Meta_FixStatus(hContact);
Meta_CopyData(hContact);
@@ -1190,10 +1190,10 @@ int Meta_IsHiddenGroup(const char *group_name)
return 0;
}
-int Meta_SwapContacts(HANDLE hMeta, DWORD contact_number1, DWORD contact_number2) {
+int Meta_SwapContacts(HCONTACT hMeta, DWORD contact_number1, DWORD contact_number2) {
DBVARIANT dbv1, dbv2;
- HANDLE hContact1 = Meta_GetContactHandle(hMeta, contact_number1),
+ HCONTACT hContact1 = Meta_GetContactHandle(hMeta, contact_number1),
hContact2 = Meta_GetContactHandle(hMeta, contact_number2);
char buff1[512], buff12[512], buff2[512], buff22[512];
BOOL ok1, ok2;
@@ -1348,7 +1348,7 @@ INT_PTR CALLBACK DlgProcNull(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPara
}
// function to copy history from one contact to another - courtesy JdGordon (thx)
-void copyHistory(HANDLE hContactFrom,HANDLE hContactTo)
+void copyHistory(HCONTACT hContactFrom, HCONTACT hContactTo)
{
HANDLE hDbEvent;
DBEVENTINFO dbei;
@@ -1409,8 +1409,9 @@ void copyHistory(HANDLE hContactFrom,HANDLE hContactTo)
//mir_free(id);
}
-void Meta_FixStatus(HANDLE hMeta) {
- HANDLE most_online = Meta_GetMostOnlineSupporting(hMeta, PFLAGNUM_1, 0);
+void Meta_FixStatus(HCONTACT hMeta)
+{
+ HCONTACT most_online = Meta_GetMostOnlineSupporting(hMeta, PFLAGNUM_1, 0);
if (most_online) {
char *szProto = GetContactProto(most_online);
if (szProto) {
diff --git a/plugins/MetaContacts/src/metacontacts.h b/plugins/MetaContacts/src/metacontacts.h
index a7fb25823c..637db357d5 100644
--- a/plugins/MetaContacts/src/metacontacts.h
+++ b/plugins/MetaContacts/src/metacontacts.h
@@ -63,7 +63,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
// I can't think of a way around this - mental block
-INT_PTR TranslateMenuFunc(HANDLE hContact, int i);
+INT_PTR TranslateMenuFunc(HCONTACT hContact, int i);
extern HGENMENU hMenuContact[MAX_CONTACTS];
extern HINSTANCE hInstance;
@@ -78,7 +78,7 @@ extern int mcStatus;
INT_PTR Meta_Convert(WPARAM wParam,LPARAM lParam);
INT_PTR Meta_AddTo(WPARAM wParam,LPARAM lParam);
INT_PTR Meta_Edit(WPARAM wParam,LPARAM lParam);
-void Meta_RemoveContactNumber(HANDLE hMeta, int number);
+void Meta_RemoveContactNumber(HCONTACT hMeta, int number);
INT_PTR Meta_Delete(WPARAM wParam,LPARAM lParam);
INT_PTR Meta_Default(WPARAM wParam,LPARAM lParam);
INT_PTR Meta_ForceDefault(WPARAM wParam,LPARAM lParam);
@@ -87,32 +87,32 @@ INT_PTR Meta_IsEnabled();
int Meta_EqualDBV(DBVARIANT *dbv, DBVARIANT *id);
int Meta_ModifyMenu(WPARAM wParam,LPARAM lParam);
-BOOL Meta_Assign(HANDLE src, HANDLE dest, BOOL set_as_default);
-HANDLE Meta_GetHandle(const char *protocol, DBVARIANT *id);
+BOOL Meta_Assign(HCONTACT src, HCONTACT dest, BOOL set_as_default);
+HCONTACT Meta_GetHandle(const char *protocol, DBVARIANT *id);
int Meta_SetNick(char *proto);
-HANDLE Meta_GetMostOnline(HANDLE hMeta);
-HANDLE Meta_GetMostOnlineSupporting(HANDLE hMeta, int pflagnum, unsigned long capability);
+HCONTACT Meta_GetMostOnline(HCONTACT hMeta);
+HCONTACT Meta_GetMostOnlineSupporting(HCONTACT hMeta, int pflagnum, unsigned long capability);
int Meta_HideLinkedContacts(void);
int Meta_SetHandles(void);
int Meta_UnhideLinkedContacts(void);
-int Meta_GetContactNumber(HANDLE hContact);
-HANDLE Meta_GetContactHandle(HANDLE hMeta, int contact_number);
-void Meta_RestoreGroup(HANDLE hContact);
-void Meta_SetGroup(HANDLE hContact);
+int Meta_GetContactNumber(HCONTACT hContact);
+HCONTACT Meta_GetContactHandle(HCONTACT hMeta, int contact_number);
+void Meta_RestoreGroup(HCONTACT hContact);
+void Meta_SetGroup(HCONTACT hContact);
int Meta_HideMetaContacts(int hide);
int Meta_SuppressStatus(int suppress);
-int Meta_CopyContactNick(HANDLE hMeta, HANDLE hContact);
-void Meta_CopyData(HANDLE hMeta);
+int Meta_CopyContactNick(HCONTACT hMeta, HCONTACT hContact);
+void Meta_CopyData(HCONTACT hMeta);
int Meta_SetAllNicks();
int Meta_IsHiddenGroup(const char *group_name);
-int Meta_SwapContacts(HANDLE hMeta, DWORD contact_number1, DWORD contact_number2);
+int Meta_SwapContacts(HCONTACT hMeta, DWORD contact_number1, DWORD contact_number2);
// function to copy history from one contact to another - courtesy JdGordon with mods (thx)
-void copyHistory(HANDLE hContactFrom,HANDLE hContactTo);
+void copyHistory(HCONTACT hContactFrom, HCONTACT hContactTo);
// inverse
//void Meta_RemoveHistory(HANDLE hContactRemoveFrom, HANDLE hContactSource);
-void Meta_FixStatus(HANDLE hMeta);
+void Meta_FixStatus(HCONTACT hMeta);
-char *Meta_GetUniqueIdentifier(HANDLE hContact, DWORD *pused);
+char *Meta_GetUniqueIdentifier(HCONTACT hContact, DWORD *pused);
INT_PTR Meta_GetCaps(WPARAM wParam,LPARAM lParam);
INT_PTR Meta_GetName(WPARAM wParam,LPARAM lParam);
@@ -187,7 +187,7 @@ INT_PTR MetaAPI_RemoveFromMeta(WPARAM wParam, LPARAM lParam);
INT_PTR MetaAPI_DisableHiddenGroup(WPARAM wParam, LPARAM lParam);
// extended db get/write setting functions, that handle unicode
-INT_PTR Mydb_get(HANDLE hContact, const char *szModule, const char *szSetting, DBVARIANT *dbv);
+INT_PTR Mydb_get(HCONTACT hContact, const char *szModule, const char *szSetting, DBVARIANT *dbv);
// IcoLib support
void InitIcons(void);