summaryrefslogtreecommitdiff
path: root/plugins/NewStory/src
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/NewStory/src')
-rw-r--r--plugins/NewStory/src/history.cpp25
-rw-r--r--plugins/NewStory/src/main.cpp5
-rw-r--r--plugins/NewStory/src/opt_passwords.cpp150
-rw-r--r--plugins/NewStory/src/opt_passwords.h6
-rw-r--r--plugins/NewStory/src/options.cpp4
-rw-r--r--plugins/NewStory/src/password.cpp215
-rw-r--r--plugins/NewStory/src/password.h8
-rw-r--r--plugins/NewStory/src/resource.h17
-rw-r--r--plugins/NewStory/src/stdafx.h2
-rw-r--r--plugins/NewStory/src/templates.cpp3
-rw-r--r--plugins/NewStory/src/templates.h1
11 files changed, 5 insertions, 431 deletions
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,