From 06ed0d60176a4d3529999614825f3594b6cb54e9 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sat, 15 Mar 2014 18:02:40 +0000 Subject: huge clutch sawed out of the MC engine git-svn-id: http://svn.miranda-ng.org/main/trunk@8627 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- src/modules/metacontacts/meta_api.cpp | 109 ---------------------------------- 1 file changed, 109 deletions(-) (limited to 'src/modules/metacontacts/meta_api.cpp') diff --git a/src/modules/metacontacts/meta_api.cpp b/src/modules/metacontacts/meta_api.cpp index beca03b5ec..cfca0ed968 100644 --- a/src/modules/metacontacts/meta_api.cpp +++ b/src/modules/metacontacts/meta_api.cpp @@ -38,110 +38,6 @@ static INT_PTR MetaAPI_GetMostOnline(WPARAM hMetaContact, LPARAM) return Meta_GetMostOnline(cc); } -// forces the metacontact to send using a specific subcontact, using the subcontact's contact number -// wParam=(MCONTACT)hMetaContact -// lParam=(DWORD)contact number -// returns 0 on success - -static INT_PTR MetaAPI_ForceSendContactNum(WPARAM hMetaContact, LPARAM lParam) -{ - DBCachedContact *cc = CheckMeta(hMetaContact); - if (cc == NULL) - return 1; - - MCONTACT hContact = Meta_GetContactHandle(cc, (int)lParam); - if (!hContact || db_get_b(cc->contactID, META_PROTO, "ForceDefault", 0)) - return 1; - - db_set_dw(cc->contactID, META_PROTO, "ForceSend", hContact); - - NotifyEventHooks(hEventForceSend, hMetaContact, hContact); - return 0; -} - -// forces the metacontact to send using a specific subcontact, using the subcontact's handle -// wParam=(MCONTACT)hMetaContact -// lParam=(MCONTACT)hSubcontact -// returns 0 on success (will fail if 'force default' is in effect) - -static INT_PTR MetaAPI_ForceSendContact(WPARAM hMetaContact, LPARAM lParam) -{ - DBCachedContact *cc = CheckMeta(hMetaContact); - if (cc == NULL) - return 1; - - if (Meta_GetContactNumber(cc, lParam) == -1) - return 1; - - if (!db_get_b(cc->contactID, META_PROTO, "ForceDefault", 0)) - return 1; - - db_set_dw(cc->contactID, META_PROTO, "ForceSend", lParam); - - NotifyEventHooks(hEventForceSend, hMetaContact, lParam); - return 0; -} - -// 'unforces' the metacontact to send using a specific subcontact -// wParam=(MCONTACT)hMetaContact -// lParam=0 -// returns 0 on success (will fail if 'force default' is in effect) - -INT_PTR MetaAPI_UnforceSendContact(WPARAM hMetaContact, LPARAM lParam) -{ - if (db_get_b(hMetaContact, META_PROTO, "ForceDefault", 0)) - return 1; - - db_set_dw(hMetaContact, META_PROTO, "ForceSend", 0); - - NotifyEventHooks(hEventUnforceSend, hMetaContact, lParam); - return 0; -} - -//'forces' or 'unforces' (i.e. toggles) the metacontact to send using it's default contact -// overrides 'force send' above, and will even force use of offline contacts -// will send ME_MC_FORCESEND event -// -// wParam=(MCONTACT)hMetaContact -// lParam=0 -// returns 1(true) or 0(false) representing new state of 'force default' - -INT_PTR MetaAPI_ForceDefault(WPARAM hMetaContact, LPARAM lParam) -{ - // forward to menu function - Meta_ForceDefault(hMetaContact, lParam); - return db_get_b(hMetaContact, META_PROTO, "ForceDefault", 0); -} - -// method to get state of 'force' for a metacontact -// wParam=(MCONTACT)hMetaContact -// lParam= (DWORD)&contact_number or NULL -// if lparam supplied, the contact_number of the contatct 'in force' will be copied to the address it points to, -// or if none is in force, the value INVALID_CONTACT_ID 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 hMetaContact, LPARAM lParam) -{ - DBCachedContact *cc = CheckMeta(hMetaContact); - if (cc == NULL) - return 0; - - if (db_get_b(hMetaContact, META_PROTO, "ForceDefault", 0)) { - if (lParam) *(DWORD *)lParam = cc->nDefault; - return 1; - } - - MCONTACT hContact = (MCONTACT)db_get_dw(hMetaContact, META_PROTO, "ForceSend", 0); - if (!hContact) { - if (lParam) *(DWORD *)lParam = -1; - } - else { - if (lParam) *(DWORD *)lParam = (DWORD)Meta_GetContactNumber(cc, hContact); - } - - return 0; -} - // wParam=(HANDLE)hContact // lParam=0 // convert a given contact into a metacontact @@ -173,11 +69,6 @@ static INT_PTR MetaAPI_RemoveFromMeta(WPARAM wParam, LPARAM lParam) void CreateApiServices() { CreateServiceFunction(MS_MC_GETMOSTONLINECONTACT, MetaAPI_GetMostOnline); - CreateServiceFunction(MS_MC_FORCESENDCONTACTNUM, MetaAPI_ForceSendContactNum); - CreateServiceFunction(MS_MC_FORCESENDCONTACT, MetaAPI_ForceSendContact); - CreateServiceFunction(MS_MC_UNFORCESENDCONTACT, MetaAPI_UnforceSendContact); - CreateServiceFunction(MS_MC_GETFORCESTATE, MetaAPI_GetForceState); - CreateServiceFunction(MS_MC_CONVERTTOMETA, MetaAPI_ConvertToMeta); CreateServiceFunction(MS_MC_ADDTOMETA, MetaAPI_AddToMeta); CreateServiceFunction(MS_MC_REMOVEFROMMETA, MetaAPI_RemoveFromMeta); -- cgit v1.2.3