diff options
Diffstat (limited to 'plugins/NewStory')
-rw-r--r-- | plugins/NewStory/res/nopassword.ico | bin | 2550 -> 0 bytes | |||
-rw-r--r-- | plugins/NewStory/res/password.ico | bin | 2550 -> 0 bytes | |||
-rw-r--r-- | plugins/NewStory/res/resource.rc | 128 | ||||
-rw-r--r-- | plugins/NewStory/res/save pass.ico | bin | 2550 -> 0 bytes | |||
-rw-r--r-- | plugins/NewStory/src/history.cpp | 25 | ||||
-rw-r--r-- | plugins/NewStory/src/main.cpp | 5 | ||||
-rw-r--r-- | plugins/NewStory/src/opt_passwords.cpp | 150 | ||||
-rw-r--r-- | plugins/NewStory/src/opt_passwords.h | 6 | ||||
-rw-r--r-- | plugins/NewStory/src/options.cpp | 4 | ||||
-rw-r--r-- | plugins/NewStory/src/password.cpp | 215 | ||||
-rw-r--r-- | plugins/NewStory/src/password.h | 8 | ||||
-rw-r--r-- | plugins/NewStory/src/resource.h | 17 | ||||
-rw-r--r-- | plugins/NewStory/src/stdafx.h | 2 | ||||
-rw-r--r-- | plugins/NewStory/src/templates.cpp | 3 | ||||
-rw-r--r-- | plugins/NewStory/src/templates.h | 1 |
15 files changed, 5 insertions, 559 deletions
diff --git a/plugins/NewStory/res/nopassword.ico b/plugins/NewStory/res/nopassword.ico Binary files differdeleted file mode 100644 index 7512ea821c..0000000000 --- a/plugins/NewStory/res/nopassword.ico +++ /dev/null diff --git a/plugins/NewStory/res/password.ico b/plugins/NewStory/res/password.ico Binary files differdeleted file mode 100644 index 50798a776f..0000000000 --- a/plugins/NewStory/res/password.ico +++ /dev/null diff --git a/plugins/NewStory/res/resource.rc b/plugins/NewStory/res/resource.rc index 9d70a23ae8..bccc8e37d8 100644 --- a/plugins/NewStory/res/resource.rc +++ b/plugins/NewStory/res/resource.rc @@ -44,14 +44,11 @@ ICO_URL ICON "17 url.ico" ICO_UNKNOWN ICON "18 unknown.ico" ICO_FINDPREV ICON "19 findprev.ico" ICO_FINDNEXT ICON "20 findnext.ico" -ICO_NOPASSWORD ICON "nopassword.ico" -ICO_PASSWORD ICON "password.ico" ICO_CALENDAR ICON "Calendar.ico" ICO_RESET ICON "reset.ico" ICO_PREVIEW ICON "reload.ico" ICO_VARHELP ICON "vars.ico" ICO_TPLGROUP ICON "folder.ico" -ICO_SAVEPASS ICON "save pass.ico" ///////////////////////////////////////////////////////////////////////////// @@ -108,7 +105,6 @@ BEGIN ICON "",IDC_SEARCHICON,1,298,20,20,SS_CENTERIMAGE CONTROL "",IDC_LOGOPTIONS,"MButtonClass",WS_TABSTOP,116,99,16,14 CONTROL "Tree1",IDC_TIMETREE,"SysTreeView32",TVS_DISABLEDRAGDROP | TVS_SHOWSELALWAYS | TVS_TRACKSELECT | TVS_FULLROWSELECT | TVS_SINGLEEXPAND | NOT WS_VISIBLE | WS_TABSTOP,0,134,84,160,WS_EX_STATICEDGE - CONTROL "",IDC_SECURITY,"MButtonClass",WS_TABSTOP,347,99,16,14 CONTROL "",IDC_DATEPOPUP,"MButtonClass",WS_TABSTOP,148,99,16,14 CONTROL "",IDC_ITEMS2,"NewstoryList",WS_TABSTOP,90,132,290,166 CONTROL "",IDC_IB_SEPARATOR,"Static",SS_ETCHEDHORZ,21,76,124,1 @@ -142,17 +138,6 @@ BEGIN CONTROL "till",IDC_CHK_DATE_TO,"Button",BS_AUTOCHECKBOX | BS_RIGHT | BS_VCENTER | BS_FLAT | WS_TABSTOP,210,97,33,10,WS_EX_TRANSPARENT | WS_EX_RIGHT END -IDD_PASSWORD DIALOGEX 0, 0, 259, 61 -STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION -CAPTION "Newstory" -FONT 8, "MS Shell Dlg", 0, 0, 0x1 -BEGIN - DEFPUSHBUTTON "OK",IDOK,147,39,50,15 - PUSHBUTTON "Cancel",IDCANCEL,202,39,50,15 - LTEXT "Ooops! This is a protected area, so type your password here:",IDC_STATIC,7,7,192,8 - EDITTEXT IDC_PASSWORD,12,20,240,14,ES_PASSWORD | ES_AUTOHSCROLL -END - IDD_CALENDARTOOL DIALOGEX 0, 0, 98, 85 STYLE DS_SETFONT | WS_POPUP | WS_BORDER EXSTYLE WS_EX_TOOLWINDOW @@ -161,21 +146,6 @@ BEGIN CONTROL "MonthCalendar1",IDC_MONTHCALENDAR1,"SysMonthCal32",MCS_NOTODAYCIRCLE | WS_TABSTOP,0,0,98,85 END -IDD_CHANGEPASSWORD DIALOGEX 0, 0, 259, 126 -STYLE DS_SETFONT | DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION -CAPTION "Change Newstory Password" -FONT 8, "MS Shell Dlg", 0, 0, 0x1 -BEGIN - DEFPUSHBUTTON "OK",IDOK,148,103,50,16 - PUSHBUTTON "Cancel",IDCANCEL,202,103,50,16 - LTEXT "Current Password:",IDC_STATIC,7,7,58,8 - EDITTEXT IDC_PASSWORD,12,20,240,14,ES_PASSWORD | ES_AUTOHSCROLL - LTEXT "New password:",IDC_STATIC,7,39,50,8 - EDITTEXT IDC_PASSWORD2,12,52,240,14,ES_PASSWORD | ES_AUTOHSCROLL - LTEXT "Confirm new password:",IDC_STATIC,7,71,74,8 - EDITTEXT IDC_PASSWORD3,12,84,240,14,ES_PASSWORD | ES_AUTOHSCROLL -END - IDD_OPTIONS DIALOGEX 0, 0, 314, 240 STYLE DS_SETFONT | WS_CHILD FONT 8, "MS Shell Dlg", 0, 0, 0x1 @@ -207,29 +177,6 @@ BEGIN CTEXT "Coming soon...",IDC_STATIC,7,7,293,209,SS_CENTERIMAGE END -IDD_OPT_PASSWORDS DIALOGEX 0, 0, 307, 223 -STYLE DS_SETFONT | WS_CHILD -FONT 8, "MS Shell Dlg", 0, 0, 0x1 -BEGIN - LTEXT "Edit password for:",IDC_STATIC,7,7,125,8 - LTEXT "Current password:",IDC_STATIC,137,20,163,8 - CONTROL "",IDC_LIST,"CListControl",WS_TABSTOP | 0x1d0,13,21,118,194 - EDITTEXT IDC_CHANGEPASS,142,34,158,14,ES_PASSWORD | ES_AUTOHSCROLL - LTEXT "New password:",IDC_STATIC,137,54,163,8 - EDITTEXT IDC_CHANGEPASS2,142,67,158,14,ES_PASSWORD | ES_AUTOHSCROLL - LTEXT "Confirm new password",IDC_STATIC,137,86,163,8 - EDITTEXT IDC_CHANGEPASS3,142,99,158,14,ES_PASSWORD | ES_AUTOHSCROLL - CONTROL "",IDC_SAVEPASSWORD,"MButtonClass",WS_TABSTOP,284,118,16,14 - CONTROL "",IDC_STATIC,"Static",SS_BLACKFRAME,12,20,120,196 - CONTROL "",IDC_STATIC,"Static",SS_ETCHEDHORZ,137,139,163,1 - LTEXT "Password is NOT set for the contact",IDC_STATIC,158,146,142,14,SS_CENTERIMAGE - LTEXT "Password is set for the contact",IDC_STATIC,158,160,142,14,SS_CENTERIMAGE - ICON "",IDC_ICO_PASSWORD,137,160,16,14,SS_CENTERIMAGE | SS_REALSIZEIMAGE - ICON "",IDC_ICO_NOPASSWORD,137,146,16,14,SS_CENTERIMAGE | SS_REALSIZEIMAGE - LTEXT "Global password is password used to access history of contacts with no password set.",IDC_STATIC,137,179,163,16 - LTEXT "Master password can be used to override ANY password. This may be useful if you forget some...",IDC_STATIC,137,200,163,16 -END - IDD_FILTERMODE DIALOGEX 0, 0, 219, 171 STYLE DS_SETFONT | DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU EXSTYLE WS_EX_NOPARENTNOTIFY @@ -309,49 +256,10 @@ BEGIN HORZGUIDE, 149 END - IDD_PASSWORD, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 252 - VERTGUIDE, 12 - VERTGUIDE, 119 - VERTGUIDE, 197 - VERTGUIDE, 202 - TOPMARGIN, 7 - BOTTOMMARGIN, 54 - HORZGUIDE, 15 - HORZGUIDE, 20 - HORZGUIDE, 34 - HORZGUIDE, 39 - END - IDD_CALENDARTOOL, DIALOG BEGIN END - IDD_CHANGEPASSWORD, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 252 - VERTGUIDE, 12 - VERTGUIDE, 198 - VERTGUIDE, 202 - TOPMARGIN, 7 - BOTTOMMARGIN, 119 - HORZGUIDE, 15 - HORZGUIDE, 20 - HORZGUIDE, 34 - HORZGUIDE, 39 - HORZGUIDE, 47 - HORZGUIDE, 52 - HORZGUIDE, 66 - HORZGUIDE, 71 - HORZGUIDE, 79 - HORZGUIDE, 84 - HORZGUIDE, 98 - HORZGUIDE, 103 - END - IDD_OPTIONS, DIALOG BEGIN RIGHTMARGIN, 235 @@ -393,41 +301,6 @@ BEGIN BOTTOMMARGIN, 216 END - IDD_OPT_PASSWORDS, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 300 - VERTGUIDE, 12 - VERTGUIDE, 132 - VERTGUIDE, 137 - VERTGUIDE, 142 - VERTGUIDE, 153 - VERTGUIDE, 158 - TOPMARGIN, 7 - BOTTOMMARGIN, 216 - HORZGUIDE, 15 - HORZGUIDE, 20 - HORZGUIDE, 28 - HORZGUIDE, 34 - HORZGUIDE, 48 - HORZGUIDE, 54 - HORZGUIDE, 62 - HORZGUIDE, 67 - HORZGUIDE, 81 - HORZGUIDE, 86 - HORZGUIDE, 94 - HORZGUIDE, 99 - HORZGUIDE, 113 - HORZGUIDE, 118 - HORZGUIDE, 132 - HORZGUIDE, 146 - HORZGUIDE, 160 - HORZGUIDE, 174 - HORZGUIDE, 179 - HORZGUIDE, 195 - HORZGUIDE, 200 - END - IDD_FILTERMODE, DIALOG BEGIN LEFTMARGIN, 7 @@ -499,7 +372,6 @@ BEGIN MENUITEM SEPARATOR MENUITEM "Options...", ID_LOGOPTIONS_OPTIONS MENUITEM "Templates...", ID_LOGOPTIONS_TEMPLATES - MENUITEM "Passwords...", ID_LOGOPTIONS_PASSWORDS END POPUP "Context" BEGIN diff --git a/plugins/NewStory/res/save pass.ico b/plugins/NewStory/res/save pass.ico Binary files differdeleted file mode 100644 index 9df7ce86e1..0000000000 --- a/plugins/NewStory/res/save pass.ico +++ /dev/null diff --git a/plugins/NewStory/src/history.cpp b/plugins/NewStory/src/history.cpp index 16ef59df54..6723d7f48c 100644 --- a/plugins/NewStory/src/history.cpp +++ b/plugins/NewStory/src/history.cpp @@ -72,11 +72,11 @@ enum TBTN_USERINFO, TBTN_USERMENU, TBTN_MESSAGE, TBTN_SEARCH, TBTN_FILTER, TBTN_DATEPOPUP, TBTN_COPY, TBTN_EXPORT, - TBTN_LOGOPTIONS, TBTN_SECURITY, TBTN_CLOSE, + TBTN_LOGOPTIONS, TBTN_CLOSE, TBTN_COUNT }; -int tbtnSpacing[TBTN_COUNT] = { 0, 0, TBTN_SPACER, 0, 0, TBTN_SPACER, 0, -1, 0, 0, 0 }; +int tbtnSpacing[TBTN_COUNT] = { 0, 0, TBTN_SPACER, 0, 0, TBTN_SPACER, 0, -1, 0, 0 }; struct InfoBarEvents { @@ -435,7 +435,6 @@ INT_PTR CALLBACK HistoryDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPara data->hwndBtnToolbar[TBTN_LOGOPTIONS] = GetDlgItem(hwnd, IDC_LOGOPTIONS); data->hwndBtnToolbar[TBTN_FILTER] = GetDlgItem(hwnd, IDC_FILTER); data->hwndBtnToolbar[TBTN_DATEPOPUP] = GetDlgItem(hwnd, IDC_DATEPOPUP); - data->hwndBtnToolbar[TBTN_SECURITY] = GetDlgItem(hwnd, IDC_SECURITY); data->hwndBtnToolbar[TBTN_CLOSE] = GetDlgItem(hwnd, IDC_CLOSE); data->hwndLog = GetDlgItem(hwnd, IDC_ITEMS2); data->hwndBtnCloseSearch = GetDlgItem(hwnd, IDC_SEARCHICON); @@ -544,7 +543,6 @@ INT_PTR CALLBACK HistoryDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPara SendMessage(GetDlgItem(hwnd, IDC_SEARCH), BUTTONSETASFLATBTN, 0, 0); SendMessage(GetDlgItem(hwnd, IDC_EXPORT), BUTTONSETASFLATBTN, 0, 0); SendMessage(GetDlgItem(hwnd, IDC_CLOSE), BUTTONSETASFLATBTN, 0, 0); - SendMessage(GetDlgItem(hwnd, IDC_SECURITY), BUTTONSETASFLATBTN, 0, 0); SendMessage(GetDlgItem(hwnd, IDC_FINDPREV), BUTTONSETASFLATBTN, 0, 0); SendMessage(GetDlgItem(hwnd, IDC_FINDNEXT), BUTTONSETASFLATBTN, 0, 0); @@ -558,7 +556,6 @@ INT_PTR CALLBACK HistoryDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPara SendMessage(GetDlgItem(hwnd, IDC_SEARCH), BUTTONADDTOOLTIP, (WPARAM)Translate("Search..."), 0); SendMessage(GetDlgItem(hwnd, IDC_EXPORT), BUTTONADDTOOLTIP, (WPARAM)Translate("Export..."), 0); SendMessage(GetDlgItem(hwnd, IDC_CLOSE), BUTTONADDTOOLTIP, (WPARAM)Translate("Close"), 0); - SendMessage(GetDlgItem(hwnd, IDC_SECURITY), BUTTONADDTOOLTIP, (WPARAM)Translate("Security Options"), 0); SendMessage(GetDlgItem(hwnd, IDC_FINDPREV), BUTTONADDTOOLTIP, (WPARAM)Translate("Find Previous"), 0); SendMessage(GetDlgItem(hwnd, IDC_FINDNEXT), BUTTONADDTOOLTIP, (WPARAM)Translate("Find Next"), 0); @@ -626,11 +623,6 @@ INT_PTR CALLBACK HistoryDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPara SendMessage(data->ibTotal.hwndIcoIn, BM_SETIMAGE, IMAGE_ICON, (LPARAM)g_plugin.getIcon(ICO_MSGIN)); SendMessage(data->ibTotal.hwndIcoOut, BM_SETIMAGE, IMAGE_ICON, (LPARAM)g_plugin.getIcon(ICO_MSGOUT)); - if (CheckPassword(data->hContact, "")) - SendMessage(GetDlgItem(hwnd, IDC_SECURITY), BM_SETIMAGE, IMAGE_ICON, (LPARAM)g_plugin.getIcon(ICO_NOPASSWORD)); - else - SendMessage(GetDlgItem(hwnd, IDC_SECURITY), BM_SETIMAGE, IMAGE_ICON, (LPARAM)g_plugin.getIcon(ICO_PASSWORD)); - break; case UM_REBUILDLIST: @@ -800,10 +792,6 @@ INT_PTR CALLBACK HistoryDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPara case ID_LOGOPTIONS_TEMPLATES: g_plugin.openOptions(nullptr, L"Newstory", L"Templates"); break; - - case ID_LOGOPTIONS_PASSWORDS: - g_plugin.openOptions(nullptr, L"Newstory", L"Passwords (not ready yet)"); - break; } PostMessage(hwnd, WM_SIZE, 0, 0); break; @@ -901,11 +889,6 @@ INT_PTR CALLBACK HistoryDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPara PostMessage(hwnd, UM_REBUILDLIST, 0, 0); break;*/ - case IDC_SECURITY: - ChangePassword(hwnd, data->hContact); - PostMessage(hwnd, UM_UPDATEICONS, 0, 0); - break; - case IDC_EXPORT: // ExportHistoryDialog(data->hContact, hwnd); // DialogBox(hInst, MAKEINTRESOURCE(IDD_EXPORT), hwnd, ExportWndProc); @@ -966,7 +949,7 @@ INT_PTR svcShowNewstory(WPARAM wParam, LPARAM) SetWindowPos(hwnd, HWND_TOP, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE); SetFocus(hwnd); } - else if (AskPassword((MCONTACT)wParam)) { + else { HWND hwnd2 = CreateDialogParam(g_plugin.getInst(), MAKEINTRESOURCE(IDD_HISTORY), 0, HistoryDlgProc, wParam); ShowWindow(hwnd2, SW_SHOWNORMAL); } @@ -980,7 +963,7 @@ INT_PTR svcShowSystemNewstory(WPARAM, LPARAM) SetWindowPos(hwnd, HWND_TOP, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE); SetFocus(hwnd); } - else if (AskPassword(0)) { + else { HWND hwnd2 = CreateDialogParam(g_plugin.getInst(), MAKEINTRESOURCE(IDD_HISTORY), 0, HistoryDlgProc, 0); ShowWindow(hwnd2, SW_SHOWNORMAL); } diff --git a/plugins/NewStory/src/main.cpp b/plugins/NewStory/src/main.cpp index 7bdfb36713..69a455ff93 100644 --- a/plugins/NewStory/src/main.cpp +++ b/plugins/NewStory/src/main.cpp @@ -64,15 +64,12 @@ static IconItem icons[] = { LPGEN("Find Previous"), "findprev", ICO_FINDPREV }, { LPGEN("Find Next"), "findnext", ICO_FINDNEXT }, - { LPGEN("Password disabled"), "nopassword",ICO_NOPASSWORD }, - { LPGEN("Password enabled"), "password", ICO_PASSWORD }, { LPGEN("Jump to Date"), "calendar", ICO_CALENDAR }, { LPGEN("Template Group"), "tplgroup", ICO_TPLGROUP }, { LPGEN("Reset"), "reset", ICO_RESET }, { LPGEN("Update Preview"), "preview", ICO_PREVIEW }, - { LPGEN("Help"), "varhelp", ICO_VARHELP }, - { LPGEN("Save Password"), "savepass", ICO_SAVEPASS } + { LPGEN("Help"), "varhelp", ICO_VARHELP } }; int evtModulesLoaded(WPARAM, LPARAM) diff --git a/plugins/NewStory/src/opt_passwords.cpp b/plugins/NewStory/src/opt_passwords.cpp deleted file mode 100644 index 46b280ba98..0000000000 --- a/plugins/NewStory/src/opt_passwords.cpp +++ /dev/null @@ -1,150 +0,0 @@ -#include "stdafx.h" - -int icoidNoPassword, icoidPassword; - -void SetAllContactIcons(HWND hwndList) -{ - for (auto &hContact : Contacts()) { - MCONTACT hItem = (MCONTACT)SendMessage(hwndList, CLM_FINDCONTACT, (WPARAM)hContact, 0); - SendMessage(hwndList, CLM_SETEXTRAIMAGE, (WPARAM)hItem, MAKELPARAM(0, CheckPassword(hContact, "") ? icoidNoPassword : icoidPassword)); - } -} - -static void ResetListOptions(HWND hwndList) -{ - SendMessage(hwndList, CLM_SETBKBITMAP, 0, (LPARAM)(HBITMAP)NULL); - SendMessage(hwndList, CLM_SETBKCOLOR, GetSysColor(COLOR_WINDOW), 0); - SendMessage(hwndList, CLM_SETGREYOUTFLAGS, 0, 0); - SendMessage(hwndList, CLM_SETLEFTMARGIN, 2, 0); - SendMessage(hwndList, CLM_SETINDENT, 10, 0); - for (int i = 0; i <= FONTID_MAX; i++) - SendMessage(hwndList, CLM_SETTEXTCOLOR, i, GetSysColor(COLOR_WINDOWTEXT)); - SetWindowLongPtr(hwndList, GWL_STYLE, GetWindowLongPtr(hwndList, GWL_STYLE) | CLS_SHOWHIDDEN); -} - -INT_PTR CALLBACK OptPasswordsDlgProc(HWND hwnd, UINT msg, WPARAM, LPARAM lParam) -{ - HTREEITEM hitmGlobal, hitmMaster; - switch (msg) { - case WM_INITDIALOG: - HIMAGELIST himg; - himg = ImageList_Create(GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), ILC_COLOR32 | ILC_MASK, 3, 3); - icoidNoPassword = ImageList_AddIcon(himg, g_plugin.getIcon(ICO_NOPASSWORD)); - icoidPassword = ImageList_AddIcon(himg, g_plugin.getIcon(ICO_PASSWORD)); - SendDlgItemMessage(hwnd, IDC_LIST, CLM_SETEXTRAIMAGELIST, 0, (LPARAM)himg); - - SendDlgItemMessage(hwnd, IDC_LIST, CLM_SETEXTRACOLUMNS, 1, 0); - { - CLCINFOITEM cii = { 0 }; - cii.cbSize = sizeof(cii); - cii.flags = CLCIIF_GROUPFONT; - - cii.pszText = TranslateT("** Global **"); - hitmGlobal = (HTREEITEM)SendDlgItemMessage(hwnd, IDC_LIST, CLM_ADDINFOITEM, 0, (LPARAM)&cii); - SendMessage(GetDlgItem(hwnd, IDC_LIST), CLM_SETEXTRAIMAGE, (WPARAM)hitmGlobal, MAKELPARAM(0, icoidNoPassword)); - - cii.pszText = TranslateT("** Master **"); - hitmMaster = (HTREEITEM)SendDlgItemMessage(hwnd, IDC_LIST, CLM_ADDINFOITEM, 0, (LPARAM)&cii); - SendMessage(GetDlgItem(hwnd, IDC_LIST), CLM_SETEXTRAIMAGE, (WPARAM)hitmMaster, MAKELPARAM(0, icoidNoPassword)); - } - SetAllContactIcons(GetDlgItem(hwnd, IDC_LIST)); - ResetListOptions(GetDlgItem(hwnd, IDC_LIST)); - - SendMessage(GetDlgItem(hwnd, IDC_ICO_NOPASSWORD), STM_SETICON, (WPARAM)g_plugin.getIcon(ICO_NOPASSWORD), 0); - SendMessage(GetDlgItem(hwnd, IDC_ICO_PASSWORD), STM_SETICON, (WPARAM)g_plugin.getIcon(ICO_PASSWORD), 0); - - SendMessage(GetDlgItem(hwnd, IDC_SAVEPASSWORD), BUTTONSETASFLATBTN, 0, 0); - SendMessage(GetDlgItem(hwnd, IDC_SAVEPASSWORD), BUTTONADDTOOLTIP, (WPARAM)Translate("Save Password"), 0); - SendMessage(GetDlgItem(hwnd, IDC_SAVEPASSWORD), BM_SETIMAGE, IMAGE_ICON, (LPARAM)g_plugin.getIcon(ICO_SAVEPASS)); - return TRUE; - - case WM_NOTIFY: - switch (((LPNMHDR)lParam)->idFrom) { - case 0: - switch (((LPNMHDR)lParam)->code) { - case PSN_RESET: - return TRUE; - - case PSN_APPLY: - return TRUE; - } - break; - - case IDC_LIST: - switch (((LPNMHDR)lParam)->code) { - case CLN_NEWCONTACT: - case CLN_LISTREBUILT: - SetAllContactIcons(GetDlgItem(hwnd, IDC_LIST)); - break; - //fall through -// case CLN_CONTACTMOVED: -// SetListGroupIcons(GetDlgItem(hwndDlg,IDC_LIST),(HANDLE)SendDlgItemMessage(hwndDlg,IDC_LIST,CLM_GETNEXTITEM,CLGN_ROOT,0),hItemAll,NULL); -// break; - - case CLN_OPTIONSCHANGED: - ResetListOptions(GetDlgItem(hwnd, IDC_LIST)); - break; - /* - case NM_CLICK: - { HANDLE hItem; - NMCLISTCONTROL *nm=(NMCLISTCONTROL*)lParam; - DWORD hitFlags; - int iImage; - int itemType; - - // Make sure we have an extra column - if (nm->iColumn == -1) - break; - - // Find clicked item - hItem = (HANDLE)SendDlgItemMessage(hwndDlg, IDC_LIST, CLM_HITTEST, (WPARAM)&hitFlags, MAKELPARAM(nm->pt.x,nm->pt.y)); - // Nothing was clicked - if (hItem == NULL) break; - // It was not a visbility icon - if (!(hitFlags & CLCHT_ONITEMEXTRA)) break; - - // Get image in clicked column (0=none, 1=visible, 2=invisible) - iImage = SendDlgItemMessage(hwndDlg, IDC_LIST, CLM_GETEXTRAIMAGE, (WPARAM)hItem, MAKELPARAM(nm->iColumn, 0)); - if (iImage == 0) - iImage=nm->iColumn + 1; - else - if (iImage == 1 || iImage == 2) - iImage = 0; - - // Get item type (contact, group, etc...) - itemType = SendDlgItemMessage(hwndDlg, IDC_LIST, CLM_GETITEMTYPE, (WPARAM)hItem, 0); - - // Update list, making sure that the options are mutually exclusive - if (itemType == CLCIT_CONTACT) { // A contact - SendDlgItemMessage(hwndDlg, IDC_LIST, CLM_SETEXTRAIMAGE, (WPARAM)hItem, MAKELPARAM(nm->iColumn, iImage)); - if (iImage && SendDlgItemMessage(hwndDlg,IDC_LIST,CLM_GETEXTRAIMAGE,(WPARAM)hItem,MAKELPARAM(nm->iColumn?0:1,0))!=0xFF) - SendDlgItemMessage(hwndDlg, IDC_LIST, CLM_SETEXTRAIMAGE, (WPARAM)hItem, MAKELPARAM(nm->iColumn?0:1, 0)); - } - else if (itemType == CLCIT_INFO) { // All Contacts - SetAllChildIcons(GetDlgItem(hwndDlg, IDC_LIST), hItem, nm->iColumn, iImage); - if (iImage) - SetAllChildIcons(GetDlgItem(hwndDlg, IDC_LIST), hItem, nm->iColumn?0:1, 0); - } - else if (itemType == CLCIT_GROUP) { // A group - hItem = (HANDLE)SendDlgItemMessage(hwndDlg, IDC_LIST, CLM_GETNEXTITEM, CLGN_CHILD, (LPARAM)hItem); - if (hItem) { - SetAllChildIcons(GetDlgItem(hwndDlg, IDC_LIST), hItem, nm->iColumn, iImage); - if (iImage) - SetAllChildIcons(GetDlgItem(hwndDlg, IDC_LIST), hItem, nm->iColumn?0:1, 0); - } - } - // Update the all/none icons - SetListGroupIcons(GetDlgItem(hwndDlg, IDC_LIST), (HANDLE)SendDlgItemMessage(hwndDlg, IDC_LIST, CLM_GETNEXTITEM, CLGN_ROOT, 0), hItemAll, NULL); - - // Activate Apply button - SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0); - break; - } - */ - } - return TRUE; - } - break; - } - return FALSE; -} diff --git a/plugins/NewStory/src/opt_passwords.h b/plugins/NewStory/src/opt_passwords.h deleted file mode 100644 index efe7d04793..0000000000 --- a/plugins/NewStory/src/opt_passwords.h +++ /dev/null @@ -1,6 +0,0 @@ -#ifndef __opt_passwords_h__ -#define __opt_passwords_h__ - -INT_PTR CALLBACK OptPasswordsDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam); - -#endif // __opt_passwords_h__
\ No newline at end of file diff --git a/plugins/NewStory/src/options.cpp b/plugins/NewStory/src/options.cpp index c3e92fd117..b5c7861f4c 100644 --- a/plugins/NewStory/src/options.cpp +++ b/plugins/NewStory/src/options.cpp @@ -20,10 +20,6 @@ static int OptionsInitialize(WPARAM wParam, LPARAM) odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_TEMPLATES); g_plugin.addOptions(wParam, &odp); - odp.szTab.w = LPGENW("Passwords (not ready yet)"); - odp.pfnDlgProc = OptPasswordsDlgProc; - odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_PASSWORDS); - g_plugin.addOptions(wParam, &odp); return 0; } diff --git a/plugins/NewStory/src/password.cpp b/plugins/NewStory/src/password.cpp deleted file mode 100644 index b3184d18c0..0000000000 --- a/plugins/NewStory/src/password.cpp +++ /dev/null @@ -1,215 +0,0 @@ -#include "stdafx.h" - -struct PasswordData -{ - MCONTACT hContact; - int attempt; -}; - -bool CheckPassword(MCONTACT hContact, char *password) -{ - mir_md5_state_t ms; - BYTE digest[16]; - mir_md5_init(&ms); - mir_md5_append(&ms, (const unsigned char *)password, lstrlenA(password)); - mir_md5_finish(&ms, digest); - - DBVARIANT dbv; - db_get(hContact, MODULENAME, "password", &dbv); - if (dbv.type != DBVT_BLOB) { - db_free(&dbv); - return true; - } - else { - if (dbv.cpbVal != 16) { - db_free(&dbv); - return false; - } - for (int i = 0; i < 16; i++) { - if (dbv.pbVal[i] != digest[i]) { - db_free(&dbv); - return false; - } - } - - db_free(&dbv); - return true; - } -} - -void SetPassword(MCONTACT hContact, char *password) -{ - if (!password || !*password) { - db_unset(hContact, MODULENAME, "password"); - return; - } - - mir_md5_state_t ms; - BYTE digest[16]; - mir_md5_init(&ms); - mir_md5_append(&ms, (const unsigned char *)password, lstrlenA(password)); - mir_md5_finish(&ms, digest); - - db_set_blob(hContact, MODULENAME, "password", (PBYTE)digest, 16); -} - -INT_PTR CALLBACK PasswordDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) -{ - PasswordData *data = (PasswordData *)GetWindowLongPtr(hwnd, GWLP_USERDATA); - switch (msg) { - case WM_INITDIALOG: - data = new PasswordData; - data->attempt = 0; - data->hContact = (MCONTACT)lParam; - SetWindowLongPtr(hwnd, GWLP_USERDATA, (LONG_PTR)data); - - RECT rc, rcMe; - SystemParametersInfo(SPI_GETWORKAREA, 0, &rc, 0); - GetWindowRect(hwnd, &rcMe); - SetWindowPos(hwnd, hwnd, - rc.left + ((rc.right - rc.left) - (rcMe.right - rcMe.left)) / 2, - rc.top + ((rc.bottom - rc.top) - (rcMe.bottom - rcMe.top)) / 2, - 0, 0, SWP_NOSIZE | SWP_NOZORDER); - - SetFocus(GetDlgItem(hwnd, IDC_PASSWORD)); - return TRUE; - - case WM_COMMAND: - { - switch (LOWORD(wParam)) { - case IDOK: - data->attempt++; - { - int length = GetWindowTextLengthA(GetDlgItem(hwnd, IDC_PASSWORD)); - char *input = new char[length + 1]; - GetWindowTextA(GetDlgItem(hwnd, IDC_PASSWORD), input, length + 1); - if (CheckPassword(data->hContact, input)) { - MessageBeep(MB_OK); - EndDialog(hwnd, 1); - } - else { - if (data->attempt >= 3) { - MessageBoxA(hwnd, "Sorry, but you've not managed to type\r\nthe correct password in 3 attempts.", "Newstory", MB_ICONHAND | MB_OK); - EndDialog(hwnd, 0); - } - else { - MessageBeep(MB_ICONHAND); - SetWindowTextA(GetDlgItem(hwnd, IDC_PASSWORD), ""); - } - } - delete[] input; - } - return TRUE; - - case IDCANCEL: - EndDialog(hwnd, 0); - return TRUE; - } - break; - } - - case WM_CLOSE: - DestroyWindow(hwnd); - return TRUE; - - case WM_DESTROY: - delete data; - data = 0; - SetWindowLongPtr(hwnd, GWLP_USERDATA, 0); - } - return FALSE; -} - -bool AskPassword(MCONTACT hContact) -{ - DBVARIANT dbv; - db_get(hContact, MODULENAME, "password", &dbv); - if (dbv.type != DBVT_BLOB) { - db_free(&dbv); - return true; - } - db_free(&dbv); - - if (DialogBoxParam(g_plugin.getInst(), MAKEINTRESOURCE(IDD_PASSWORD), 0, PasswordDlgProc, (LPARAM)hContact)) - return true; - return false; -} - - -INT_PTR CALLBACK ChangePasswordDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) -{ - MCONTACT hContact = (MCONTACT)GetWindowLongPtr(hwnd, GWLP_USERDATA); - switch (msg) { - case WM_INITDIALOG: - { - hContact = (MCONTACT)lParam; - SetWindowLongPtr(hwnd, GWLP_USERDATA, (LONG_PTR)hContact); - - // RECT rc, rcMe; - // SystemParametersInfo(SPI_GETWORKAREA, 0, &rc, 0); - // GetWindowRect(hwnd, &rcMe); - // SetWindowPos(hwnd, hwnd, - // rc.left+((rc.right-rc.left) - (rcMe.right-rcMe.left))/2, - // rc.top+((rc.bottom-rc.top) - (rcMe.bottom-rcMe.top))/2, - // 0, 0, SWP_NOSIZE|SWP_NOZORDER); - - SetFocus(GetDlgItem(hwnd, IDC_PASSWORD)); - return TRUE; - } - - case WM_COMMAND: - { - switch (LOWORD(wParam)) { - case IDOK: - { - int length = GetWindowTextLengthA(GetDlgItem(hwnd, IDC_PASSWORD)); - char *input = new char[length + 1]; - GetWindowTextA(GetDlgItem(hwnd, IDC_PASSWORD), input, length + 1); - - length = GetWindowTextLengthA(GetDlgItem(hwnd, IDC_PASSWORD2)); - char *input2 = new char[length + 1]; - GetWindowTextA(GetDlgItem(hwnd, IDC_PASSWORD2), input2, length + 1); - - length = GetWindowTextLengthA(GetDlgItem(hwnd, IDC_PASSWORD3)); - char *input3 = new char[length + 1]; - GetWindowTextA(GetDlgItem(hwnd, IDC_PASSWORD3), input3, length + 1); - - if (lstrcmpA(input2, input3) || !CheckPassword(hContact, input)) { - MessageBeep(MB_ICONHAND); - SetWindowTextA(GetDlgItem(hwnd, IDC_PASSWORD), ""); - SetWindowTextA(GetDlgItem(hwnd, IDC_PASSWORD2), ""); - SetWindowTextA(GetDlgItem(hwnd, IDC_PASSWORD3), ""); - } - else { - SetPassword(hContact, input2); - EndDialog(hwnd, 0); - } - - delete[] input; - delete[] input2; - delete[] input3; - } - return TRUE; - - case IDCANCEL: - EndDialog(hwnd, 0); - return TRUE; - } - break; - } - - case WM_CLOSE: - EndDialog(hwnd, 0); - DestroyWindow(hwnd); - return TRUE; - - case WM_DESTROY: - SetWindowLongPtr(hwnd, GWLP_USERDATA, 0); - } - return FALSE; -} - -void ChangePassword(HWND hwnd, MCONTACT hContact) -{ - DialogBoxParam(g_plugin.getInst(), MAKEINTRESOURCE(IDD_CHANGEPASSWORD), hwnd, ChangePasswordDlgProc, (LPARAM)hContact); -} diff --git a/plugins/NewStory/src/password.h b/plugins/NewStory/src/password.h deleted file mode 100644 index 60dfc1b3df..0000000000 --- a/plugins/NewStory/src/password.h +++ /dev/null @@ -1,8 +0,0 @@ -#ifndef __password_h__ -#define __password_h__ - -bool CheckPassword(MCONTACT hContact, char *password); -bool AskPassword(MCONTACT hContact); -void ChangePassword(HWND hwnd, MCONTACT hContact); - -#endif // __password_h__
\ No newline at end of file diff --git a/plugins/NewStory/src/resource.h b/plugins/NewStory/src/resource.h index 630c8784a8..331efb3126 100644 --- a/plugins/NewStory/src/resource.h +++ b/plugins/NewStory/src/resource.h @@ -8,13 +8,10 @@ #define IDD_MESSAGE 112 //!!! #define IDR_POPUPS 113 #define IDR_ACCEL 114 //!!! -#define IDD_PASSWORD 116 #define IDD_CALENDARTOOL 118 -#define IDD_CHANGEPASSWORD 119 #define IDD_OPT_TEMPLATES 121 #define IDD_FILTERMODE 123 //!!! #define IDD_OPT_GENERAL 124 -#define IDD_OPT_PASSWORDS 126 #define ICO_NEWSTORY 127 #define ICO_USERINFO 128 #define ICO_USERMENU 129 @@ -33,14 +30,11 @@ #define ICO_UNKNOWN 142 #define ICO_FINDPREV 143 #define ICO_FINDNEXT 144 -#define ICO_NOPASSWORD 145 -#define ICO_PASSWORD 146 #define ICO_CALENDAR 147 #define ICO_TPLGROUP 148 #define ICO_RESET 149 #define ICO_PREVIEW 150 #define ICO_VARHELP 151 -#define ICO_SAVEPASS 152 #define IDC_GPREVIEW 1000 #define IDC_LIST 1000 #define IDC_ITEMS2 1000 @@ -61,7 +55,6 @@ #define IDC_LOGOPTIONS 1018 #define IDC_FINDPREV 1019 #define IDC_SEARCHICON 1020 -#define IDC_SECURITY 1021 #define IDC_MSGICON 1022 //!!! #define IDC_DATEPOPUP 1022 #define IDC_ICO_MESSAGES_IN 1023 @@ -69,13 +62,9 @@ #define IDC_ICO_FILES_IN 1025 #define IDC_ICO_FILES_OUT 1026 #define IDC_ICO_TOTAL_IN 1027 -#define IDC_PASSWORD 1028 #define IDC_PREVIEW 1028 -#define IDC_CHANGEPASS2 1028 //!!! #define IDC_ICO_TOTAL_OUT 1028 -#define IDC_PASSWORD2 1029 #define IDC_ICO_URLS_IN 1029 -#define IDC_PASSWORD3 1030 #define IDC_ICO_URLS_OUT 1030 #define IDC_TAB 1032 #define IDC_TIMETREE 1035 @@ -87,7 +76,6 @@ #define IDC_TEMPLATES 1057 #define IDC_VARHELP 1058 #define IDC_CHK_IN 1059 //!!! -#define IDC_SAVEPASSWORD 1059 #define IDC_DISCARD 1060 #define IDC_CHK_FILE 1060 //!!! #define IDC_CHK_URL 1061 //!!! @@ -100,10 +88,6 @@ #define IDC_CHK_OUT 1067 //!!! #define IDC_CHK_MESSAGES 1068 //!!! #define IDC_EDITTEMPLATE 1069 -#define IDC_CHANGEPASS3 1071 //!!! -#define IDC_ICO_NOPASSWORD 1072 -#define IDC_ICO_PASSWORD 1073 -#define IDC_CHANGEPASS 1074 //!!! #define IDC_ICO_MESSAGES 1078 #define IDC_ICO_FILES 1079 #define IDC_ICO_URLS 1080 @@ -148,7 +132,6 @@ #define ID_FILTER_SHOWINCOMINGEVENTSONLY 40037 //!!! #define ID_FILTER_SHOWOUTGOINGEVENTSONLY 40038 //!!! #define ID_FILTER_USECUSTOMFILTER 40039 //!!! -#define ID_LOGOPTIONS_PASSWORDS 40040 // Next default values for new objects // diff --git a/plugins/NewStory/src/stdafx.h b/plugins/NewStory/src/stdafx.h index d58baf48d0..dc097c40e1 100644 --- a/plugins/NewStory/src/stdafx.h +++ b/plugins/NewStory/src/stdafx.h @@ -66,10 +66,8 @@ Boston, MA 02111-1307, USA. #define MODULETITLE "NewStory" #include "utils.h" -#include "opt_passwords.h" #include "options.h" #include "fonts.h" -#include "password.h" #include "calendartool.h" #include "history.h" #include "history_array.h" diff --git a/plugins/NewStory/src/templates.cpp b/plugins/NewStory/src/templates.cpp index 76d2b9ea27..facf75277a 100644 --- a/plugins/NewStory/src/templates.cpp +++ b/plugins/NewStory/src/templates.cpp @@ -24,9 +24,6 @@ TemplateInfo templates[TPL_COUNT] = { "tpl/interface/title", _T("Interface"), ICO_NEWSTORY, _T("Window Title"), _T("%N's Newstory [%c messages total]"), 0, 0, { vfGlobal, vfContact, 0, 0, 0 } }, - { "tpl/interface/passwordq", _T("Interface"), ICO_NOPASSWORD, _T("Password Query"), - _T("Ooops, %N's history seems to be password protected, so type your password here:"), 0, 0, - { vfGlobal, vfContact, 0, 0, 0 } }, { "tpl/msglog/msg", _T("Message Log"), ICO_SENDMSG, _T("Messages"), _T("%I%i[b]%N, %t:[/b]\x0d\x0a%M"), 0, 0, diff --git a/plugins/NewStory/src/templates.h b/plugins/NewStory/src/templates.h index afa00189df..d7eef9f4a0 100644 --- a/plugins/NewStory/src/templates.h +++ b/plugins/NewStory/src/templates.h @@ -38,7 +38,6 @@ struct TemplateInfo enum { TPL_TITLE, - TPL_PASSWORDQUERY, TPL_MESSAGE, TPL_FILE, |