summaryrefslogtreecommitdiff
path: root/protocols/Steam/src/steam_contacts.cpp
diff options
context:
space:
mode:
authorAlexander Lantsev <aunsane@gmail.com>2014-05-03 08:57:07 +0000
committerAlexander Lantsev <aunsane@gmail.com>2014-05-03 08:57:07 +0000
commit6b0e2e70e2cf701dfb3338379598efe2f168e859 (patch)
treef2de5b3fe9e13d5948ebeb86a18cd9327d729b1d /protocols/Steam/src/steam_contacts.cpp
parent70436074ae8f66a092d0212fb8b99b94d0fd03a6 (diff)
Steam: added "Request authorization" contact menu item
git-svn-id: http://svn.miranda-ng.org/main/trunk@9109 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/Steam/src/steam_contacts.cpp')
-rw-r--r--protocols/Steam/src/steam_contacts.cpp15
1 files changed, 13 insertions, 2 deletions
diff --git a/protocols/Steam/src/steam_contacts.cpp b/protocols/Steam/src/steam_contacts.cpp
index aaccb3bf75..75c85812ce 100644
--- a/protocols/Steam/src/steam_contacts.cpp
+++ b/protocols/Steam/src/steam_contacts.cpp
@@ -316,7 +316,9 @@ void CSteamProto::AuthDenyThread(void *arg)
void CSteamProto::AddContactThread(void *arg)
{
- MCONTACT hContact = (MCONTACT)arg;
+ SendAuthParam *param = (SendAuthParam*)arg;
+
+ MCONTACT hContact = param->hContact;
if (!hContact)
return;
@@ -331,7 +333,16 @@ void CSteamProto::AddContactThread(void *arg)
debugLogA("CSteamProto::AddContactThread: call SteamWebApi::FriendListApi::AddFriend");
SteamWebApi::FriendListApi::AddFriend(m_hNetlibUser, token, sessionId, steamId, who, &result);
- ProtoBroadcastAck(hContact, ACKTYPE_AUTHREQ, result.IsSuccess() ? ACKRESULT_SUCCESS : ACKRESULT_FAILED, (HANDLE)hContact, NULL);
+ if (result.IsSuccess())
+ {
+ delSetting(hContact, "Auth");
+ delSetting(hContact, "Grant");
+ db_unset(hContact, "CList", "NotOnList");
+ }
+
+ ProtoBroadcastAck(hContact, ACKTYPE_AUTHREQ, result.IsSuccess() ? ACKRESULT_SUCCESS : ACKRESULT_FAILED, param->hAuth, 0);
+
+ mir_free(param);
}
void CSteamProto::RemoveContactThread(void *arg)