summaryrefslogtreecommitdiff
path: root/protocols/Steam/src/steam_account.cpp
diff options
context:
space:
mode:
authorAlexander Lantsev <aunsane@gmail.com>2014-04-09 17:48:27 +0000
committerAlexander Lantsev <aunsane@gmail.com>2014-04-09 17:48:27 +0000
commitb80be7b3bbfae105935f49c34e9e64f1760ad08e (patch)
treeab36197cad44be4c7c2bc05b8da60e95becb5279 /protocols/Steam/src/steam_account.cpp
parent2068cf47f49397ba35a5501c7949a1c3ce6342ff (diff)
Steam: fixed contacts loading
git-svn-id: http://svn.miranda-ng.org/main/trunk@8903 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/Steam/src/steam_account.cpp')
-rw-r--r--protocols/Steam/src/steam_account.cpp30
1 files changed, 23 insertions, 7 deletions
diff --git a/protocols/Steam/src/steam_account.cpp b/protocols/Steam/src/steam_account.cpp
index 812b9a75b5..523c5f09f2 100644
--- a/protocols/Steam/src/steam_account.cpp
+++ b/protocols/Steam/src/steam_account.cpp
@@ -171,15 +171,31 @@ void CSteamProto::LogInThread(void* param)
if (friendList.IsSuccess())
{
- for (int i = 0; i < friendList.GetCount(); i++)
+ CMStringA newContacts;
+ for (int i = 0; i < friendList.GetItemCount(); i++)
{
- if (!FindContact(friendList[i]))
+ const char * steamId = friendList.GetAt(i);
+ if (!FindContact(steamId))
{
- // todo
- /*SteamWebApi::FriendApi::Friend rFriend;
- SteamWebApi::FriendApi::LoadSummaries(m_hNetlibUser, token, friendList[i], &rFriend);
- if (!rFriend.IsSuccess()) continue;
- AddContact(rFriend);*/
+ if (newContacts.IsEmpty())
+ newContacts.Append(steamId);
+ else
+ newContacts.AppendFormat(",%s", steamId);
+ }
+ }
+
+ if (!newContacts.IsEmpty())
+ {
+ SteamWebApi::FriendApi::Summaries summaries;
+ SteamWebApi::FriendApi::LoadSummaries(m_hNetlibUser, token, newContacts, &summaries);
+
+ if (summaries.IsSuccess())
+ {
+ for (int i = 0; i < summaries.GetItemCount(); i++)
+ {
+ const SteamWebApi::FriendApi::Summary *summary = summaries.GetAt(i);
+ AddContact(summary);
+ }
}
}
}