summaryrefslogtreecommitdiff
path: root/protocols/MRA/Mra_svcs.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2012-09-16 16:18:46 +0000
committerGeorge Hazan <george.hazan@gmail.com>2012-09-16 16:18:46 +0000
commit7eb813e28f5b94886487cfd6e3c916eeb96c8dee (patch)
tree78ac2b8f99608779ebe274a19f95e2e91f553d12 /protocols/MRA/Mra_svcs.cpp
parent39c4a49dbfa7fd2e7bce9b7c56c91dceae726542 (diff)
- fix for double auth req
- packet logging added git-svn-id: http://svn.miranda-ng.org/main/trunk@1581 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/MRA/Mra_svcs.cpp')
-rw-r--r--protocols/MRA/Mra_svcs.cpp18
1 files changed, 17 insertions, 1 deletions
diff --git a/protocols/MRA/Mra_svcs.cpp b/protocols/MRA/Mra_svcs.cpp
index 2c10934b7e..426343ebbd 100644
--- a/protocols/MRA/Mra_svcs.cpp
+++ b/protocols/MRA/Mra_svcs.cpp
@@ -357,7 +357,23 @@ INT_PTR CMraProto::MraRequestAuthorization(WPARAM wParam, LPARAM lParam)
if (mraGetStaticStringW(NULL, "AuthMessage", wszAuthMessage, SIZEOF(wszAuthMessage), NULL) == FALSE)
lstrcpynW(wszAuthMessage, TranslateW(MRA_DEFAULT_AUTH_MESSAGE), SIZEOF(wszAuthMessage));
- return AuthRequest((HANDLE)wParam, wszAuthMessage);
+ CHAR szEMail[MAX_EMAIL_LEN];
+ size_t dwEMailSize, dwMessageSize;
+
+ dwMessageSize = lstrlen(wszAuthMessage);
+ if (dwMessageSize) {
+ HANDLE hContact = (HANDLE)wParam;
+ if ( mraGetStaticStringA(hContact, "e-mail", szEMail, SIZEOF(szEMail), &dwEMailSize)) {
+ BOOL bSlowSend = mraGetByte(NULL, "SlowSend", MRA_DEFAULT_SLOW_SEND);
+ int iRet = MraMessageW(bSlowSend, hContact, ACKTYPE_AUTHREQ, MESSAGE_FLAG_AUTHORIZE, szEMail, dwEMailSize, wszAuthMessage, dwMessageSize, NULL, 0);
+ if (bSlowSend == FALSE)
+ ProtoBroadcastAckAsynchEx(hContact, ACKTYPE_AUTHREQ, ACKRESULT_SUCCESS, (HANDLE)iRet, (LPARAM)NULL, 0);
+
+ return 0;
+ }
+ }
+
+ return 1;
}
return 0;
}