diff options
| -rw-r--r-- | protocols/Steam/src/steam_contacts.cpp | 11 | ||||
| -rw-r--r-- | protocols/Steam/src/steam_proto.h | 1 | ||||
| -rw-r--r-- | protocols/Steam/src/steam_server.cpp | 9 |
3 files changed, 16 insertions, 5 deletions
diff --git a/protocols/Steam/src/steam_contacts.cpp b/protocols/Steam/src/steam_contacts.cpp index 9cbcd9883c..9fcf847d92 100644 --- a/protocols/Steam/src/steam_contacts.cpp +++ b/protocols/Steam/src/steam_contacts.cpp @@ -444,7 +444,8 @@ void CSteamProto::OnGotFriendList(const CMsgClientFriendsList &reply, const CMsg } // Comma-separated list of steam ids to update summaries - CMStringA steamIds = getMStringA(DBKEY_STEAM_ID); + std::vector<uint64_t> ids; + ids.push_back(GetId(DBKEY_STEAM_ID)); // Check and update contacts in database for (auto &hContact : AccContacts()) { @@ -465,7 +466,7 @@ void CSteamProto::OnGotFriendList(const CMsgClientFriendsList &reply, const CMsg // Do not update summary for non friends if (it->second == FriendRelationship::Friend) - steamIds.AppendFormat(",%lld", it->first); + ids.push_back(it->first); friendsMap.erase(it); } @@ -477,12 +478,12 @@ void CSteamProto::OnGotFriendList(const CMsgClientFriendsList &reply, const CMsg UpdateContactRelationship(hContact, it.second); if (it.second == FriendRelationship::Friend) - steamIds.AppendFormat(",%lld", it.first); + ids.push_back(it.first); } friendsMap.clear(); - if (!steamIds.IsEmpty()) - SendRequest(new GetUserSummariesRequest(m_szAccessToken, steamIds.c_str()), &CSteamProto::OnGotUserSummaries); + if (!ids.empty()) + SendUserInfoRequest(ids, true); // Load last conversations SendRequest(new GetConversationsRequest(m_szAccessToken), &CSteamProto::OnGotConversations); diff --git a/protocols/Steam/src/steam_proto.h b/protocols/Steam/src/steam_proto.h index 7c6b7373ea..6547185ed2 100644 --- a/protocols/Steam/src/steam_proto.h +++ b/protocols/Steam/src/steam_proto.h @@ -150,6 +150,7 @@ class CSteamProto : public PROTO<CSteamProto> void SendHeartBeat();
void SendLogout();
void SendPollRequest();
+ void SendUserInfoRequest(const std::vector<uint64_t> &ids, bool bRetrieveState);
// login
bool IsOnline();
diff --git a/protocols/Steam/src/steam_server.cpp b/protocols/Steam/src/steam_server.cpp index d34db74b87..d1045e6ca2 100644 --- a/protocols/Steam/src/steam_server.cpp +++ b/protocols/Steam/src/steam_server.cpp @@ -66,6 +66,15 @@ void CSteamProto::OnMessageSent(const CFriendMessagesSendMessageResponse &reply, ///////////////////////////////////////////////////////////////////////////////////////// +void CSteamProto::SendUserInfoRequest(const std::vector<uint64_t> &ids, bool bRetrieveState) +{ + CMsgClientRequestFriendData request; + request.persona_state_requested = bRetrieveState; request.has_persona_state_requested = true; + request.n_friends = ids.size(); + request.friends = (uint64_t*)&*ids.begin(); + WSSend(EMsg::ClientRequestFriendData, request); +} + void CSteamProto::SendHeartBeat() { CMsgClientHeartBeat packet; |
