summaryrefslogtreecommitdiff
path: root/plugins/TabSRMM
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/TabSRMM')
-rw-r--r--plugins/TabSRMM/src/container.cpp61
-rw-r--r--plugins/TabSRMM/src/functions.h1
-rw-r--r--plugins/TabSRMM/src/generic_msghandlers.cpp6
-rw-r--r--plugins/TabSRMM/src/globals.cpp2
-rw-r--r--plugins/TabSRMM/src/msgdialog.cpp44
5 files changed, 0 insertions, 114 deletions
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);