From 6b12ab62f6aee61ded7bf4fab76b93975785e721 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Mon, 4 Mar 2019 22:10:26 +0300 Subject: MenuItemEx: Request Auth menu item removed --- plugins/MenuItemEx/res/resource.rc | 51 +++++++++++++++---------------- plugins/MenuItemEx/src/main.cpp | 61 +------------------------------------- plugins/MenuItemEx/src/options.cpp | 4 +-- plugins/MenuItemEx/src/resource.h | 3 +- plugins/MenuItemEx/src/stdafx.h | 37 +++++++++++------------ plugins/MenuItemEx/src/version.h | 2 +- 6 files changed, 48 insertions(+), 110 deletions(-) (limited to 'plugins/MenuItemEx') diff --git a/plugins/MenuItemEx/res/resource.rc b/plugins/MenuItemEx/res/resource.rc index cccbab98b4..3ca94c4cd4 100644 --- a/plugins/MenuItemEx/res/resource.rc +++ b/plugins/MenuItemEx/res/resource.rc @@ -44,29 +44,28 @@ IDI_ICON13 ICON "CopyMirVer.ico" // Dialog // -IDD_OPTIONS DIALOGEX 0, 0, 280, 217 +IDD_OPTIONS DIALOGEX 0, 0, 280, 158 STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD EXSTYLE WS_EX_CONTROLPARENT FONT 8, "MS Shell Dlg", 0, 0, 0x1 BEGIN - GROUPBOX "Shown menu items",IDC_STATIC,7,7,266,163 - CONTROL "Visibility",IDC_VIS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,16,18,136,10 + GROUPBOX "Shown menu items",IDC_STATIC,7,7,266,146 + CONTROL "Visibility",IDC_VIS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,16,18,131,10 CONTROL "Show alpha icons",IDC_SHOWALPHAICONS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,151,18,116,10 - CONTROL "Hide from list",IDC_HIDE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,16,30,136,10 - CONTROL "Ignore",IDC_IGNORE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,16,42,136,10 + CONTROL "Hide from list",IDC_HIDE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,16,30,131,10 + CONTROL "Ignore",IDC_IGNORE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,16,42,131,10 CONTROL "Copy to Account (Ctrl+click for move to Account)",IDC_PROTOS, "Button",BS_AUTOCHECKBOX | WS_TABSTOP,16,54,251,10 - CONTROL "Request Authorization",IDC_AUTHREQ,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,16,66,136,10 - CONTROL "Browse Received Files",IDC_RECVFILES,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,16,78,136,10 - CONTROL "Copy IP",IDC_COPYIP,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,16,90,136,10 - CONTROL "Copy MirVer",IDC_COPYMIRVER,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,16,102,136,10 - CONTROL "Copy Status Message",IDC_STATUSMSG,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,16,114,136,10 - CONTROL "Add item name",IDC_SMNAME,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,151,114,116,10 - CONTROL "Copy ID",IDC_COPYID,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,16,124,136,10 - CONTROL "Add protocol name",IDC_COPYIDNAME,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,151,124,116,10 - CONTROL "Show ID in menu item",IDC_SHOWID,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,25,138,127,10 - CONTROL "Trim too long ID",IDC_TRIMID,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,151,138,116,10 - LTEXT "* Use Ctrl+click to see popup with the copied text",IDC_HINT1,16,154,251,11 + CONTROL "Browse Received Files",IDC_RECVFILES,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,16,66,131,10 + CONTROL "Copy IP",IDC_COPYIP,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,16,78,131,10 + CONTROL "Copy MirVer",IDC_COPYMIRVER,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,16,90,131,10 + CONTROL "Copy Status Message",IDC_STATUSMSG,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,16,102,131,10 + CONTROL "Add item name",IDC_SMNAME,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,151,102,116,10 + CONTROL "Copy ID",IDC_COPYID,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,16,114,131,10 + CONTROL "Add protocol name",IDC_COPYIDNAME,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,151,114,116,10 + CONTROL "Show ID in menu item",IDC_SHOWID,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,25,126,122,10 + CONTROL "Trim too long ID",IDC_TRIMID,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,151,126,116,10 + LTEXT "* Use Ctrl+click to see popup with the copied text",IDC_HINT1,16,138,251,11 CONTROL "Hide contact on 'Ignore all'",IDC_IGNOREHIDE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,151,42,116,10 END @@ -79,14 +78,6 @@ END #ifdef APSTUDIO_INVOKED GUIDELINES DESIGNINFO BEGIN - IDD_AUTHREQ, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 179 - TOPMARGIN, 7 - BOTTOMMARGIN, 64 - END - IDD_OPTIONS, DIALOG BEGIN LEFTMARGIN, 7 @@ -98,7 +89,6 @@ BEGIN VERTGUIDE, 214 VERTGUIDE, 267 TOPMARGIN, 7 - BOTTOMMARGIN, 211 END END #endif // APSTUDIO_INVOKED @@ -129,6 +119,17 @@ END #endif // APSTUDIO_INVOKED + +///////////////////////////////////////////////////////////////////////////// +// +// AFX_DIALOG_LAYOUT +// + +IDD_OPTIONS AFX_DIALOG_LAYOUT +BEGIN + 0 +END + #endif // Neutral resources ///////////////////////////////////////////////////////////////////////////// diff --git a/plugins/MenuItemEx/src/main.cpp b/plugins/MenuItemEx/src/main.cpp index cf5031a18c..b96e3cdd2b 100644 --- a/plugins/MenuItemEx/src/main.cpp +++ b/plugins/MenuItemEx/src/main.cpp @@ -5,7 +5,6 @@ #define MS_HIDE "MenuEx/Hide" #define MS_IGNORE "MenuEx/Ignore" #define MS_PROTO "MenuEx/ChangeProto" -#define MS_AUTHREQ "MenuEx/SendAuthReq" #define MS_COPYID "MenuEx/CopyID" #define MS_RECVFILES "MenuEx/RecvFiles" #define MS_STATUSMSG "MenuEx/CopyStatusMsg" @@ -15,7 +14,7 @@ const int vf_default = VF_VS | VF_HFL | VF_IGN | VF_CID | VF_SHOWID | VF_RECV | VF_STAT | VF_SMNAME | VF_CIDN | VF_CIP; -HGENMENU hmenuVis, hmenuOff, hmenuHide, hmenuIgnore, hmenuProto, hmenuAuthReq; +HGENMENU hmenuVis, hmenuOff, hmenuHide, hmenuIgnore, hmenuProto; HGENMENU hmenuCopyID, hmenuRecvFiles, hmenuStatusMsg, hmenuCopyIP, hmenuCopyMirVer; static HGENMENU hIgnoreItem[9], hProtoItem[MAX_PROTOS]; HICON hIcons[5]; @@ -356,57 +355,12 @@ static LRESULT CALLBACK AuthReqEditSubclassProc(HWND hwnd, UINT msg, WPARAM wPar return mir_callNextSubclass(hwnd, AuthReqEditSubclassProc, msg, wParam, lParam); } -static INT_PTR CALLBACK AuthReqWndProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM lparam) -{ - static MCONTACT hcontact; - - switch (msg) { - case WM_INITDIALOG: - TranslateDialogDefault(hdlg); - mir_subclassWindow(GetDlgItem(hdlg, IDC_REASON), AuthReqEditSubclassProc); - SendDlgItemMessage(hdlg, IDC_REASON, EM_LIMITTEXT, (WPARAM)255, 0); - SetDlgItemText(hdlg, IDC_REASON, TranslateT("Please authorize me to add you to my contact list.")); - hcontact = (MCONTACT)lparam; - break; - - case WM_COMMAND: - switch (LOWORD(wparam)) { - case IDOK: - wchar_t tszReason[256]; - GetDlgItemText(hdlg, IDC_REASON, tszReason, _countof(tszReason)); - ProtoChainSend(hcontact, PSS_AUTHREQUEST, 0, (LPARAM)tszReason); - __fallthrough; - - case IDCANCEL: - DestroyWindow(hdlg); - break; - } - break; - } - - return 0; -} - static BOOL isProtoOnline(char *szProto) { int protoStatus = Proto_GetStatus(szProto); return (protoStatus > ID_STATUS_OFFLINE && protoStatus < ID_STATUS_IDLE); } -static INT_PTR onSendAuthRequest(WPARAM wparam, LPARAM) -{ - MCONTACT hContact = (MCONTACT)wparam; - char *szProto = GetContactProto(hContact); - - DWORD flags = CallProtoService(szProto, PS_GETCAPS, PFLAGNUM_4, 0); - if (flags&PF4_NOCUSTOMAUTH) - ProtoChainSend(hContact, PSS_AUTHREQUEST, 0, (LPARAM)L""); - else - CreateDialogParam(g_plugin.getInst(), MAKEINTRESOURCE(IDD_AUTHREQ), g_clistApi.hwndContactList, AuthReqWndProc, (LPARAM)hContact); - - return 0; -} - // set the invisible-flag in db static INT_PTR onSetInvis(WPARAM wparam, LPARAM) { @@ -673,9 +627,6 @@ static INT_PTR onChangeProto(WPARAM hContact, LPARAM lparam) else return 0; } - if (MessageBox(nullptr, TranslateT("Do you want to send authorization request\nto new contact?"), L"Miranda NG", MB_OKCANCEL | MB_SETFOREGROUND | MB_TOPMOST) == IDOK) - onSendAuthRequest((WPARAM)hContactNew, 0); - return 0; } @@ -786,8 +737,6 @@ static int BuildMenu(WPARAM wparam, LPARAM) } else Menu_ShowItem(hmenuProto, false); - Menu_ShowItem(hmenuAuthReq, (bShowAll || (flags & VF_REQ)) && bIsOnline && pa->IsEnabled()); - bEnabled = bShowAll || (flags & VF_CID); Menu_ShowItem(hmenuCopyID, bEnabled); if (bEnabled) @@ -956,13 +905,6 @@ static int PluginInit(WPARAM, LPARAM) mi.flags = CMIF_UNICODE; - SET_UID(mi, 0x332c5564, 0x6283, 0x43ff, 0xa2, 0xfc, 0x58, 0x29, 0x27, 0x83, 0xea, 0x1a); - mi.position++; - mi.name.w = LPGENW("Request authorization"); - mi.pszService = MS_AUTHREQ; - mi.hIcolibItem = Skin_LoadIcon(SKINICON_AUTH_REQUEST); - hmenuAuthReq = Menu_AddContactMenuItem(&mi); - SET_UID(mi, 0x92826bf6, 0xd44c, 0x4dc2, 0xb2, 0xdd, 0xfe, 0xaf, 0x9b, 0x86, 0xe1, 0x53); mi.position++; mi.name.w = LPGENW("Copy ID"); @@ -1017,7 +959,6 @@ int CMPlugin::Load() CreateServiceFunction(MS_HIDE, onHide); CreateServiceFunction(MS_IGNORE, onIgnore); CreateServiceFunction(MS_PROTO, onChangeProto); - CreateServiceFunction(MS_AUTHREQ, onSendAuthRequest); CreateServiceFunction(MS_COPYID, onCopyID); CreateServiceFunction(MS_RECVFILES, onRecvFiles); CreateServiceFunction(MS_STATUSMSG, onCopyStatusMsg); diff --git a/plugins/MenuItemEx/src/options.cpp b/plugins/MenuItemEx/src/options.cpp index 53788af1cf..2fc76947a7 100644 --- a/plugins/MenuItemEx/src/options.cpp +++ b/plugins/MenuItemEx/src/options.cpp @@ -17,7 +17,6 @@ static const checkboxes[] = { { IDC_IGNORE, VF_IGN }, { IDC_IGNOREHIDE, VF_IGNH }, { IDC_PROTOS, VF_PROTO }, - { IDC_AUTHREQ, VF_REQ }, { IDC_SHOWID, VF_SHOWID }, { IDC_COPYIDNAME, VF_CIDN }, { IDC_RECVFILES, VF_RECV }, @@ -29,7 +28,7 @@ class COptDialog : public CDlgBase { DWORD m_flags; - CCtrlCheck m_chkVis, m_chkAlpha, m_chkHide, m_chkIgnore, m_chkProtos, m_chkAuthReq, m_chkRecvFiles, m_chkCopyIP, m_chkCopyMirver, m_chkStatusMsg, + CCtrlCheck m_chkVis, m_chkAlpha, m_chkHide, m_chkIgnore, m_chkProtos, m_chkRecvFiles, m_chkCopyIP, m_chkCopyMirver, m_chkStatusMsg, m_chkSMName, m_chkCopyID, m_chkCopyIDName, m_chkShowID, m_chkTrimID, m_chkIgnoreHide; CCtrlLabel m_lblHint; @@ -51,7 +50,6 @@ public: m_chkHide(this, IDC_HIDE), m_chkIgnore(this, IDC_IGNORE), m_chkProtos(this, IDC_PROTOS), - m_chkAuthReq(this, IDC_AUTHREQ), m_chkRecvFiles(this, IDC_RECVFILES), m_chkCopyIP(this, IDC_COPYIP), m_chkCopyMirver(this, IDC_COPYMIRVER), diff --git a/plugins/MenuItemEx/src/resource.h b/plugins/MenuItemEx/src/resource.h index 60b1aacf23..1b51b15fe4 100644 --- a/plugins/MenuItemEx/src/resource.h +++ b/plugins/MenuItemEx/src/resource.h @@ -21,7 +21,6 @@ #define IDC_HIDE 1002 #define IDC_IGNORE 1003 #define IDC_PROTOS 1004 -#define IDC_AUTHREQ 1007 #define IDC_COPYID 1008 #define IDC_RECVFILES 1009 #define IDC_STATUSMSG 1010 @@ -39,7 +38,7 @@ // #ifdef APSTUDIO_INVOKED #ifndef APSTUDIO_READONLY_SYMBOLS -#define _APS_NEXT_RESOURCE_VALUE 124 +#define _APS_NEXT_RESOURCE_VALUE 125 #define _APS_NEXT_COMMAND_VALUE 40001 #define _APS_NEXT_CONTROL_VALUE 1017 #define _APS_NEXT_SYMED_VALUE 125 diff --git a/plugins/MenuItemEx/src/stdafx.h b/plugins/MenuItemEx/src/stdafx.h index 431f3faff8..7092a72bbf 100644 --- a/plugins/MenuItemEx/src/stdafx.h +++ b/plugins/MenuItemEx/src/stdafx.h @@ -43,26 +43,25 @@ struct CMPlugin : public PLUGIN int OptionsInit(WPARAM, LPARAM); -#define MAX_PROTOS 32 -#define MAX_GROUPS 32 -#define MAX_IDLEN 16 +#define MAX_PROTOS 32 +#define MAX_GROUPS 32 +#define MAX_IDLEN 16 -#define VF_VS 0x00000001 -#define VF_SMNAME 0x00000002 -#define VF_HFL 0x00000004 -#define VF_IGN 0x00000008 -#define VF_PROTO 0x00000010 -#define VF_SHOWID 0x00000020 -#define VF_REQ 0x00000080 -#define VF_CID 0x00000100 -#define VF_RECV 0x00000200 -#define VF_STAT 0x00000400 -#define VF_CIDN 0x00000800 -#define VF_CIP 0x00001000 -#define VF_SAI 0x00002000 -#define VF_TRIMID 0x00004000 -#define VF_CMV 0x00008000 -#define VF_IGNH 0x00010000 +#define VF_VS 0x00000001 +#define VF_SMNAME 0x00000002 +#define VF_HFL 0x00000004 +#define VF_IGN 0x00000008 +#define VF_PROTO 0x00000010 +#define VF_SHOWID 0x00000020 +#define VF_CID 0x00000100 +#define VF_RECV 0x00000200 +#define VF_STAT 0x00000400 +#define VF_CIDN 0x00000800 +#define VF_CIP 0x00001000 +#define VF_SAI 0x00002000 +#define VF_TRIMID 0x00004000 +#define VF_CMV 0x00008000 +#define VF_IGNH 0x00010000 #define CTRL_IS_PRESSED (GetAsyncKeyState(VK_CONTROL)&0x8000) diff --git a/plugins/MenuItemEx/src/version.h b/plugins/MenuItemEx/src/version.h index b8d16932e6..6916e7d134 100644 --- a/plugins/MenuItemEx/src/version.h +++ b/plugins/MenuItemEx/src/version.h @@ -1,6 +1,6 @@ #define __MAJOR_VERSION 1 #define __MINOR_VERSION 3 -#define __RELEASE_NUM 1 +#define __RELEASE_NUM 2 #define __BUILD_NUM 0 #include -- cgit v1.2.3