diff options
author | Alexander Lantsev <aunsane@gmail.com> | 2014-06-21 17:46:15 +0000 |
---|---|---|
committer | Alexander Lantsev <aunsane@gmail.com> | 2014-06-21 17:46:15 +0000 |
commit | 7941d6d1a2ba1fac7abf817149360d73ed79c799 (patch) | |
tree | d336c78e18e291ea4e5c755ddf9a5f65fa163a80 /protocols/Steam/src/steam_contacts.cpp | |
parent | 13ec12177636fb42c9692664d0f48bd3be2a7fc0 (diff) |
Steam: first approach to block list support
git-svn-id: http://svn.miranda-ng.org/main/trunk@9546 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/Steam/src/steam_contacts.cpp')
-rw-r--r-- | protocols/Steam/src/steam_contacts.cpp | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/protocols/Steam/src/steam_contacts.cpp b/protocols/Steam/src/steam_contacts.cpp index 29a4366523..0d8cfb5472 100644 --- a/protocols/Steam/src/steam_contacts.cpp +++ b/protocols/Steam/src/steam_contacts.cpp @@ -244,6 +244,47 @@ void CSteamProto::OnGotFriendList(const NETLIBHTTPREQUEST *response, void *arg) }
}
+void CSteamProto::OnGotBlockList(const NETLIBHTTPREQUEST *response, void *arg)
+{
+ JSONNODE *root = json_parse(response->pData), *node, *child;
+
+ if (root == NULL)
+ return;
+
+ //std::string steamIds;
+
+ node = json_get(root, "friends");
+ root = json_as_array(node);
+ if (root != NULL)
+ {
+ for (size_t i = 0; i < json_size(root); i++)
+ {
+ child = json_at(root, i);
+ if (child == NULL)
+ break;
+
+ 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, "ignoredfriend"))
+ {
+ // todo: open block list
+ }
+ else continue;
+ }
+ }
+}
+
void CSteamProto::OnGotUserSummaries(const NETLIBHTTPREQUEST *response, void *arg)
{
JSONNODE *root = json_parse(response->pData), *node, *item;
|