From 756c6e169bb748536a8c2f92f4b281ac480f481b Mon Sep 17 00:00:00 2001 From: Kirill Volinsky Date: Tue, 1 Oct 2013 19:32:03 +0000 Subject: added utility for accounts registration git-svn-id: http://svn.miranda-ng.org/main/trunk@6292 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/WhatsApp/src/dialogs.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'protocols/WhatsApp/src/dialogs.cpp') diff --git a/protocols/WhatsApp/src/dialogs.cpp b/protocols/WhatsApp/src/dialogs.cpp index ee658f8e77..9a2955b1d7 100644 --- a/protocols/WhatsApp/src/dialogs.cpp +++ b/protocols/WhatsApp/src/dialogs.cpp @@ -34,10 +34,19 @@ INT_PTR CALLBACK WhatsAppAccountProc(HWND hwnd, UINT message, WPARAM wparam, LPA db_free(&dbv); } + if ( !db_get_s(0,proto->ModuleName(),WHATSAPP_KEY_PASS,&dbv,DBVT_ASCIIZ)) + { + CallService(MS_DB_CRYPT_DECODESTRING,strlen(dbv.pszVal)+1, + reinterpret_cast(dbv.pszVal)); + SetDlgItemTextA(hwnd,IDC_PW,dbv.pszVal); + db_free(&dbv); + } + if (!proto->isOffline()) { SendMessage(GetDlgItem(hwnd,IDC_CC),EM_SETREADONLY,1,0); SendMessage(GetDlgItem(hwnd,IDC_LOGIN),EM_SETREADONLY,1,0); SendMessage(GetDlgItem(hwnd,IDC_NICK),EM_SETREADONLY,1,0); + SendMessage(GetDlgItem(hwnd,IDC_PW),EM_SETREADONLY,1,0); EnableWindow(GetDlgItem(hwnd, IDC_SSL), FALSE); } @@ -94,6 +103,7 @@ INT_PTR CALLBACK WhatsAppAccountProc(HWND hwnd, UINT message, WPARAM wparam, LPA case IDC_LOGIN: case IDC_NICK: case IDC_SSL: + case IDC_PW: SendMessage(GetParent(hwnd) ,PSM_CHANGED, 0, 0); } } @@ -116,6 +126,10 @@ INT_PTR CALLBACK WhatsAppAccountProc(HWND hwnd, UINT message, WPARAM wparam, LPA db_set_b(0, proto->ModuleName(), WHATSAPP_KEY_SSL, IsDlgButtonChecked(hwnd, IDC_SSL)); + GetDlgItemTextA(hwnd,IDC_PW,str,sizeof(str)); + CallService(MS_DB_CRYPT_ENCODESTRING,sizeof(str),reinterpret_cast(str)); + db_set_s(0,proto->ModuleName(),WHATSAPP_KEY_PASS,str); + return TRUE; } break; -- cgit v1.2.3