diff options
author | George Hazan <george.hazan@gmail.com> | 2014-03-15 18:02:40 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2014-03-15 18:02:40 +0000 |
commit | 06ed0d60176a4d3529999614825f3594b6cb54e9 (patch) | |
tree | e12b4593698d268b17f6668a5ab79f0d0a986827 | |
parent | 20a2d3dc9f8ab2e2e8833a1c83cf2dd30f25aa8e (diff) |
huge clutch sawed out of the MC engine
git-svn-id: http://svn.miranda-ng.org/main/trunk@8627 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
-rw-r--r-- | include/m_metacontacts.h | 47 | ||||
-rw-r--r-- | plugins/TabSRMM/src/container.cpp | 61 | ||||
-rw-r--r-- | plugins/TabSRMM/src/functions.h | 1 | ||||
-rw-r--r-- | plugins/TabSRMM/src/generic_msghandlers.cpp | 6 | ||||
-rw-r--r-- | plugins/TabSRMM/src/globals.cpp | 2 | ||||
-rw-r--r-- | plugins/TabSRMM/src/msgdialog.cpp | 44 | ||||
-rw-r--r-- | src/modules/metacontacts/meta_api.cpp | 109 | ||||
-rw-r--r-- | src/modules/metacontacts/meta_edit.cpp | 12 | ||||
-rw-r--r-- | src/modules/metacontacts/meta_menu.cpp | 28 | ||||
-rw-r--r-- | src/modules/metacontacts/meta_services.cpp | 21 | ||||
-rw-r--r-- | src/modules/metacontacts/metacontacts.h | 4 | ||||
-rw-r--r-- | src/resource.rc | 2 |
12 files changed, 3 insertions, 334 deletions
diff --git a/include/m_metacontacts.h b/include/m_metacontacts.h index 8eb7849814..d050e685cd 100644 --- a/include/m_metacontacts.h +++ b/include/m_metacontacts.h @@ -35,41 +35,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. //returns a handle to the 'most online' contact
#define MS_MC_GETMOSTONLINECONTACT "MetaContacts/GetMostOnline"
-//forces the metacontact to send using a specific subcontact, using the subcontact's contact number
-//wParam=(HANDLE)hMetaContact
-//lParam=(DWORD)contact number
-//returns 0 on success
-#define MS_MC_FORCESENDCONTACTNUM "MetaContacts/ForceSendContact"
-
-//forces the metacontact to send using a specific subcontact, using the subcontact's handle
-//wParam=(HANDLE)hMetaContact
-//lParam=(HANDLE)hSubcontact
-//returns 0 on success (will fail if 'force default' is in effect)
-#define MS_MC_FORCESENDCONTACT "MetaContacts/ForceSendContactByHandle"
-
-//'unforces' the metacontact to send using a specific subcontact
-//wParam=(HANDLE)hMetaContact
-//lParam=0
-//returns 0 on success (will fail if 'force default' is in effect)
-#define MS_MC_UNFORCESENDCONTACT "MetaContacts/UnforceSendContact"
-
-//'forces' or 'unforces' (i.e. toggles) the metacontact to send using it's default contact
-// overrides (and clears) 'force send' above, and will even force use of offline contacts
-// will send ME_MC_FORCESEND or ME_MC_UNFORCESEND event
-//wParam=(HANDLE)hMetaContact
-//lParam=0
-//returns 1(true) or 0(false) representing new state of 'force default'
-#define MS_MC_FORCEDEFAULT "MetaContacts/ForceSendDefault"
-
-// method to get state of 'force' for a metacontact
-// wParam=(HANDLE)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)
-#define MS_MC_GETFORCESTATE "MetaContacts/GetForceState"
-
// fired when a metacontact's default contact changes (fired upon creation of metacontact also, when default is initially set)
// wParam=(HANDLE)hMetaContact
// lParam=(HANDLE)hDefaultContact
@@ -81,23 +46,11 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // lParam=0
#define ME_MC_SUBCONTACTSCHANGED "MetaContacts/SubcontactsChanged"
-// fired when a metacontact is forced to send using a specific subcontact
-// wParam=(HANDLE)hMetaContact
-// lParam=(HANDLE)hForceContact
-#define ME_MC_FORCESEND "MetaContacts/ForceSend"
-
-// fired when a metacontact is 'unforced' to send using a specific subcontact
-// wParam=(HANDLE)hMetaContact
-// lParam=0
-#define ME_MC_UNFORCESEND "MetaContacts/UnforceSend"
-
-// added 0.9.5.0 (22/3/05)
// wParam=(HANDLE)hContact
// lParam=0
// convert a given contact into a metacontact
#define MS_MC_CONVERTTOMETA "MetaContacts/ConvertToMetacontact"
-// added 0.9.5.0 (22/3/05)
// wParam=(HANDLE)hContact
// lParam=(HANDLE)hMeta
// add an existing contact to a metacontact
diff --git a/plugins/TabSRMM/src/container.cpp b/plugins/TabSRMM/src/container.cpp index a3350ecc8d..f8f876b80f 100644 --- a/plugins/TabSRMM/src/container.cpp +++ b/plugins/TabSRMM/src/container.cpp @@ -2328,67 +2328,6 @@ HMENU TSAPI BuildContainerMenu() return hMenu;
}
-HMENU TSAPI BuildMCProtocolMenu(HWND hwndDlg)
-{
- TWindowData *dat = (TWindowData*)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
- if (dat == NULL)
- return NULL;
-
- if (!dat->cache->isMeta())
- return NULL;
-
- HMENU hMenu = CreatePopupMenu();
- HMENU hMCContextMenu = GetSubMenu(hMenu, 0);
- HMENU hMCSubForce = CreatePopupMenu();
- HMENU hMCSubDefault = CreatePopupMenu();
-
- AppendMenu(hMenu, MF_STRING | MF_DISABLED | MF_GRAYED | MF_CHECKED, 1, TranslateT("Meta Contact"));
- AppendMenu(hMenu, MF_SEPARATOR, 1, _T(""));
-
- int iNumProtos = db_mc_getSubCount(dat->hContact);
- int iDefaultProtoByNum = db_mc_getSubCount(dat->hContact);
- MCONTACT hContactMostOnline = (MCONTACT)CallService(MS_MC_GETMOSTONLINECONTACT, dat->hContact, 0);
- char *szProtoMostOnline = GetContactProto(hContactMostOnline);
- int isForced = M.GetDword(dat->hContact, "tabSRMM_forced", -1);
-
- for (int i = 0; i < iNumProtos; i++) {
- char szTemp[50];
- mir_snprintf(szTemp, sizeof(szTemp), "Protocol%d", i);
-
- ptrA szProtoName(db_get_sa(dat->hContact, META_PROTO, szTemp));
- if (szProtoName == NULL)
- continue;
-
- PROTOACCOUNT *acc = (PROTOACCOUNT *)CallService(MS_PROTO_GETACCOUNT, 0, (LPARAM)szProtoName);
- if (acc && acc->tszAccountName) {
- mir_snprintf(szTemp, sizeof(szTemp), "Handle%d", i);
-
- TCHAR *nick = NULL, *szStatusText = NULL;
- MCONTACT hContact;
- if ((hContact = (MCONTACT)db_get_dw(dat->hContact, META_PROTO, szTemp, 0)) != 0) {
- nick = pcli->pfnGetContactDisplayName(hContact, 0);
- mir_snprintf(szTemp, sizeof(szTemp), "Status%d", i);
- WORD wStatus = (WORD)db_get_w(dat->hContact, META_PROTO, szTemp, 0);
- szStatusText = pcli->pfnGetStatusModeDescription(wStatus, 0);
- }
-
- TCHAR szMenuLine[128];
- mir_sntprintf(szMenuLine, SIZEOF(szMenuLine), _T("%s: %s [%s] %s"), acc->tszAccountName, nick, szStatusText,
- i == isForced ? TranslateT("(Forced)") : _T(""));
- int iChecked = MF_UNCHECKED;
- if (hContactMostOnline != 0 && hContactMostOnline == hContact)
- iChecked = MF_CHECKED;
- AppendMenu(hMCSubForce, MF_STRING | iChecked, 100 + i, szMenuLine);
- AppendMenu(hMCSubDefault, MF_STRING | (i == iDefaultProtoByNum ? MF_CHECKED : MF_UNCHECKED), 1000 + i, szMenuLine);
- }
- }
- AppendMenu(hMCSubForce, MF_SEPARATOR, 900, _T(""));
- AppendMenu(hMCSubForce, MF_STRING | ((isForced == -1) ? MF_CHECKED : MF_UNCHECKED), 999, TranslateT("Autoselect"));
- InsertMenu(hMenu, 2, MF_BYPOSITION | MF_POPUP, (UINT_PTR)hMCSubForce, TranslateT("Use Protocol"));
- InsertMenu(hMenu, 2, MF_BYPOSITION | MF_POPUP, (UINT_PTR)hMCSubDefault, TranslateT("Set Default Protocol"));
- return hMenu;
-}
-
/*
* flashes the container
* iMode != 0: turn on flashing
diff --git a/plugins/TabSRMM/src/functions.h b/plugins/TabSRMM/src/functions.h index 28ddd1f9a7..f6572dca97 100644 --- a/plugins/TabSRMM/src/functions.h +++ b/plugins/TabSRMM/src/functions.h @@ -92,7 +92,6 @@ void TSAPI CloseOtherTabs(HWND hwndTab, TWindowData &dat); int TSAPI ActivateTabFromHWND(HWND hwndTab, HWND hwnd);
void TSAPI AdjustTabClientRect(TContainerData *pContainer, RECT *rc);
void TSAPI ReflashContainer(TContainerData *pContainer);
-HMENU TSAPI BuildMCProtocolMenu(HWND hwndDlg);
TContainerData* TSAPI AppendToContainerList(TContainerData *pContainer);
TContainerData* TSAPI RemoveContainerFromList(TContainerData *pContainer);
diff --git a/plugins/TabSRMM/src/generic_msghandlers.cpp b/plugins/TabSRMM/src/generic_msghandlers.cpp index b0a2f456c0..e821f544ff 100644 --- a/plugins/TabSRMM/src/generic_msghandlers.cpp +++ b/plugins/TabSRMM/src/generic_msghandlers.cpp @@ -1397,12 +1397,6 @@ void TSAPI DM_OptionsApplied(TWindowData *dat, WPARAM wParam, LPARAM lParam) LoadTimeZone(dat);
- if (dat->hContact && dat->szProto != NULL && dat->bIsMeta) {
- DWORD dwForcedContactNum = 0;
- CallService(MS_MC_GETFORCESTATE, dat->hContact, (LPARAM)&dwForcedContactNum);
- db_set_dw(dat->hContact, SRMSGMOD_T, "tabSRMM_forced", dwForcedContactNum);
- }
-
dat->showUIElements = m_pContainer->dwFlags & CNT_HIDETOOLBAR ? 0 : 1;
dat->dwFlagsEx = M.GetByte(dat->hContact, "splitoverride", 0) ? MWF_SHOW_SPLITTEROVERRIDE : 0;
diff --git a/plugins/TabSRMM/src/globals.cpp b/plugins/TabSRMM/src/globals.cpp index 2b67db3486..3d5e7bd8f0 100644 --- a/plugins/TabSRMM/src/globals.cpp +++ b/plugins/TabSRMM/src/globals.cpp @@ -374,8 +374,6 @@ int CGlobals::ModulesLoaded(WPARAM wParam, LPARAM lParam) HookEvent(ME_MC_DEFAULTTCHANGED, MetaContactEvent);
HookEvent(ME_MC_SUBCONTACTSCHANGED, MetaContactEvent);
- HookEvent(ME_MC_FORCESEND, MetaContactEvent);
- HookEvent(ME_MC_UNFORCESEND, MetaContactEvent);
return 0;
}
diff --git a/plugins/TabSRMM/src/msgdialog.cpp b/plugins/TabSRMM/src/msgdialog.cpp index 9598cab24f..8d813a3817 100644 --- a/plugins/TabSRMM/src/msgdialog.cpp +++ b/plugins/TabSRMM/src/msgdialog.cpp @@ -3074,35 +3074,6 @@ quote_from_last: BB_CustomButtonClick(dat, idFrom, (HWND)wParam, 1);
break;
}
-
- if ((HWND)wParam == GetDlgItem(hwndDlg, IDC_NAME) && dat->hContact != 0) {
- GetCursorPos(&pt);
- HMENU hMC = BuildMCProtocolMenu(hwndDlg);
- if (hMC == NULL)
- break;
-
- int iSelection = TrackPopupMenu(hMC, TPM_RETURNCMD, pt.x, pt.y, 0, hwndDlg, NULL);
- if (iSelection < 1000 && iSelection >= 100) { // the "force" submenu...
- if (iSelection == 999) { // un-force
- if (CallService(MS_MC_UNFORCESENDCONTACT, dat->hContact, 0) == 0)
- db_set_dw(dat->hContact, SRMSGMOD_T, "tabSRMM_forced", -1);
- else
- _DebugPopup(dat->hContact, TranslateT("Unforce failed"));
- }
- else {
- if (CallService(MS_MC_FORCESENDCONTACTNUM, dat->hContact, (LPARAM)(iSelection - 100)) == 0)
- db_set_dw(dat->hContact, SRMSGMOD_T, "tabSRMM_forced", (DWORD)(iSelection - 100));
- else
- _DebugPopup(dat->hContact, TranslateT("The selected protocol cannot be forced at this time"));
- }
- }
- else if (iSelection >= 1000) // the "default" menu...
- db_mc_setDefaultNum(dat->hContact, iSelection - 1000);
-
- DestroyMenu(hMC);
- InvalidateRect(GetParent(hwndDlg), NULL, FALSE);
- return TRUE;
- }
}
break;
@@ -3186,21 +3157,6 @@ quote_from_last: DM_CheckAutoHide(dat, wParam, lParam);
return 0;
- // metacontact support
- case DM_UPDATEMETACONTACTINFO: // update the icon in the statusbar for the "most online" protocol
- {
- DWORD isForced;
- if ((isForced = M.GetDword(dat->hContact, "tabSRMM_forced", -1)) >= 0) {
- char szTemp[64];
- mir_snprintf(szTemp, sizeof(szTemp), "Status%d", isForced);
- if (db_get_w(dat->hContact, META_PROTO, szTemp, 0) == ID_STATUS_OFFLINE)
- SendMessage(hwndDlg, DM_ACTIVATETOOLTIP, IDC_MESSAGE,
- (LPARAM)TranslateT("Warning: you have selected a subprotocol for sending the following messages which is currently offline"));
- }
- SendMessage(hwndDlg, DM_UPDATEWINICON, 0, 0);
- }
- break;
-
case DM_IEVIEWOPTIONSCHANGED:
if (dat->hwndIEView)
SendMessage(hwndDlg, DM_REMAKELOG, 0, 0);
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);
diff --git a/src/modules/metacontacts/meta_edit.cpp b/src/modules/metacontacts/meta_edit.cpp index c950ca2569..b0ce85dfce 100644 --- a/src/modules/metacontacts/meta_edit.cpp +++ b/src/modules/metacontacts/meta_edit.cpp @@ -35,7 +35,6 @@ struct num_contacts; // DWORD number of contacts
MCONTACT hDeletedContacts[MAX_CONTACTS]; // HANDLEs of the subcontacts to be removed from this metacontact
MCONTACT hContact[MAX_CONTACTS]; // HANDLEs of the subcontacts, in the order they should be in
- int force_default;
}
static g_data; // global CHANGES structure
@@ -173,9 +172,6 @@ static void ApplyChanges() if (CallProtoService(META_PROTO, PS_GETAVATARINFOT, 0, (LPARAM)&AI) == GAIR_SUCCESS)
db_set_ts(g_data.hMeta, "ContactPhoto", "File", AI.filename);
}
-
- if (MetaAPI_GetForceState(g_data.hMeta, 0) != g_data.force_default)
- MetaAPI_ForceDefault(g_data.hMeta, 0);
}
LRESULT ProcessCustomDraw(LPARAM lParam)
@@ -274,12 +270,9 @@ static INT_PTR CALLBACK Meta_EditDialogProc(HWND hwndDlg, UINT msg, WPARAM wPara g_data.hOfflineContact = Meta_GetContactHandle(g_data.cc, offline_contact_number);
for (i = 0; i < cc->nSubs; i++)
g_data.hContact[i] = Meta_GetContactHandle(g_data.cc, i);
- g_data.force_default = MetaAPI_GetForceState(lParam, 0);
SendMessage(hwndDlg, WMU_SETTITLE, 0, lParam);
- CheckDlgButton(hwndDlg, IDC_CHK_FORCEDEFAULT, g_data.force_default);
-
FillContactList(hwndDlg);
}
return TRUE;
@@ -435,11 +428,6 @@ static INT_PTR CALLBACK Meta_EditDialogProc(HWND hwndDlg, UINT msg, WPARAM wPara EnableWindow(GetDlgItem(hwndDlg, IDC_BTN_DOWN), (sel < g_data.num_contacts - 1));
EnableWindow(GetDlgItem(hwndDlg, IDC_VALIDATE), TRUE);
return TRUE;
-
- case IDC_CHK_FORCEDEFAULT:
- g_data.force_default = IsDlgButtonChecked(hwndDlg, IDC_CHK_FORCEDEFAULT);
- EnableWindow(GetDlgItem(hwndDlg, IDC_VALIDATE), TRUE);
- return TRUE;
}
}
break;
diff --git a/src/modules/metacontacts/meta_menu.cpp b/src/modules/metacontacts/meta_menu.cpp index c185867947..f6116a03ea 100644 --- a/src/modules/metacontacts/meta_menu.cpp +++ b/src/modules/metacontacts/meta_menu.cpp @@ -224,34 +224,6 @@ INT_PTR Meta_Default(WPARAM hSub, LPARAM wParam) return 0;
}
-/** Set/unset (i.e. toggle) contact to force use of default contact
-*
-* Set the given contact to be the default one for the metacontact to which it is linked.
-*
-* @param wParam : HANDLE to the MetaContact to be set as default
-* @param lParam :HWND to the clist window
-(This means the function has been called via the contact menu).
-*/
-
-INT_PTR Meta_ForceDefault(WPARAM hMeta, LPARAM)
-{
- // the wParam is a MetaContact
- DBCachedContact *cc = CheckMeta(hMeta);
- if (cc) {
- BOOL current = db_get_b(hMeta, META_PROTO, "ForceDefault", 0);
- current = !current;
- db_set_b(hMeta, META_PROTO, "ForceDefault", (BYTE)current);
-
- db_set_dw(hMeta, META_PROTO, "ForceSend", 0);
-
- if (current)
- NotifyEventHooks(hEventForceSend, hMeta, Meta_GetContactHandle(cc, cc->nDefault));
- else
- NotifyEventHooks(hEventUnforceSend, hMeta, 0);
- }
- return 0;
-}
-
/** Called when the context-menu of a contact is about to be displayed
*
* This will test which of the 4 menu item should be displayed, depending
diff --git a/src/modules/metacontacts/meta_services.cpp b/src/modules/metacontacts/meta_services.cpp index c30b633790..ad51900526 100644 --- a/src/modules/metacontacts/meta_services.cpp +++ b/src/modules/metacontacts/meta_services.cpp @@ -34,8 +34,6 @@ int previousMode, // Previous status of the MetaContacts Protocol mcStatus; // Current status of the MetaContacts Protocol
HANDLE
- hEventForceSend, // HANDLE to the 'force send' event
- hEventUnforceSend, // HANDLE to the 'unforce send' event
hSubcontactsChanged, // HANDLE to the 'contacts changed' event
hEventNudge;
@@ -444,14 +442,9 @@ int Meta_SettingChanged(WPARAM hContact, LPARAM lParam) strcat(buffer, _itoa(contact_number, szId, 10));
db_set_ts(ccMeta->contactID, META_PROTO, buffer, cli.pfnGetStatusModeDescription(dcws->value.wVal, 0));
- // if the contact was forced, unforce it (which updates status)
- if (db_get_dw(ccMeta->contactID, META_PROTO, "ForceSend", 0) == hContact)
- MetaAPI_UnforceSendContact(ccMeta->contactID, 0);
- else {
- // set status to that of most online contact
- Meta_CopyContactNick(ccMeta, Meta_GetMostOnline(ccMeta));
- Meta_FixStatus(ccMeta);
- }
+ // set status to that of most online contact
+ Meta_CopyContactNick(ccMeta, Meta_GetMostOnline(ccMeta));
+ Meta_FixStatus(ccMeta);
// most online contact with avatar support might have changed - update avatar
MCONTACT most_online = Meta_GetMostOnlineSupporting(ccMeta, PFLAGNUM_4, PF4_AVATARS);
@@ -837,7 +830,6 @@ void Meta_InitServices() CreateServiceFunction("MetaContacts/Edit", Meta_Edit);
CreateServiceFunction("MetaContacts/Delete", Meta_Delete);
CreateServiceFunction("MetaContacts/Default", Meta_Default);
- CreateServiceFunction("MetaContacts/ForceDefault", Meta_ForceDefault);
// hidden contact menu items...ho hum
for (int i = 0; i < MAX_CONTACTS; i++) {
@@ -875,8 +867,6 @@ void Meta_InitServices() CreateProtoServiceFunction(META_PROTO, PS_SEND_NUDGE, Meta_SendNudge);
// create our hookable events
- hEventForceSend = CreateHookableEvent(ME_MC_FORCESEND);
- hEventUnforceSend = CreateHookableEvent(ME_MC_UNFORCESEND);
hSubcontactsChanged = CreateHookableEvent(ME_MC_SUBCONTACTSCHANGED);
// hook other module events we need
@@ -890,8 +880,6 @@ void Meta_InitServices() // hook our own events, used to call Meta_GetMostOnline which sets nick for metacontact
HookEvent(ME_MC_DEFAULTTCHANGED, Meta_CallMostOnline);
- HookEvent(ME_MC_FORCESEND, Meta_CallMostOnline);
- HookEvent(ME_MC_UNFORCESEND, Meta_CallMostOnline);
// redirect nudge events
hEventNudge = CreateHookableEvent(META_PROTO "/Nudge");
@@ -900,9 +888,6 @@ void Meta_InitServices() //! Unregister all hooks and services from Miranda
void Meta_CloseHandles()
{
- // destroy our hookable events
- DestroyHookableEvent(hEventForceSend);
- DestroyHookableEvent(hEventUnforceSend);
DestroyHookableEvent(hSubcontactsChanged);
DestroyHookableEvent(hEventNudge);
}
diff --git a/src/modules/metacontacts/metacontacts.h b/src/modules/metacontacts/metacontacts.h index 170d83da49..f323791ee9 100644 --- a/src/modules/metacontacts/metacontacts.h +++ b/src/modules/metacontacts/metacontacts.h @@ -33,7 +33,6 @@ INT_PTR Meta_AddTo(WPARAM wParam,LPARAM lParam); INT_PTR Meta_Edit(WPARAM wParam,LPARAM lParam);
INT_PTR Meta_Delete(WPARAM wParam,LPARAM lParam);
INT_PTR Meta_Default(WPARAM wParam,LPARAM lParam);
-INT_PTR Meta_ForceDefault(WPARAM wParam,LPARAM lParam);
INT_PTR Meta_OnOff(WPARAM wParam, LPARAM lParam);
int Meta_ModifyMenu(WPARAM wParam,LPARAM lParam);
@@ -98,9 +97,6 @@ int GetRealPriority(char *proto, int status); // API function headers
void CreateApiServices();
-INT_PTR MetaAPI_GetForceState(WPARAM, LPARAM);
-INT_PTR MetaAPI_ForceDefault(WPARAM hMetaContact, LPARAM);
-INT_PTR MetaAPI_UnforceSendContact(WPARAM hMetaContact, LPARAM);
// extended db get/write setting functions, that handle unicode
INT_PTR Mydb_get(MCONTACT hContact, const char *szModule, const char *szSetting, DBVARIANT *dbv);
diff --git a/src/resource.rc b/src/resource.rc index d3974a4e6e..b1b875aa12 100644 --- a/src/resource.rc +++ b/src/resource.rc @@ -766,8 +766,6 @@ BEGIN PUSHBUTTON "Move &Down",IDC_BTN_DOWN,319,216,54,14
EDITTEXT IDC_ED_NAME,129,15,183,12,ES_AUTOHSCROLL | ES_READONLY | NOT WS_TABSTOP
CONTROL "List1",IDC_LST_CONTACTS,"SysListView32",LVS_REPORT | LVS_SINGLESEL | LVS_SHOWSELALWAYS | LVS_NOSORTHEADER | WS_BORDER | WS_TABSTOP,10,43,363,169,WS_EX_CLIENTEDGE
- CONTROL "Force use of default for sending (even if offline)",IDC_CHK_FORCEDEFAULT,
- "Button",BS_AUTOCHECKBOX | BS_LEFT | WS_TABSTOP,4,243,213,10
PUSHBUTTON "Send &Offline",IDC_BTN_SETOFFLINE,203,216,54,14
END
|