diff options
author | Kirill Volinsky <mataes2007@gmail.com> | 2013-10-01 19:32:03 +0000 |
---|---|---|
committer | Kirill Volinsky <mataes2007@gmail.com> | 2013-10-01 19:32:03 +0000 |
commit | 756c6e169bb748536a8c2f92f4b281ac480f481b (patch) | |
tree | 096a76930de0987236784a667ef342ef03ea37e7 /protocols/WhatsApp/src/dialogs.cpp | |
parent | 14a74931f1745787956e6428dfd9ae45c9cebf4f (diff) |
added utility for accounts registration
git-svn-id: http://svn.miranda-ng.org/main/trunk@6292 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/WhatsApp/src/dialogs.cpp')
-rw-r--r-- | protocols/WhatsApp/src/dialogs.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
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<LPARAM>(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<LPARAM>(str));
+ db_set_s(0,proto->ModuleName(),WHATSAPP_KEY_PASS,str);
+
return TRUE;
}
break;
|