summaryrefslogtreecommitdiff
path: root/protocols/WhatsApp/src/dialogs.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'protocols/WhatsApp/src/dialogs.cpp')
-rw-r--r--protocols/WhatsApp/src/dialogs.cpp14
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;