diff options
author | George Hazan <ghazan@miranda.im> | 2017-12-27 21:27:25 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2017-12-27 21:27:31 +0300 |
commit | f0a0ba421fb8792869aaec1fd9e57024a0fc83cc (patch) | |
tree | 0ffe278d8e10bfca44211bf623d90a615a948b5e /src/mir_app | |
parent | 75336b45dccae06adb23a9619b4f44bee5a8bad7 (diff) |
fixes #1081 (broken auth request sending)
Diffstat (limited to 'src/mir_app')
-rw-r--r-- | src/mir_app/src/addcontact.cpp | 6 | ||||
-rw-r--r-- | src/mir_app/src/auth.cpp | 17 |
2 files changed, 11 insertions, 12 deletions
diff --git a/src/mir_app/src/addcontact.cpp b/src/mir_app/src/addcontact.cpp index 31591414b9..8c44e895e1 100644 --- a/src/mir_app/src/addcontact.cpp +++ b/src/mir_app/src/addcontact.cpp @@ -43,10 +43,10 @@ class CAddContactDlg : public CDlgBase CCtrlCombo m_group;
protected:
- MEVENT m_hDbEvent;
- MCONTACT m_hContact;
+ MEVENT m_hDbEvent = 0;
+ MCONTACT m_hContact = 0;
const char *m_szProto;
- PROTOSEARCHRESULT *m_psr;
+ PROTOSEARCHRESULT *m_psr = nullptr;
CMStringW m_szName;
public:
diff --git a/src/mir_app/src/auth.cpp b/src/mir_app/src/auth.cpp index bb55fc3a5e..375c37967d 100644 --- a/src/mir_app/src/auth.cpp +++ b/src/mir_app/src/auth.cpp @@ -31,6 +31,7 @@ class CAuthReqDlg : public CDlgBase { MEVENT m_hDbEvent; MCONTACT m_hContact; + const char *m_szProto; CCtrlCheck chkAdd; CCtrlButton btnDetails, btnLater, btnOk, btnCancel; @@ -64,7 +65,10 @@ public: DBEVENTINFO dbei = {}; dbei.cbBlob = iBlobSize; dbei.pBlob = (PBYTE)alloca(dbei.cbBlob); - db_event_get(m_hDbEvent, &dbei); + if (db_event_get(m_hDbEvent, &dbei)) + return; + + m_szProto = dbei.szModule; DWORD uin = *(PDWORD)dbei.pBlob; m_hContact = DbGetAuthEventContact(&dbei); @@ -139,9 +143,7 @@ public: void onClick_OK(CCtrlButton*) { - DBEVENTINFO dbei = {}; - db_event_get(m_hDbEvent, &dbei); - CallProtoService(dbei.szModule, PS_AUTHALLOW, m_hDbEvent, 0); + CallProtoService(m_szProto, PS_AUTHALLOW, m_hDbEvent, 0); if (chkAdd.GetState()) Contact_AddByEvent(m_hDbEvent, m_hwnd); @@ -149,15 +151,12 @@ public: void onClick_Cancel(CCtrlButton*) { - DBEVENTINFO dbei = {}; - db_event_get(m_hDbEvent, &dbei); - if (IsWindowEnabled(GetDlgItem(m_hwnd, IDC_DENYREASON))) { wchar_t tszReason[256]; GetDlgItemText(m_hwnd, IDC_DENYREASON, tszReason, _countof(tszReason)); - CallProtoService(dbei.szModule, PS_AUTHDENY, m_hDbEvent, (LPARAM)tszReason); + CallProtoService(m_szProto, PS_AUTHDENY, m_hDbEvent, (LPARAM)tszReason); } - else CallProtoService(dbei.szModule, PS_AUTHDENY, m_hDbEvent, 0); + else CallProtoService(m_szProto, PS_AUTHDENY, m_hDbEvent, 0); } void onClick_Later(CCtrlButton*) |