summaryrefslogtreecommitdiff
path: root/plugins/DbEditorPP
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2013-11-19 18:01:14 +0000
committerGeorge Hazan <george.hazan@gmail.com>2013-11-19 18:01:14 +0000
commitd6e05cc3bca53565d9ca65377ab8b0b6190774b3 (patch)
tree76040facd4d0b82162069a19cae8f7f024bf1f65 /plugins/DbEditorPP
parent2ef414538760079fa2955fca1a2c03d610459fa8 (diff)
preparing to the transparent cyphering: end of MS_DB_CRYPT_ENCODESTRING/MS_DB_CRYPT_DECODESTRING
git-svn-id: http://svn.miranda-ng.org/main/trunk@6938 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/DbEditorPP')
-rw-r--r--plugins/DbEditorPP/src/settinglist.cpp32
1 files changed, 8 insertions, 24 deletions
diff --git a/plugins/DbEditorPP/src/settinglist.cpp b/plugins/DbEditorPP/src/settinglist.cpp
index 1d87461333..db3f939418 100644
--- a/plugins/DbEditorPP/src/settinglist.cpp
+++ b/plugins/DbEditorPP/src/settinglist.cpp
@@ -1076,12 +1076,8 @@ void SettingsListRightClick(HWND hwnd, WPARAM wParam,LPARAM lParam) // hwnd here
///////////////////////// convert to submenu
case MENU_VIEWDECRYPT:
if (!db_get(hContact,module,setting,&dbv) && dbv.type == DBVT_ASCIIZ) {
- if (lstrcmpA(setting, "LoginPassword")) {
- char *text = mir_strdup(dbv.pszVal);
- CallService(MS_DB_CRYPT_DECODESTRING, (WPARAM)lstrlenA(dbv.pszVal)+1, (LPARAM)text);
- msg(text, Translate("Decoded string.."));
- mir_free(text);
- }
+ if (lstrcmpA(setting, "LoginPassword"))
+ msg(dbv.pszVal, Translate("Decoded string.."));
else {
char *str = mir_strdup(dbv.pszVal);
char *str1 = str;
@@ -1100,32 +1096,20 @@ void SettingsListRightClick(HWND hwnd, WPARAM wParam,LPARAM lParam) // hwnd here
break;
case MENU_VIEWENCRYPT:
- if (!db_get(hContact,module,setting,&dbv) && dbv.type == DBVT_ASCIIZ) {
- char *text = mir_tstrdup(dbv.pszVal);
- CallService(MS_DB_CRYPT_ENCODESTRING, (WPARAM)strlen(dbv.pszVal)+1, (LPARAM)text);
- msg(text, Translate("Encoded string.."));
- mir_free(text);
- }
+ if (!db_get(hContact,module,setting,&dbv) && dbv.type == DBVT_ASCIIZ)
+ msg(dbv.pszVal, Translate("Encoded string.."));
db_free(&dbv);
break;
case MENU_DECRYPT:
- if (!db_get(hContact,module,setting,&dbv) && dbv.type == DBVT_ASCIIZ) {
- char *text = mir_tstrdup(dbv.pszVal);
- CallService(MS_DB_CRYPT_DECODESTRING, (WPARAM)strlen(dbv.pszVal)+1, (LPARAM)text);
- db_set_s(hContact,module,setting,text);
- mir_free(text);
- }
+ if (!db_get_s(hContact,module,setting,&dbv))
+ db_set_s(hContact,module,setting,dbv.pszVal);
db_free(&dbv);
break;
case MENU_ENCRYPT:
- if (!db_get(hContact,module,setting,&dbv) && dbv.type == DBVT_ASCIIZ) {
- char *text = mir_tstrdup(dbv.pszVal);
- CallService(MS_DB_CRYPT_ENCODESTRING, (WPARAM)strlen(dbv.pszVal)+1, (LPARAM)text);
- db_set_s(hContact,module,setting,text);
- mir_free(text);
- }
+ if (!db_get_s(hContact,module,setting,&dbv))
+ db_set_s(hContact,module,setting,dbv.pszVal);
db_free(&dbv);
break;