diff options
Diffstat (limited to 'src')
-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);
|