diff options
author | Alexander Lantsev <aunsane@gmail.com> | 2014-06-21 17:25:31 +0000 |
---|---|---|
committer | Alexander Lantsev <aunsane@gmail.com> | 2014-06-21 17:25:31 +0000 |
commit | 13ec12177636fb42c9692664d0f48bd3be2a7fc0 (patch) | |
tree | 48a33ed40ec1e4dc9c5a8b4aa192ed1ec853c2f1 /protocols/Steam/src/steam_contacts.cpp | |
parent | ee8b6d3e7acadbd3bd87a1c3cfb06e7b7af88c64 (diff) |
Steam: added block command to contact menu
git-svn-id: http://svn.miranda-ng.org/main/trunk@9545 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/Steam/src/steam_contacts.cpp')
-rw-r--r-- | protocols/Steam/src/steam_contacts.cpp | 25 |
1 files changed, 19 insertions, 6 deletions
diff --git a/protocols/Steam/src/steam_contacts.cpp b/protocols/Steam/src/steam_contacts.cpp index 9713f3d1cf..29a4366523 100644 --- a/protocols/Steam/src/steam_contacts.cpp +++ b/protocols/Steam/src/steam_contacts.cpp @@ -202,9 +202,16 @@ void CSteamProto::OnGotFriendList(const NETLIBHTTPREQUEST *response, void *arg) node = json_get(child, "steamid");
ptrA steamId(mir_u2a(json_as_string(node)));
+ MCONTACT hContact = FindContact(steamId);
+ if (!hContact)
+ {
+ hContact = AddContact(steamId);
+ steamIds.append(steamId).append(",");
+ }
+
node = json_get(child, "relationship");
ptrA relationship(mir_u2a(json_as_string(node)));
- if (!lstrcmpiA(relationship, "friend"))
+ /*if (!lstrcmpiA(relationship, "friend"))
{
if (!FindContact(steamId))
{
@@ -212,16 +219,14 @@ void CSteamProto::OnGotFriendList(const NETLIBHTTPREQUEST *response, void *arg) steamIds.append(steamId).append(",");
}
}
- else if (!lstrcmpiA(relationship, "ignoredfriend"))
+ else */if (!lstrcmpiA(relationship, "ignoredfriend"))
{
// todo
+ setByte(hContact, "Block", 1);
}
else if (!lstrcmpiA(relationship, "requestrecipient"))
{
- MCONTACT hContact = FindContact(steamId);
- if (!hContact)
- hContact = AddContact(steamId, true);
-
+ // todo
//RaiseAuthRequestThread((void*)hContact);
}
else continue;
@@ -312,6 +317,14 @@ void CSteamProto::OnFriendAdded(const NETLIBHTTPREQUEST *response, void *arg) ProtoBroadcastAck(param->hContact, ACKTYPE_AUTHREQ, ACKRESULT_SUCCESS, param->hAuth, 0);
}
+void CSteamProto::OnFriendBlocked(const NETLIBHTTPREQUEST *response, void *arg)
+{
+ if (response == NULL || response->resultCode != HTTP_STATUS_OK || lstrcmpiA(response->pData, "true"))
+ {
+ debugLogA("CSteamProto::OnFriendIgnored: failed to ignore friend %s", ptrA((char*)arg));
+ }
+}
+
void CSteamProto::OnFriendRemoved(const NETLIBHTTPREQUEST *response, void *arg)
{
if (response == NULL || response->resultCode != HTTP_STATUS_OK || lstrcmpiA(response->pData, "true"))
|