diff options
author | George Hazan <george.hazan@gmail.com> | 2012-09-16 12:21:26 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2012-09-16 12:21:26 +0000 |
commit | 07516b83796a76bb342947add147abb4795960da (patch) | |
tree | e5fd60aba23ee2f82bc51060a76ee8640ab6996d /src/core/stdauth | |
parent | 7c5ba0561609916f1876d886b589e0bc59f6a413 (diff) |
fix for auth dialogs
git-svn-id: http://svn.miranda-ng.org/main/trunk@1578 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'src/core/stdauth')
-rw-r--r-- | src/core/stdauth/authdialogs.cpp | 24 |
1 files changed, 9 insertions, 15 deletions
diff --git a/src/core/stdauth/authdialogs.cpp b/src/core/stdauth/authdialogs.cpp index f9aaee1e28..f9abf9001e 100644 --- a/src/core/stdauth/authdialogs.cpp +++ b/src/core/stdauth/authdialogs.cpp @@ -45,8 +45,8 @@ INT_PTR CALLBACK DlgProcAdded(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPar CallService(MS_DB_EVENT_GET, (WPARAM)hDbEvent, (LPARAM)&dbei);
DWORD uin = *(PDWORD)dbei.pBlob;
- HANDLE hContact = *(HANDLE*)(dbei.pBlob + sizeof(DWORD));
- char* nick = (char *)(dbei.pBlob + sizeof(DWORD) + sizeof(HANDLE));
+ HANDLE hContact = DbGetAuthEventContact(&dbei);
+ char* nick = (char*)dbei.pBlob + sizeof(DWORD)*2;
char* first = nick + strlen(nick) + 1;
char* last = first + strlen(first) + 1;
char* email = last + strlen(last) + 1;
@@ -169,8 +169,8 @@ INT_PTR CALLBACK DlgProcAuthReq(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP CallService(MS_DB_EVENT_GET, (WPARAM)hDbEvent, (LPARAM)&dbei);
DWORD uin = *(PDWORD)dbei.pBlob;
- HANDLE hContact = *(HANDLE*)(dbei.pBlob + sizeof(DWORD));
- char *nick = (char *)(dbei.pBlob + sizeof(DWORD) + sizeof(HANDLE));
+ HANDLE hContact = DbGetAuthEventContact(&dbei);
+ char *nick = (char*)dbei.pBlob + sizeof(DWORD)*2;
char *first = nick + strlen(nick) + 1;
char *last = first + strlen(first) + 1;
char *email = last + strlen(last) + 1;
@@ -181,11 +181,11 @@ INT_PTR CALLBACK DlgProcAuthReq(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP PROTOACCOUNT* acc = ProtoGetAccount(dbei.szModule);
- TCHAR* lastT = dbei.flags & DBEF_UTF ? Utf8DecodeT(last) : mir_a2t(last);
- TCHAR* firstT = dbei.flags & DBEF_UTF ? Utf8DecodeT(first) : mir_a2t(first);
- TCHAR* nickT = dbei.flags & DBEF_UTF ? Utf8DecodeT(nick) : mir_a2t(nick);
- TCHAR* emailT = dbei.flags & DBEF_UTF ? Utf8DecodeT(email) : mir_a2t(email);
- TCHAR* reasonT = dbei.flags & DBEF_UTF ? Utf8DecodeT(reason) : mir_a2t(reason);
+ mir_ptr<TCHAR> lastT(dbei.flags & DBEF_UTF ? Utf8DecodeT(last) : mir_a2t(last));
+ mir_ptr<TCHAR> firstT(dbei.flags & DBEF_UTF ? Utf8DecodeT(first) : mir_a2t(first));
+ mir_ptr<TCHAR> nickT(dbei.flags & DBEF_UTF ? Utf8DecodeT(nick) : mir_a2t(nick));
+ mir_ptr<TCHAR> emailT(dbei.flags & DBEF_UTF ? Utf8DecodeT(email) : mir_a2t(email));
+ mir_ptr<TCHAR> reasonT(dbei.flags & DBEF_UTF ? Utf8DecodeT(reason) : mir_a2t(reason));
TCHAR name[128] = _T("");
int off = 0;
@@ -215,12 +215,6 @@ INT_PTR CALLBACK DlgProcAuthReq(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP SetDlgItemText(hwndDlg, IDC_HEADERBAR, hdr);
SetDlgItemText(hwndDlg, IDC_REASON, reasonT);
- mir_free(lastT);
- mir_free(firstT);
- mir_free(nickT);
- mir_free(emailT);
- mir_free(reasonT);
-
if (hContact == INVALID_HANDLE_VALUE || !DBGetContactSettingByte(hContact, "CList", "NotOnList", 0))
ShowWindow(GetDlgItem(hwndDlg, IDC_ADD), FALSE);
|