diff options
author | George Hazan <george.hazan@gmail.com> | 2014-02-10 21:37:41 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2014-02-10 21:37:41 +0000 |
commit | ee68ac82d5aabb596e8bd0f2b9286827ca2ce545 (patch) | |
tree | 2b330d60da88d6c195ae1943ad93fe2b393469fd /plugins/MetaContacts/src | |
parent | 6aff7a968c46f4080a24bd372c6ec1337766adf7 (diff) |
these conversions aren't needed either
git-svn-id: http://svn.miranda-ng.org/main/trunk@8088 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/MetaContacts/src')
-rw-r--r-- | plugins/MetaContacts/src/addto.cpp | 6 | ||||
-rw-r--r-- | plugins/MetaContacts/src/edit.cpp | 16 | ||||
-rw-r--r-- | plugins/MetaContacts/src/meta_api.cpp | 46 | ||||
-rw-r--r-- | plugins/MetaContacts/src/meta_menu.cpp | 36 | ||||
-rwxr-xr-x | plugins/MetaContacts/src/meta_services.cpp | 62 |
5 files changed, 83 insertions, 83 deletions
diff --git a/plugins/MetaContacts/src/addto.cpp b/plugins/MetaContacts/src/addto.cpp index 507c3961e3..a97461eb4a 100644 --- a/plugins/MetaContacts/src/addto.cpp +++ b/plugins/MetaContacts/src/addto.cpp @@ -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((MCONTACT)lParam, META_PROTO, META_ID, (DWORD)-1) != (DWORD)-1) {
+ if ( db_get_dw(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((MCONTACT)lParam, META_PROTO, META_LINK, (DWORD)-1) != (DWORD)-1) {
+ if ( db_get_dw(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((MCONTACT)lParam, GCDNF_TCHAR);
+ TCHAR *ptszCDN = pcli->pfnGetContactDisplayName(lParam, GCDNF_TCHAR);
if (!ptszCDN)
ptszCDN = TranslateT("a contact");
diff --git a/plugins/MetaContacts/src/edit.cpp b/plugins/MetaContacts/src/edit.cpp index b3a8622689..7a1a2cc303 100644 --- a/plugins/MetaContacts/src/edit.cpp +++ b/plugins/MetaContacts/src/edit.cpp @@ -270,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((MCONTACT)lParam, META_PROTO, "NumContacts", 0);
- int default_contact_number = db_get_dw((MCONTACT)lParam, META_PROTO, "Default", (DWORD)-1);
- int offline_contact_number = db_get_dw((MCONTACT)lParam, META_PROTO, "OfflineSend", (DWORD)-1);
+ int nb_contacts = db_get_dw(lParam, META_PROTO, "NumContacts", 0);
+ int default_contact_number = db_get_dw(lParam, META_PROTO, "Default", (DWORD)-1);
+ int offline_contact_number = db_get_dw(lParam, META_PROTO, "OfflineSend", (DWORD)-1);
- changes.hMeta = (MCONTACT)lParam;
+ changes.hMeta = lParam;
changes.num_contacts = nb_contacts;
changes.num_deleted = 0;
- changes.hDefaultContact = Meta_GetContactHandle((MCONTACT)lParam, default_contact_number);
- changes.hOfflineContact = Meta_GetContactHandle((MCONTACT)lParam, offline_contact_number);
+ changes.hDefaultContact = Meta_GetContactHandle(lParam, default_contact_number);
+ changes.hOfflineContact = Meta_GetContactHandle(lParam, offline_contact_number);
for (i = 0; i < nb_contacts; i++)
- changes.hContact[i] = Meta_GetContactHandle((MCONTACT)lParam, i);
+ changes.hContact[i] = Meta_GetContactHandle(lParam, i);
changes.force_default = MetaAPI_GetForceState((WPARAM)lParam, 0);
SendMessage(hwndDlg, WMU_SETTITLE, 0, lParam);
@@ -293,7 +293,7 @@ INT_PTR CALLBACK Meta_EditDialogProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR case WMU_SETTITLE:
{
- TCHAR *ptszCDN = pcli->pfnGetContactDisplayName((MCONTACT)lParam, GCDNF_TCHAR);
+ TCHAR *ptszCDN = pcli->pfnGetContactDisplayName(lParam, GCDNF_TCHAR);
if (ptszCDN == NULL)
ptszCDN = TranslateT("(Unknown Contact)");
diff --git a/plugins/MetaContacts/src/meta_api.cpp b/plugins/MetaContacts/src/meta_api.cpp index 6fbad29f5d..600249cefb 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((MCONTACT)wParam, META_PROTO, "Handle", 0);
+ return (INT_PTR)(HANDLE)db_get_dw(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((MCONTACT)wParam, META_PROTO, "Default", -1);
+ DWORD default_contact_number = db_get_dw(wParam, META_PROTO, "Default", -1);
if (default_contact_number != -1) {
- return (INT_PTR)Meta_GetContactHandle((MCONTACT)wParam, default_contact_number);
+ return (INT_PTR)Meta_GetContactHandle(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((MCONTACT)wParam, META_PROTO, "Default", -1);
+ return db_get_dw(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((MCONTACT)wParam);
+ return (INT_PTR)Meta_GetMostOnline(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((MCONTACT)wParam, META_PROTO, "NumContacts", -1);
+ DWORD num_contacts = db_get_dw(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((MCONTACT)wParam, (DWORD)lParam);
+ return (INT_PTR)Meta_GetContactHandle(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((MCONTACT)wParam, META_PROTO, "NumContacts", -1);
+ DWORD num_contacts = db_get_dw(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((MCONTACT)wParam, META_PROTO, "Default", (DWORD)lParam))
+ if (db_set_dw(wParam, META_PROTO, "Default", (DWORD)lParam))
return 1;
- NotifyEventHooks(hEventDefaultChanged, wParam, (LPARAM)Meta_GetContactHandle((MCONTACT)wParam, (int)lParam));
+ NotifyEventHooks(hEventDefaultChanged, wParam, (LPARAM)Meta_GetContactHandle(wParam, (int)lParam));
return 0;
}
@@ -102,9 +102,9 @@ INT_PTR MetaAPI_SetDefaultContactNum(WPARAM wParam, LPARAM lParam) { //lParam=(HANDLE)hSubcontact
//returns 0 on success
INT_PTR MetaAPI_SetDefaultContact(WPARAM wParam, LPARAM lParam) {
- MCONTACT hMeta = (MCONTACT)db_get_dw((MCONTACT)lParam, META_PROTO, "Handle", 0);
- DWORD contact_number = Meta_GetContactNumber((MCONTACT)lParam);
- if (contact_number == -1 || !hMeta || hMeta != (MCONTACT)wParam)
+ MCONTACT hMeta = (MCONTACT)db_get_dw(lParam, META_PROTO, "Handle", 0);
+ DWORD contact_number = Meta_GetContactNumber(lParam);
+ if (contact_number == -1 || !hMeta || hMeta != wParam)
return 1;
if (db_set_dw(hMeta, META_PROTO, "Default", contact_number))
return 1;
@@ -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) {
- MCONTACT hContact = Meta_GetContactHandle((MCONTACT)wParam, (int)lParam);
+ MCONTACT hContact = Meta_GetContactHandle(wParam, (int)lParam);
MCONTACT hMeta = (MCONTACT)db_get_dw(hContact, META_PROTO, "Handle", 0);
- if (!hContact || !hMeta || hMeta != (MCONTACT)wParam || db_get_b(hMeta, META_PROTO, "ForceDefault", 0))
+ if (!hContact || !hMeta || hMeta != wParam || db_get_b(hMeta, META_PROTO, "ForceDefault", 0))
return 1;
db_set_dw(hMeta, META_PROTO, "ForceSend", (DWORD)hContact);
@@ -134,9 +134,9 @@ 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) {
- MCONTACT hContact = (MCONTACT)lParam;
+ MCONTACT hContact = lParam;
MCONTACT hMeta = (MCONTACT)db_get_dw(hContact, META_PROTO, "Handle", 0);
- if (!hContact || !hMeta || hMeta != (MCONTACT)wParam || db_get_b(hMeta, META_PROTO, "ForceDefault", 0))
+ if (!hContact || !hMeta || hMeta != wParam || db_get_b(hMeta, META_PROTO, "ForceDefault", 0))
return 1;
db_set_dw(hMeta, META_PROTO, "ForceSend", (DWORD)hContact);
@@ -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((MCONTACT)wParam, META_PROTO, "ForceDefault", 0))
+ if (db_get_b(wParam, META_PROTO, "ForceDefault", 0))
return 1;
- db_set_dw((MCONTACT)wParam, META_PROTO, "ForceSend", 0);
+ db_set_dw(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((MCONTACT)wParam, META_PROTO, "ForceDefault", 0);
+ return db_get_b(wParam, META_PROTO, "ForceDefault", 0);
}
// method to get state of 'force' for a metacontact
@@ -179,11 +179,11 @@ 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) {
- MCONTACT hMeta = (MCONTACT)wParam;
+ MCONTACT hMeta = wParam;
if ( !hMeta) return 0;
if (db_get_b(hMeta, META_PROTO, "ForceDefault", 0)) {
- if (lParam) *(DWORD *)lParam = db_get_dw((MCONTACT)wParam, META_PROTO, "Default", -1);
+ if (lParam) *(DWORD *)lParam = db_get_dw(wParam, META_PROTO, "Default", -1);
return 1;
}
@@ -216,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((MCONTACT)wParam, (MCONTACT)lParam, FALSE);
+ return Meta_Assign(wParam, lParam, FALSE);
}
// added 0.9.5.0 (22/3/05)
diff --git a/plugins/MetaContacts/src/meta_menu.cpp b/plugins/MetaContacts/src/meta_menu.cpp index 30ab1750a6..853dc18394 100644 --- a/plugins/MetaContacts/src/meta_menu.cpp +++ b/plugins/MetaContacts/src/meta_menu.cpp @@ -42,7 +42,7 @@ INT_PTR Meta_Convert(WPARAM wParam, LPARAM lParam) char *group = 0;
// Get some information about the selected contact.
- if ( !db_get_utf((MCONTACT)wParam, "CList", "Group", &dbv)) {
+ if ( !db_get_utf(wParam, "CList", "Group", &dbv)) {
group = _strdup(dbv.pszVal);
db_free(&dbv);
}
@@ -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((MCONTACT)wParam, hMetaContact, TRUE)) {
+ if ( !Meta_Assign(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;
@@ -207,7 +207,7 @@ INT_PTR Meta_Delete(WPARAM wParam,LPARAM lParam) DWORD metaID;
// The wParam is a metacontact
- if ((metaID = db_get_dw((MCONTACT)wParam, META_PROTO, META_ID, (DWORD)-1)) != (DWORD)-1) {
+ if ((metaID = db_get_dw(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?"),
@@ -237,7 +237,7 @@ INT_PTR Meta_Delete(WPARAM wParam,LPARAM lParam) CallService(MS_DB_CONTACT_DELETE,wParam,0);
}
else {
- MCONTACT hMeta = (MCONTACT)db_get_dw((MCONTACT)wParam, META_PROTO, "Handle", 0);
+ MCONTACT hMeta = (MCONTACT)db_get_dw(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((MCONTACT)wParam, META_PROTO, "ContactNumber", -1));
+ Meta_RemoveContactNumber(hMeta, db_get_dw(wParam, META_PROTO, "ContactNumber", -1));
}
return 0;
}
@@ -265,8 +265,8 @@ INT_PTR Meta_Default(WPARAM wParam,LPARAM lParam) MCONTACT hMeta;
// the wParam is a subcontact
- if ((hMeta = (MCONTACT)db_get_dw((MCONTACT)wParam, META_PROTO, "Handle",0)) != 0) {
- db_set_dw(hMeta, META_PROTO, "Default", (DWORD)Meta_GetContactNumber((MCONTACT)wParam));
+ if ((hMeta = (MCONTACT)db_get_dw(wParam, META_PROTO, "Handle",0)) != 0) {
+ db_set_dw(hMeta, META_PROTO, "Default", (DWORD)Meta_GetContactNumber(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((MCONTACT)wParam, META_PROTO, META_ID, (DWORD)-1) != (DWORD)-1) {
- BOOL current = db_get_b((MCONTACT)wParam, META_PROTO, "ForceDefault", 0);
+ if (db_get_dw(wParam, META_PROTO, META_ID, (DWORD)-1) != (DWORD)-1) {
+ BOOL current = db_get_b(wParam, META_PROTO, "ForceDefault", 0);
current = !current;
- db_set_b((MCONTACT)wParam, META_PROTO, "ForceDefault", (BYTE)current);
+ db_set_b(wParam, META_PROTO, "ForceDefault", (BYTE)current);
- db_set_dw((MCONTACT)wParam, META_PROTO, "ForceSend", 0);
+ db_set_dw(wParam, META_PROTO, "ForceSend", 0);
if (current)
- NotifyEventHooks(hEventForceSend, wParam, (LPARAM)Meta_GetContactHandle((MCONTACT)wParam, db_get_dw((MCONTACT)wParam, META_PROTO, "Default", -1)));
+ NotifyEventHooks(hEventForceSend, wParam, (LPARAM)Meta_GetContactHandle(wParam, db_get_dw(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((MCONTACT)wParam, META_PROTO, META_ID,-1) != (DWORD)-1) {
+ if (db_get_dw(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((MCONTACT)wParam, META_PROTO, "NumContacts", 0);
+ int num_contacts = db_get_dw(wParam, META_PROTO, "NumContacts", 0);
for (int i = 0; i < MAX_CONTACTS; i++) {
if (i >= num_contacts) {
Menu_ShowItem(hMenuContact[i], false);
continue;
}
- MCONTACT hContact = Meta_GetContactHandle((MCONTACT)wParam, i);
+ MCONTACT hContact = Meta_GetContactHandle(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((MCONTACT)wParam, META_PROTO, buf, &dbv);
+ db_get(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((MCONTACT)wParam)), PS_SEND_NUDGE);
+ mir_snprintf(serviceFunc, 256, "%s%s", GetContactProto( Meta_GetMostOnline(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((MCONTACT)wParam, META_PROTO, META_LINK,(DWORD)-1)!=(DWORD)-1) {
+ else if (db_get_dw(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 f12a2ee768..c615a01b08 100755 --- a/plugins/MetaContacts/src/meta_services.cpp +++ b/plugins/MetaContacts/src/meta_services.cpp @@ -261,7 +261,7 @@ INT_PTR MetaFilter_SendMessage(WPARAM wParam,LPARAM lParam) INT_PTR Meta_SendNudge(WPARAM wParam,LPARAM lParam)
{
- MCONTACT hSubContact = Meta_GetMostOnline((MCONTACT)wParam);
+ MCONTACT hSubContact = Meta_GetMostOnline(wParam);
return ProtoCallService(GetContactProto(hSubContact), PS_SEND_NUDGE, (WPARAM)hSubContact, lParam);
}
@@ -601,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=(MCONTACT)db_get_dw((MCONTACT)wParam, META_PROTO, "Handle",0))!=0 && CallService(MS_DB_CONTACT_IS, (WPARAM)hMeta, 0)) // just to be safe
+ if ((hMeta=(MCONTACT)db_get_dw(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((MCONTACT)wParam);
+ contact_number = Meta_GetContactNumber(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((MCONTACT)wParam, META_PROTO, "Hidden", 0) == 0 && !Miranda_Terminated()) {
+ Meta_IsEnabled() && db_get_b(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((MCONTACT)wParam, META_PROTO, "OldCListGroup", &dcws->value);
- db_set_s((MCONTACT)wParam, "CList", "Group", META_HIDDEN_GROUP);
+ db_set(wParam, META_PROTO, "OldCListGroup", &dcws->value);
+ db_set_s(wParam, "CList", "Group", META_HIDDEN_GROUP);
} else if (dcws->value.type == DBVT_DELETED) {
- db_unset((MCONTACT)wParam, META_PROTO, "OldCListGroup");
- db_set_s((MCONTACT)wParam, "CList", "Group", META_HIDDEN_GROUP);
+ db_unset(wParam, META_PROTO, "OldCListGroup");
+ db_set_s(wParam, "CList", "Group", META_HIDDEN_GROUP);
}
}
else if ( !strcmp(dcws->szSetting, "IP")) {
@@ -655,7 +655,7 @@ int Meta_SettingChanged(WPARAM wParam, LPARAM lParam) db_set(hMeta, META_PROTO, buffer, &dcws->value);
DBVARIANT dbv;
- if (Mydb_get((MCONTACT)wParam, "CList", "MyHandle", &dbv)) {
+ if (Mydb_get(wParam, "CList", "MyHandle", &dbv)) {
strcpy(buffer, "CListName");
strcat(buffer, _itoa(contact_number, szId, 10));
db_set(hMeta, META_PROTO, buffer, &dcws->value);
@@ -682,12 +682,12 @@ int Meta_SettingChanged(WPARAM wParam, LPARAM lParam) }
else if ( !strcmp(dcws->szModule, "CList") && !strcmp(dcws->szSetting, "MyHandle")) {
if (dcws->value.type == DBVT_DELETED) {
- char *proto = GetContactProto((MCONTACT)wParam);
+ char *proto = GetContactProto(wParam);
strcpy(buffer, "CListName");
strcat(buffer, _itoa(contact_number, szId, 10));
DBVARIANT dbv;
- if (proto && !Mydb_get((MCONTACT)wParam, proto, "Nick", &dbv)) {
+ if (proto && !Mydb_get(wParam, proto, "Nick", &dbv)) {
db_set(hMeta, META_PROTO, buffer, &dbv);
db_free(&dbv);
} else {
@@ -752,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((MCONTACT)wParam, "CList", "Hidden", 0) == 0)
- && db_get_b((MCONTACT)wParam, META_PROTO, "Hidden", 0) == 1)
+ if ((dcws->value.type == DBVT_DELETED || db_get_b(wParam, "CList", "Hidden", 0) == 0)
+ && db_get_b(wParam, META_PROTO, "Hidden", 0) == 1)
{
// a subcontact we hid (e.g. jabber) has been unhidden - hide it again :(
- db_set_b((MCONTACT)wParam, "CList", "Hidden", 1);
+ db_set_b(wParam, "CList", "Hidden", 1);
}
}
}
@@ -767,21 +767,21 @@ int Meta_SettingChanged(WPARAM wParam, LPARAM lParam) int Meta_ContactDeleted(WPARAM wParam, LPARAM lParam)
{
// is a subcontact - update meta contact
- MCONTACT hMeta = (MCONTACT)db_get_dw((MCONTACT)wParam, META_PROTO, "Handle", 0);
+ MCONTACT hMeta = (MCONTACT)db_get_dw(wParam, META_PROTO, "Handle", 0);
if (hMeta) {
- Meta_RemoveContactNumber(hMeta, db_get_dw((MCONTACT)wParam, META_PROTO, "ContactNumber", -1));
+ Meta_RemoveContactNumber(hMeta, db_get_dw(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((MCONTACT)wParam, META_PROTO, "NumContacts", 0);
+ int num_contacts = db_get_dw(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++) {
- MCONTACT hContact = Meta_GetContactHandle((MCONTACT)wParam, i);
+ MCONTACT hContact = Meta_GetContactHandle(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");
@@ -807,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((MCONTACT)wParam, META_PROTO, META_ID,(DWORD)-1) == (DWORD)-1)
+ if (db_get_dw(wParam, META_PROTO, META_ID,(DWORD)-1) == (DWORD)-1)
return 0;
// forward to sending protocol, if supported
- MCONTACT most_online = Meta_GetMostOnline((MCONTACT)wParam);
- Meta_CopyContactNick((MCONTACT)wParam, most_online);
+ MCONTACT most_online = Meta_GetMostOnline(wParam);
+ Meta_CopyContactNick(wParam, most_online);
if ( !most_online)
return 0;
@@ -833,7 +833,7 @@ INT_PTR Meta_UserIsTyping(WPARAM wParam, LPARAM lParam) int Meta_ContactIsTyping(WPARAM wParam, LPARAM lParam)
{
MCONTACT hMeta;
- if ((hMeta = (MCONTACT)db_get_dw((MCONTACT)wParam, META_PROTO, "Handle",0)) != 0 && Meta_IsEnabled()) {
+ if ((hMeta = (MCONTACT)db_get_dw(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
@@ -855,12 +855,12 @@ int Meta_ContactIsTyping(WPARAM wParam, LPARAM lParam) int Meta_UserInfo(WPARAM wParam, LPARAM lParam)
{
- DWORD default_contact_number = db_get_dw((MCONTACT)lParam, META_PROTO, "Default", (DWORD)-1);
+ DWORD default_contact_number = db_get_dw(lParam, META_PROTO, "Default", (DWORD)-1);
if (default_contact_number == -1) // not a meta contact
return 0;
- CallService(MS_USERINFO_SHOWDIALOG, (WPARAM)Meta_GetContactHandle((MCONTACT)lParam, default_contact_number), 0);
+ CallService(MS_USERINFO_SHOWDIALOG, (WPARAM)Meta_GetContactHandle(lParam, default_contact_number), 0);
return 1;
}
@@ -907,11 +907,11 @@ int Meta_MessageWindowEvent(WPARAM wParam, LPARAM lParam) { int Meta_ClistDoubleClicked(WPARAM wParam, LPARAM lParam)
{
- if (db_get_dw((MCONTACT)wParam, META_PROTO, "Default",(WORD)-1) == (WORD)-1)
+ if (db_get_dw(wParam, META_PROTO, "Default",(WORD)-1) == (WORD)-1)
return 0;
// -1 indicates no specific capability but respect 'ForceDefault'
- MCONTACT most_online = Meta_GetMostOnlineSupporting((MCONTACT)wParam, PFLAGNUM_1, -1);
+ MCONTACT most_online = Meta_GetMostOnlineSupporting(wParam, PFLAGNUM_1, -1);
if ( !most_online)
return 0;
@@ -1093,7 +1093,7 @@ static VOID CALLBACK sttMenuThread( PVOID param ) INT_PTR Meta_ContactMenuFunc(WPARAM wParam, LPARAM lParam)
{
- MCONTACT hContact = Meta_GetContactHandle((MCONTACT)wParam, (int)lParam);
+ MCONTACT hContact = Meta_GetContactHandle(wParam, (int)lParam);
if (options.menu_function == FT_MSG) {
// open message window if protocol supports message sending or chat, else simulate double click
@@ -1112,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((MCONTACT)wParam, META_PROTO, "Default", (DWORD)(int)lParam);
+ db_set_dw(wParam, META_PROTO, "Default", (DWORD)(int)lParam);
NotifyEventHooks(hEventDefaultChanged, wParam, (LPARAM)hContact);
CallService(MS_MSG_SENDMESSAGE, wParam, 0);
} else
@@ -1292,13 +1292,13 @@ int Meta_OptInit(WPARAM wParam, LPARAM lParam) int Meta_CallMostOnline(WPARAM wParam, LPARAM lParam)
{
- MCONTACT most_online_im = Meta_GetMostOnline((MCONTACT)wParam);
+ MCONTACT most_online_im = Meta_GetMostOnline(wParam);
// fix nick
- Meta_CopyContactNick((MCONTACT)wParam, most_online_im);
+ Meta_CopyContactNick(wParam, most_online_im);
// fix status
- Meta_FixStatus((MCONTACT)wParam);
+ Meta_FixStatus(wParam);
// copy all other data
Meta_CopyData((MCONTACT) wParam);
|