summaryrefslogtreecommitdiff
path: root/protocols/Steam/src/steam_account.cpp
diff options
context:
space:
mode:
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);
+ }
}
}
}