From 9f5f4958b7a890482997dffef7c9cf4bf95f0ba4 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Mon, 15 Aug 2022 17:06:37 +0300 Subject: AVS: contact options dialog -> UI classes --- protocols/JabberG/src/jabber_chat.cpp | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'protocols') diff --git a/protocols/JabberG/src/jabber_chat.cpp b/protocols/JabberG/src/jabber_chat.cpp index c4bd6bb3d6..16483bcb9b 100644 --- a/protocols/JabberG/src/jabber_chat.cpp +++ b/protocols/JabberG/src/jabber_chat.cpp @@ -34,7 +34,7 @@ enum { IDM_ROLE, IDM_AFFLTN, - IDM_CONFIG, IDM_NICK, IDM_DESTROY, IDM_INVITE, IDM_BOOKMARKS, IDM_LEAVE, IDM_TOPIC, + IDM_CONFIG, IDM_NICK, IDM_AVATAR, IDM_DESTROY, IDM_INVITE, IDM_BOOKMARKS, IDM_LEAVE, IDM_TOPIC, IDM_LST_PARTICIPANT, IDM_LST_MODERATOR, IDM_LST_MEMBER, IDM_LST_ADMIN, IDM_LST_OWNER, IDM_LST_BAN, @@ -388,6 +388,7 @@ static gc_item sttLogListItems[] = { LPGENW("&Room options"), 0, MENU_NEWPOPUP }, { LPGENW("View/change &topic"), IDM_TOPIC, MENU_POPUPITEM }, { LPGENW("Add to &bookmarks"), IDM_BOOKMARKS, MENU_POPUPITEM }, + { LPGENW("Change &avatar"), IDM_AVATAR, MENU_POPUPITEM }, { LPGENW("&Configure..."), IDM_CONFIG, MENU_POPUPITEM }, { LPGENW("&Destroy room"), IDM_DESTROY, MENU_POPUPITEM }, @@ -465,6 +466,10 @@ static gc_item sttListItems[] = { LPGENW("Copy in-room JID"), IDM_CPY_INROOMJID, MENU_ITEM } }; +static uint32_t sttModeratorItems[] = { IDM_LST_PARTICIPANT, IDM_AVATAR, 0 }; +static uint32_t sttAdminItems[] = { IDM_LST_MODERATOR, IDM_LST_MEMBER, IDM_LST_ADMIN, IDM_LST_OWNER, IDM_LST_BAN, 0 }; +static uint32_t sttOwnerItems[] = { IDM_CONFIG, IDM_DESTROY, 0 }; + int CJabberProto::JabberGcMenuHook(WPARAM, LPARAM lParam) { GCMENUITEMS* gcmi = (GCMENUITEMS*)lParam; @@ -489,10 +494,6 @@ int CJabberProto::JabberGcMenuHook(WPARAM, LPARAM lParam) if (gcmi->Type == MENU_ON_LOG) { static wchar_t url_buf[1024] = { 0 }; - static uint32_t sttModeratorItems[] = { IDM_LST_PARTICIPANT, 0 }; - static uint32_t sttAdminItems[] = { IDM_LST_MODERATOR, IDM_LST_MEMBER, IDM_LST_ADMIN, IDM_LST_OWNER, IDM_LST_BAN, 0 }; - static uint32_t sttOwnerItems[] = { IDM_CONFIG, IDM_DESTROY, 0 }; - sttSetupGcMenuItem(_countof(sttLogListItems), sttLogListItems, 0, FALSE); int idx = IDM_LINK0; @@ -1194,6 +1195,10 @@ static void sttLogListHook(CJabberProto *ppro, JABBER_LIST_ITEM *item, GCHOOK *g ppro->AdminGet(roomJid, JABBER_FEAT_MUC_ADMIN, "affiliation", "owner", &CJabberProto::OnIqResultMucGetOwnerList, gch->si->pDlg); break; + case IDM_AVATAR: + CallService(MS_AV_CONTACTOPTIONS, gch->si->hContact, LPARAM(gch->si->pDlg ? gch->si->pDlg->GetHwnd() : nullptr)); + break; + case IDM_TOPIC: szTitle.Format(TranslateT("Set topic for %s"), gch->si->ptszID); szBuffer = Utf2T(item->getTemp()->m_szStatusMessage); -- cgit v1.2.3