diff options
author | George Hazan <george.hazan@gmail.com> | 2023-12-07 14:42:57 +0300 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2023-12-07 14:42:57 +0300 |
commit | c4a013eb138c4fe3e181751ca5a5b596e5961dd4 (patch) | |
tree | dcd9c18e39aa8c19c049cab4aad7fdd5c21036fe /protocols/Telegram | |
parent | f45c6111f5b86d327e30b3709c92321248534398 (diff) |
since Reply menu item does not depend on a protocol, it's moved to NewStory
Diffstat (limited to 'protocols/Telegram')
-rw-r--r-- | protocols/Telegram/res/reply.ico | bin | 4286 -> 0 bytes | |||
-rw-r--r-- | protocols/Telegram/res/resource.rc | 3 | ||||
-rw-r--r-- | protocols/Telegram/src/main.cpp | 1 | ||||
-rw-r--r-- | protocols/Telegram/src/menus.cpp | 21 | ||||
-rw-r--r-- | protocols/Telegram/src/proto.cpp | 2 | ||||
-rw-r--r-- | protocols/Telegram/src/proto.h | 2 | ||||
-rw-r--r-- | protocols/Telegram/src/resource.h | 1 |
7 files changed, 5 insertions, 25 deletions
diff --git a/protocols/Telegram/res/reply.ico b/protocols/Telegram/res/reply.ico Binary files differdeleted file mode 100644 index 16cbee7a06..0000000000 --- a/protocols/Telegram/res/reply.ico +++ /dev/null diff --git a/protocols/Telegram/res/resource.rc b/protocols/Telegram/res/resource.rc index 2dea61f66b..23ea531835 100644 --- a/protocols/Telegram/res/resource.rc +++ b/protocols/Telegram/res/resource.rc @@ -179,9 +179,6 @@ IDI_REACTION ICON "reaction.ico" IDI_BOT ICON "bot.ico"
-IDI_REPLY ICON "reply.ico"
-
-
/////////////////////////////////////////////////////////////////////////////
//
// DESIGNINFO
diff --git a/protocols/Telegram/src/main.cpp b/protocols/Telegram/src/main.cpp index 348a58e0cd..411a286ffc 100644 --- a/protocols/Telegram/src/main.cpp +++ b/protocols/Telegram/src/main.cpp @@ -43,7 +43,6 @@ static IconItem iconList[] = { LPGEN("Telegram Premium user"), "premuim", IDI_PREMIUM },
{ LPGEN("Forward"), "forward", IDI_FORWARD },
{ LPGEN("Reaction"), "reaction", IDI_REACTION },
- { LPGEN("Reply"), "reply", IDI_REPLY },
{ LPGEN("Bot"), "bot", IDI_BOT },
};
diff --git a/protocols/Telegram/src/menus.cpp b/protocols/Telegram/src/menus.cpp index ac87355f29..ded59ff5ed 100644 --- a/protocols/Telegram/src/menus.cpp +++ b/protocols/Telegram/src/menus.cpp @@ -30,7 +30,7 @@ void CTelegramProto::InitMenus() CMenuItem mi(&g_plugin); mi.pszService = szServiceName; - mi.position = 10000000; + mi.position = NS_PROTO_MENU_POS; mi.hIcolibItem = g_plugin.getIconHandle(IDI_FORWARD); mi.name.a = LPGEN("Forward"); hmiForward = Menu_AddNewStoryMenuItem(&mi, 1); @@ -39,25 +39,16 @@ void CTelegramProto::InitMenus() mi.hIcolibItem = g_plugin.getIconHandle(IDI_REACTION); mi.name.a = LPGEN("Reaction"); hmiReaction = Menu_AddNewStoryMenuItem(&mi, 2); - - mi.position++; - mi.hIcolibItem = g_plugin.getIconHandle(IDI_REPLY); - mi.name.a = LPGEN("Reply"); - hmiReply = Menu_AddNewStoryMenuItem(&mi, 3); } -int CTelegramProto::OnPrebuildNSMenu(WPARAM hContact, LPARAM lParam) +int CTelegramProto::OnPrebuildNSMenu(WPARAM hContact, LPARAM) { if (!Proto_IsProtoOnContact(hContact, m_szModuleName)) { Menu_ShowItem(hmiForward, false); Menu_ShowItem(hmiReaction, false); - Menu_ShowItem(hmiReply, false); } else { - auto *pDbei = (DB::EventInfo *)lParam; - - Menu_ShowItem(hmiForward, getByte("Protected")); - Menu_ShowItem(hmiReply, mir_strlen(pDbei->szId) > 0 && !Contact::IsReadonly(hContact)); + Menu_ShowItem(hmiForward, 0 == getByte(hContact, "Protected")); auto *pUser = FindUser(GetId(hContact)); Menu_ShowItem(hmiReaction, pUser && pUser->pReactions); @@ -195,12 +186,6 @@ INT_PTR CTelegramProto::SvcExecMenu(WPARAM iCommand, LPARAM pHandle) if (hCurrentEvent != -1) CReactionsDlg(this, hCurrentEvent).DoModal(); break; - - case 3: // reply - if (hCurrentEvent != -1) - if (auto *pDlg = NS_GetSrmm((HANDLE)pHandle)) - pDlg->SetQuoteEvent(hCurrentEvent); - break; } return 0; } diff --git a/protocols/Telegram/src/proto.cpp b/protocols/Telegram/src/proto.cpp index d23574b4e3..c7836d4e03 100644 --- a/protocols/Telegram/src/proto.cpp +++ b/protocols/Telegram/src/proto.cpp @@ -330,7 +330,7 @@ INT_PTR CTelegramProto::GetCaps(int type, MCONTACT) return PF2_ONLINE | PF2_SHORTAWAY | PF2_LONGAWAY; case PFLAGNUM_4: - return PF4_NOCUSTOMAUTH | PF4_FORCEAUTH | PF4_OFFLINEFILES | PF4_NOAUTHDENYREASON | PF4_SUPPORTTYPING | PF4_AVATARS | PF4_SERVERMSGID; + return PF4_NOCUSTOMAUTH | PF4_FORCEAUTH | PF4_OFFLINEFILES | PF4_NOAUTHDENYREASON | PF4_SUPPORTTYPING | PF4_AVATARS | PF4_SERVERMSGID | PF4_REPLY; case PFLAGNUM_5: return PF2_SHORTAWAY | PF2_LONGAWAY; diff --git a/protocols/Telegram/src/proto.h b/protocols/Telegram/src/proto.h index 172024ccdf..8cf525801a 100644 --- a/protocols/Telegram/src/proto.h +++ b/protocols/Telegram/src/proto.h @@ -327,7 +327,7 @@ class CTelegramProto : public PROTO<CTelegramProto> MCONTACT GetRealContact(const TG_USER *pUser); // Menus - HGENMENU hmiForward, hmiReaction, hmiReply; + HGENMENU hmiForward, hmiReaction; void InitMenus(); diff --git a/protocols/Telegram/src/resource.h b/protocols/Telegram/src/resource.h index ed68daa9f4..dd6b5a8f0f 100644 --- a/protocols/Telegram/src/resource.h +++ b/protocols/Telegram/src/resource.h @@ -13,7 +13,6 @@ #define IDI_REACTION 108
#define IDD_REACTIONS 109
#define IDI_BOT 110
-#define IDI_REPLY 111
#define IDD_OPTIONS_SESSIONS 112
#define IDC_PHONE 1001
#define IDC_DEFGROUP 1002
|