summaryrefslogtreecommitdiff
path: root/protocols/JabberG/src/jabber_opt.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2019-03-04 19:15:47 +0300
committerGeorge Hazan <ghazan@miranda.im>2019-03-04 19:15:47 +0300
commitd8bb7b62f22e745a1cc49833d040119ecf890021 (patch)
treed8e2cc6b056fa68a461547ce82ad4a1bb5f77b09 /protocols/JabberG/src/jabber_opt.cpp
parentb236b2c82761d349da6ea7853c2c57f854647f9f (diff)
Jabber:
- roster editor extracted to the separate source module; - fixes #1881 (first column's text is set improperly, thus creating problems on roster upload); - roster editor rewritten to UI classes
Diffstat (limited to 'protocols/JabberG/src/jabber_opt.cpp')
-rwxr-xr-xprotocols/JabberG/src/jabber_opt.cpp553
1 files changed, 0 insertions, 553 deletions
diff --git a/protocols/JabberG/src/jabber_opt.cpp b/protocols/JabberG/src/jabber_opt.cpp
index 61f2491cf0..3ade180008 100755
--- a/protocols/JabberG/src/jabber_opt.cpp
+++ b/protocols/JabberG/src/jabber_opt.cpp
@@ -910,553 +910,6 @@ public:
}
};
-//////////////////////////////////////////////////////////////////////////
-// roster editor
-//
-
-#include <io.h>
-#define JM_STATUSCHANGED WM_USER+0x0001
-#define fopent(name, mode) _wfopen(name, mode)
-
-enum
-{
- RRA_FILLLIST = 0,
- RRA_SYNCROSTER,
- RRA_SYNCDONE
-};
-
-struct ROSTEREDITDAT
-{
- HWND hList;
- int index;
- int subindex;
-};
-
-static int _RosterInsertListItem(HWND hList, const char *jid, const char *nick, const char *group, const char *subscr, BOOL bChecked)
-{
- LVITEM item = { 0 };
- item.mask = LVIF_TEXT | LVIF_STATE;
- item.iItem = ListView_GetItemCount(hList);
- item.pszText = (wchar_t*)jid;
-
- int index = ListView_InsertItem(hList, &item);
- if (index < 0)
- return index;
-
- ListView_SetCheckState(hList, index, bChecked);
-
- ListView_SetItemText(hList, index, 0, Utf2T(jid));
- ListView_SetItemText(hList, index, 1, Utf2T(nick));
- ListView_SetItemText(hList, index, 2, Utf2T(group));
- ListView_SetItemText(hList, index, 3, Utf2T(subscr));
- return index;
-}
-
-static void _RosterListClear(HWND hwndDlg)
-{
- HWND hList = GetDlgItem(hwndDlg, IDC_ROSTER);
- if (!hList)
- return;
-
- ListView_DeleteAllItems(hList);
- while (ListView_DeleteColumn(hList, 0));
-
- LV_COLUMN column = { 0 };
- column.mask = LVCF_TEXT;
- column.cx = 500;
-
- column.pszText = TranslateT("JID");
- ListView_InsertColumn(hList, 1, &column);
-
- column.pszText = TranslateT("Nickname");
- ListView_InsertColumn(hList, 2, &column);
-
- column.pszText = TranslateT("Group");
- ListView_InsertColumn(hList, 3, &column);
-
- column.pszText = TranslateT("Subscription");
- ListView_InsertColumn(hList, 4, &column);
-
- RECT rc;
- GetClientRect(hList, &rc);
- int width = rc.right - rc.left;
-
- ListView_SetColumnWidth(hList, 0, width * 40 / 100);
- ListView_SetColumnWidth(hList, 1, width * 25 / 100);
- ListView_SetColumnWidth(hList, 2, width * 20 / 100);
- ListView_SetColumnWidth(hList, 3, width * 10 / 100);
-}
-
-void CJabberProto::_RosterHandleGetRequest(const TiXmlElement *node, CJabberIqInfo*)
-{
- HWND hList = GetDlgItem(rrud.hwndDlg, IDC_ROSTER);
- if (rrud.bRRAction == RRA_FILLLIST) {
- _RosterListClear(rrud.hwndDlg);
- auto *query = XmlFirstChild(node, "query");
- if (query == nullptr) return;
-
- for (auto *item : TiXmlFilter(query, "item")) {
- const char *jid = XmlGetAttr(item, "jid");
- if (jid == nullptr)
- continue;
-
- const char *name = XmlGetAttr(item, "name");
- const char *subscription = XmlGetAttr(item, "subscription");
- const char *group = XmlGetChildText(item, "group");
- _RosterInsertListItem(hList, jid, name, group, subscription, TRUE);
- }
-
- // now it is require to process whole contact list to add not in roster contacts
- for (auto &hContact : AccContacts()) {
- ptrW tszJid(getWStringA(hContact, "jid"));
- if (tszJid == nullptr)
- continue;
-
- LVFINDINFO lvfi = { 0 };
- lvfi.flags = LVFI_STRING;
- lvfi.psz = tszJid;
- wchar_t *p = wcschr(tszJid, '@');
- if (p) {
- p = wcschr(tszJid, '/');
- if (p) *p = 0;
- }
- if (ListView_FindItem(hList, -1, &lvfi) == -1) {
- ptrA tszName(db_get_utfa(hContact, "CList", "MyHandle"));
- ptrA tszGroup(db_get_utfa(hContact, "CList", "Group"));
- _RosterInsertListItem(hList, T2Utf(tszJid), tszName, tszGroup, nullptr, FALSE);
- }
- }
- rrud.bReadyToDownload = FALSE;
- rrud.bReadyToUpload = TRUE;
- SetDlgItemText(rrud.hwndDlg, IDC_DOWNLOAD, TranslateT("Download"));
- SetDlgItemText(rrud.hwndDlg, IDC_UPLOAD, TranslateT("Upload"));
- SendMessage(rrud.hwndDlg, JM_STATUSCHANGED, 0, 0);
- return;
- }
-
- if (rrud.bRRAction == RRA_SYNCROSTER) {
- SetDlgItemText(rrud.hwndDlg, IDC_UPLOAD, TranslateT("Uploading..."));
- auto *queryRoster = XmlFirstChild(node, "query");
- if (!queryRoster)
- return;
-
- XmlNodeIq iq(AddIQ(&CJabberProto::_RosterHandleGetRequest, JABBER_IQ_TYPE_SET));
-
- TiXmlElement *query = iq << XCHILDNS("query", JABBER_FEAT_IQ_ROSTER);
-
- int itemCount = 0;
- int ListItemCount = ListView_GetItemCount(hList);
- for (int index = 0; index < ListItemCount; index++) {
- wchar_t jid[JABBER_MAX_JID_LEN] = L"";
- wchar_t name[260];
- wchar_t group[260];
- wchar_t subscr[260];
- ListView_GetItemText(hList, index, 0, jid, _countof(jid));
- ListView_GetItemText(hList, index, 1, name, _countof(name));
- ListView_GetItemText(hList, index, 2, group, _countof(group));
- ListView_GetItemText(hList, index, 3, subscr, _countof(subscr));
-
- T2Utf szJid(jid), szName(name), szGroup(group), szSubscr(subscr);
- auto *itemRoster = XmlGetChildByTag(queryRoster, "item", "jid", szJid);
- BOOL bRemove = !ListView_GetCheckState(hList, index);
- if (itemRoster && bRemove) {
- //delete item
- query << XCHILD("item") << XATTR("jid", szJid) << XATTR("subscription", "remove");
- itemCount++;
- }
- else if (!bRemove) {
- BOOL bPushed = itemRoster ? TRUE : FALSE;
- if (!bPushed) {
- const char *rosterName = XmlGetAttr(itemRoster, "name");
- if ((rosterName != nullptr || name[0] != 0) && mir_strcmpi(rosterName, szName))
- bPushed = TRUE;
- if (!bPushed) {
- rosterName = XmlGetAttr(itemRoster, "subscription");
- if ((rosterName != nullptr || subscr[0] != 0) && mir_strcmpi(rosterName, T2Utf(subscr)))
- bPushed = TRUE;
- }
- if (!bPushed) {
- auto *rosterGroup = XmlGetChildText(itemRoster, "group");
- if (rosterGroup != nullptr && mir_strcmpi(rosterGroup, szGroup))
- bPushed = TRUE;
- }
- }
- if (bPushed) {
- TiXmlElement *item = query << XCHILD("item");
- if (mir_wstrlen(group))
- item << XCHILD("group", szGroup);
- if (mir_wstrlen(name))
- item << XATTR("name", szName);
- item << XATTR("jid", szJid) << XATTR("subscription", subscr[0] ? szSubscr : "none");
- itemCount++;
- }
- }
- }
- rrud.bRRAction = RRA_SYNCDONE;
- if (itemCount)
- m_ThreadInfo->send(iq);
- else
- _RosterSendRequest(rrud.hwndDlg, RRA_FILLLIST);
- }
- else {
- SetDlgItemText(rrud.hwndDlg, IDC_UPLOAD, TranslateT("Upload"));
- rrud.bReadyToUpload = rrud.bReadyToDownload = FALSE;
- SendMessage(rrud.hwndDlg, JM_STATUSCHANGED, 0, 0);
- SetDlgItemText(rrud.hwndDlg, IDC_DOWNLOAD, TranslateT("Downloading..."));
- _RosterSendRequest(rrud.hwndDlg, RRA_FILLLIST);
- }
-}
-
-void CJabberProto::_RosterSendRequest(HWND hwndDlg, BYTE rrAction)
-{
- rrud.bRRAction = rrAction;
- rrud.hwndDlg = hwndDlg;
-
- m_ThreadInfo->send(
- XmlNodeIq(AddIQ(&CJabberProto::_RosterHandleGetRequest, JABBER_IQ_TYPE_GET))
- << XCHILDNS("query", JABBER_FEAT_IQ_ROSTER));
-}
-
-static void _RosterItemEditEnd(HWND hEditor, ROSTEREDITDAT * edat, BOOL bCancel)
-{
- if (!bCancel) {
- int len = GetWindowTextLength(hEditor) + 1;
- wchar_t *buff = (wchar_t*)mir_alloc(len*sizeof(wchar_t));
- if (buff) {
- GetWindowText(hEditor, buff, len);
- ListView_SetItemText(edat->hList, edat->index, edat->subindex, buff);
- }
- mir_free(buff);
- }
- DestroyWindow(hEditor);
-}
-
-static LRESULT CALLBACK _RosterItemNewEditProc(HWND hEditor, UINT msg, WPARAM wParam, LPARAM lParam)
-{
- ROSTEREDITDAT * edat = (ROSTEREDITDAT *)GetWindowLongPtr(hEditor, GWLP_USERDATA);
- if (!edat) return 0;
- switch (msg) {
- case WM_KEYDOWN:
- switch (wParam) {
- case VK_RETURN:
- _RosterItemEditEnd(hEditor, edat, FALSE);
- return 0;
- case VK_ESCAPE:
- _RosterItemEditEnd(hEditor, edat, TRUE);
- return 0;
- }
- break;
-
- case WM_GETDLGCODE:
- if (lParam) {
- MSG *msg2 = (MSG*)lParam;
- if (msg2->message == WM_KEYDOWN && msg2->wParam == VK_TAB) return 0;
- if (msg2->message == WM_CHAR && msg2->wParam == '\t') return 0;
- }
- return DLGC_WANTMESSAGE;
-
- case WM_KILLFOCUS:
- _RosterItemEditEnd(hEditor, edat, FALSE);
- return 0;
-
- case WM_DESTROY:
- SetWindowLongPtr(hEditor, GWLP_USERDATA, (LONG_PTR)0);
- free(edat);
- return 0;
- }
-
- return mir_callNextSubclass(hEditor, _RosterItemNewEditProc, msg, wParam, lParam);
-}
-
-void CJabberProto::_RosterExportToFile(HWND hwndDlg)
-{
- wchar_t filename[MAX_PATH] = { 0 };
-
- wchar_t filter[MAX_PATH];
- mir_snwprintf(filter, L"%s (*.xml)%c*.xml%c%c", TranslateT("XML for MS Excel (UTF-8 encoded)"), 0, 0, 0);
- OPENFILENAME ofn = { 0 };
- ofn.lStructSize = OPENFILENAME_SIZE_VERSION_400;
- ofn.hwndOwner = hwndDlg;
- ofn.hInstance = nullptr;
- ofn.lpstrFilter = filter;
- ofn.lpstrFile = filename;
- ofn.Flags = OFN_HIDEREADONLY;
- ofn.nMaxFile = _countof(filename);
- ofn.nMaxFileTitle = MAX_PATH;
- ofn.lpstrDefExt = L"xml";
- if (!GetSaveFileName(&ofn)) return;
-
- FILE * fp = fopent(filename, L"wb");
- if (!fp) return;
- HWND hList = GetDlgItem(hwndDlg, IDC_ROSTER);
- int ListItemCount = ListView_GetItemCount(hList);
-
- XmlNode root("Workbook");
- root << XATTR("xmlns", "urn:schemas-microsoft-com:office:spreadsheet")
- << XATTR("xmlns:o", "urn:schemas-microsoft-com:office:office")
- << XATTR("xmlns:x", "urn:schemas-microsoft-com:office:excel")
- << XATTR("xmlns:ss", "urn:schemas-microsoft-com:office:spreadsheet")
- << XATTR("xmlns:html", "http://www.w3.org/TR/REC-html40");
- root << XCHILD("ExcelWorkbook")
- << XATTR("xmlns", "urn:schemas-microsoft-com:office:excel");
- TiXmlElement *table = root << XCHILD("Worksheet") << XATTR("ss:Name", "Exported roster")
- << XCHILD("Table");
-
- for (int index = 0; index < ListItemCount; index++) {
- wchar_t jid[JABBER_MAX_JID_LEN] = L"";
- wchar_t name[260] = L"";
- wchar_t group[260] = L"";
- wchar_t subscr[260] = L"";
- ListView_GetItemText(hList, index, 0, jid, _countof(jid));
- ListView_GetItemText(hList, index, 1, name, _countof(name));
- ListView_GetItemText(hList, index, 2, group, _countof(group));
- ListView_GetItemText(hList, index, 3, subscr, _countof(subscr));
-
- TiXmlElement *node = table << XCHILD("Row");
- node << XCHILD("Cell") << XCHILD("Data", "+") << XATTR("ss:Type", "String");
- node << XCHILD("Cell") << XCHILD("Data", T2Utf(jid)) << XATTR("ss:Type", "String");
- node << XCHILD("Cell") << XCHILD("Data", T2Utf(name)) << XATTR("ss:Type", "String");
- node << XCHILD("Cell") << XCHILD("Data", T2Utf(group)) << XATTR("ss:Type", "String");
- node << XCHILD("Cell") << XCHILD("Data", T2Utf(subscr)) << XATTR("ss:Type", "String");
-
- }
-
- char header[] = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<?mso-application progid=\"Excel.Sheet\"?>\n";
- fwrite(header, 1, sizeof(header) - 1 /* for zero terminator */, fp);
-
- tinyxml2::XMLPrinter printer(0);
- root.Print(&printer);
- fputs(printer.CStr(), fp);
- fclose(fp);
-}
-
-void CJabberProto::_RosterImportFromFile(HWND hwndDlg)
-{
- wchar_t filename[MAX_PATH] = { 0 };
- wchar_t *filter = L"XML for MS Excel (UTF-8 encoded)(*.xml)\0*.xml\0\0";
-
- OPENFILENAME ofn = { 0 };
- ofn.lStructSize = OPENFILENAME_SIZE_VERSION_400;
- ofn.hwndOwner = hwndDlg;
- ofn.hInstance = nullptr;
- ofn.lpstrFilter = filter;
- ofn.lpstrFile = filename;
- ofn.Flags = OFN_FILEMUSTEXIST | OFN_HIDEREADONLY;
- ofn.nMaxFile = _countof(filename);
- ofn.nMaxFileTitle = MAX_PATH;
- ofn.lpstrDefExt = L"xml";
- if (!GetOpenFileNameW(&ofn))
- return;
-
- FILE * fp = _wfopen(filename, L"rb");
- if (!fp)
- return;
-
- TiXmlDocument doc;
- int ret = doc.LoadFile(fp);
- fclose(fp);
- if (ret != 0)
- return;
-
- _RosterListClear(hwndDlg);
-
- const TiXmlElement *Table = TiXmlConst(&doc)["Workbook"]["Worksheet"]["Table"].ToElement();
- if (Table) {
- HWND hList = GetDlgItem(hwndDlg, IDC_ROSTER);
- for (auto *Row : TiXmlFilter(Table, "Row")) {
- BOOL bAdd = FALSE;
- const char *jid = nullptr;
- const char *name = nullptr;
- const char *group = nullptr;
- const char *subscr = nullptr;
- auto *Cell = XmlFirstChild(Row, "Cell");
- auto *Data = XmlFirstChild(Cell, "Data");
- if (Data) {
- if (!mir_strcmpi(Data->GetText(), "+")) bAdd = TRUE;
- else if (mir_strcmpi(Data->GetText(), "-")) continue;
-
- Cell = Cell->NextSiblingElement("Cell");
- if (Cell) Data = XmlFirstChild(Cell, "Data");
- else Data = nullptr;
- if (Data) {
- jid = Data->GetText();
- if (!jid || mir_strlen(jid) == 0) continue;
- }
-
- Cell = Cell->NextSiblingElement("Cell");
- if (Cell) Data = XmlFirstChild(Cell, "Data");
- else Data = nullptr;
- if (Data) name = Data->GetText();
-
- Cell = Cell->NextSiblingElement("Cell");
- if (Cell) Data = XmlFirstChild(Cell, "Data");
- else Data = nullptr;
- if (Data) group = Data->GetText();
-
- Cell = Cell->NextSiblingElement("Cell");
- if (Cell) Data = XmlFirstChild(Cell, "Data");
- else Data = nullptr;
- if (Data) subscr = Data->GetText();
- }
- _RosterInsertListItem(hList, jid, name, group, subscr, bAdd);
- }
- }
-
- SendMessage(hwndDlg, JM_STATUSCHANGED, 0, 0);
-}
-
-static LRESULT CALLBACK _RosterNewListProc(HWND hList, UINT msg, WPARAM wParam, LPARAM lParam)
-{
- if (msg == WM_MOUSEWHEEL || msg == WM_NCLBUTTONDOWN || msg == WM_NCRBUTTONDOWN)
- SetFocus(hList);
-
- if (msg == WM_LBUTTONDOWN) {
- POINT pt;
- GetCursorPos(&pt);
- ScreenToClient(hList, &pt);
-
- LVHITTESTINFO lvhti = { 0 };
- lvhti.pt = pt;
- ListView_SubItemHitTest(hList, &lvhti);
- if (lvhti.flags&LVHT_ONITEM && lvhti.iSubItem != 0) {
- RECT rc;
- wchar_t buff[260];
- ListView_GetSubItemRect(hList, lvhti.iItem, lvhti.iSubItem, LVIR_BOUNDS, &rc);
- ListView_GetItemText(hList, lvhti.iItem, lvhti.iSubItem, buff, _countof(buff));
- HWND hEditor = CreateWindow(TEXT("EDIT"), buff, WS_CHILD | ES_AUTOHSCROLL, rc.left + 3, rc.top + 2, rc.right - rc.left - 3, rc.bottom - rc.top - 3, hList, nullptr, g_plugin.getInst(), nullptr);
- SendMessage(hEditor, WM_SETFONT, (WPARAM)SendMessage(hList, WM_GETFONT, 0, 0), 0);
- ShowWindow(hEditor, SW_SHOW);
- SetWindowText(hEditor, buff);
- ClientToScreen(hList, &pt);
- ScreenToClient(hEditor, &pt);
- mouse_event(MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0);
- mouse_event(MOUSEEVENTF_LEFTUP, 0, 0, 0, 0);
-
- ROSTEREDITDAT * edat = (ROSTEREDITDAT *)malloc(sizeof(ROSTEREDITDAT));
- mir_subclassWindow(hEditor, _RosterItemNewEditProc);
- edat->hList = hList;
- edat->index = lvhti.iItem;
- edat->subindex = lvhti.iSubItem;
- SetWindowLongPtr(hEditor, GWLP_USERDATA, (LONG_PTR)edat);
- }
- }
- return mir_callNextSubclass(hList, _RosterNewListProc, msg, wParam, lParam);
-}
-
-/////////////////////////////////////////////////////////////////////////////////////////
-// JabberRosterOptDlgProc - advanced options dialog procedure
-
-static int sttRosterEditorResizer(HWND /*hwndDlg*/, LPARAM, UTILRESIZECONTROL *urc)
-{
- switch (urc->wId) {
- case IDC_HEADERBAR:
- return RD_ANCHORX_LEFT | RD_ANCHORY_TOP | RD_ANCHORX_WIDTH;
- case IDC_ROSTER:
- return RD_ANCHORX_LEFT | RD_ANCHORY_TOP | RD_ANCHORY_HEIGHT | RD_ANCHORX_WIDTH;
- case IDC_DOWNLOAD:
- case IDC_UPLOAD:
- return RD_ANCHORX_LEFT | RD_ANCHORY_BOTTOM;
- case IDC_EXPORT:
- case IDC_IMPORT:
- return RD_ANCHORX_RIGHT | RD_ANCHORY_BOTTOM;
- }
- return RD_ANCHORX_LEFT | RD_ANCHORY_TOP;
-}
-
-static INT_PTR CALLBACK JabberRosterOptDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
-{
- CJabberProto *ppro = (CJabberProto*)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
-
- switch (msg) {
- case WM_INITDIALOG:
- ppro = (CJabberProto*)lParam;
- SetWindowLongPtr(hwndDlg, GWLP_USERDATA, lParam);
-
- TranslateDialogDefault(hwndDlg);
- Window_SetIcon_IcoLib(hwndDlg, g_GetIconHandle(IDI_AGENTS));
-
- Utils_RestoreWindowPosition(hwndDlg, 0, ppro->m_szModuleName, "rosterCtrlWnd_");
-
- ListView_SetExtendedListViewStyle(GetDlgItem(hwndDlg, IDC_ROSTER), LVS_EX_CHECKBOXES | LVS_EX_BORDERSELECT /*| LVS_EX_FULLROWSELECT*/ | LVS_EX_GRIDLINES /*| LVS_EX_HEADERDRAGDROP*/);
- mir_subclassWindow(GetDlgItem(hwndDlg, IDC_ROSTER), _RosterNewListProc);
- _RosterListClear(hwndDlg);
- ppro->rrud.hwndDlg = hwndDlg;
- ppro->rrud.bReadyToDownload = TRUE;
- ppro->rrud.bReadyToUpload = FALSE;
- SendMessage(hwndDlg, JM_STATUSCHANGED, 0, 0);
- return TRUE;
-
- case JM_STATUSCHANGED:
- {
- int count = ListView_GetItemCount(GetDlgItem(hwndDlg, IDC_ROSTER));
- EnableWindow(GetDlgItem(hwndDlg, IDC_DOWNLOAD), ppro->m_bJabberOnline);
- EnableWindow(GetDlgItem(hwndDlg, IDC_UPLOAD), count && ppro->m_bJabberOnline);
- EnableWindow(GetDlgItem(hwndDlg, IDC_EXPORT), count > 0);
- }
- break;
-
- case WM_CLOSE:
- DestroyWindow(hwndDlg);
- break;
-
- case WM_DESTROY:
- Utils_SaveWindowPosition(hwndDlg, 0, ppro->m_szModuleName, "rosterCtrlWnd_");
- ppro->rrud.hwndDlg = nullptr;
- Window_FreeIcon_IcoLib(hwndDlg);
- break;
-
- case WM_GETMINMAXINFO:
- {
- LPMINMAXINFO lpmmi = (LPMINMAXINFO)lParam;
- lpmmi->ptMinTrackSize.x = 550;
- lpmmi->ptMinTrackSize.y = 390;
- return 0;
- }
-
- case WM_SIZE:
- Utils_ResizeDialog(hwndDlg, g_plugin.getInst(), MAKEINTRESOURCEA(IDD_OPT_JABBER3), sttRosterEditorResizer);
- break;
-
- case WM_COMMAND:
- switch (LOWORD(wParam)) {
- case IDC_DOWNLOAD:
- ppro->rrud.bReadyToUpload = FALSE;
- ppro->rrud.bReadyToDownload = FALSE;
- SendMessage(ppro->rrud.hwndDlg, JM_STATUSCHANGED, 0, 0);
- SetDlgItemText(ppro->rrud.hwndDlg, IDC_DOWNLOAD, TranslateT("Downloading..."));
- ppro->_RosterSendRequest(hwndDlg, RRA_FILLLIST);
- break;
-
- case IDC_UPLOAD:
- ppro->rrud.bReadyToUpload = FALSE;
- SendMessage(ppro->rrud.hwndDlg, JM_STATUSCHANGED, 0, 0);
- SetDlgItemText(ppro->rrud.hwndDlg, IDC_UPLOAD, TranslateT("Connecting..."));
- ppro->_RosterSendRequest(hwndDlg, RRA_SYNCROSTER);
- break;
-
- case IDC_EXPORT:
- ppro->_RosterExportToFile(hwndDlg);
- break;
-
- case IDC_IMPORT:
- ppro->_RosterImportFromFile(hwndDlg);
- break;
- }
- break;
- }
- return FALSE;
-}
-
-INT_PTR __cdecl CJabberProto::OnMenuHandleRosterControl(WPARAM, LPARAM)
-{
- if (rrud.hwndDlg && IsWindow(rrud.hwndDlg))
- SetForegroundWindow(rrud.hwndDlg);
- else
- CreateDialogParam(g_plugin.getInst(), MAKEINTRESOURCE(IDD_OPT_JABBER3), nullptr, JabberRosterOptDlgProc, (LPARAM)this);
-
- return 0;
-}
-
/////////////////////////////////////////////////////////////////////////////////////////
// JabberOptInit - initializes all options dialogs
@@ -2175,12 +1628,6 @@ INT_PTR CJabberProto::SvcCreateAccMgrUI(WPARAM, LPARAM lParam)
return (INT_PTR)dlg->GetHwnd();
}
-void CJabberProto::JabberUpdateDialogs(BOOL)
-{
- if (rrud.hwndDlg)
- SendMessage(rrud.hwndDlg, JM_STATUSCHANGED, 0, 0);
-}
-
INT_PTR __cdecl CJabberProto::OnMenuOptions(WPARAM, LPARAM)
{
g_plugin.openOptions(L"Network", m_tszUserName, L"Account");