diff options
author | aunsane <aunsane@gmail.com> | 2018-01-17 23:11:36 +0300 |
---|---|---|
committer | aunsane <aunsane@gmail.com> | 2018-01-17 23:11:36 +0300 |
commit | fc14cd04c3894702603bb4db7e56258608c5c8d7 (patch) | |
tree | 43b5315d3f20090cf4ebb4e5828a573bb6ec6ff7 /protocols/Steam/src/steam_history.cpp | |
parent | bf928bd6cfa3df39b4cfda0ff5a5825105cf4a56 (diff) |
Steam: fixed #1106
Diffstat (limited to 'protocols/Steam/src/steam_history.cpp')
-rw-r--r-- | protocols/Steam/src/steam_history.cpp | 22 |
1 files changed, 7 insertions, 15 deletions
diff --git a/protocols/Steam/src/steam_history.cpp b/protocols/Steam/src/steam_history.cpp index a7f0d22e61..d78da4b4bd 100644 --- a/protocols/Steam/src/steam_history.cpp +++ b/protocols/Steam/src/steam_history.cpp @@ -44,13 +44,16 @@ void CSteamProto::OnGotHistoryMessages(const JSONNode &root, void *arg) { ptrA cSteamId((char*)arg); + MCONTACT hContact = GetContact(cSteamId); + if (!hContact) + return; + if (root.isnull()) return; JSONNode response = root["response"]; JSONNode messages = response["messages"].as_array(); - for (size_t i = messages.size(); i > 0; i--) - { + for (size_t i = messages.size(); i > 0; i--) { JSONNode message = messages[i - 1]; long long accountId = _wtoi64(message["accountid"].as_mstring()); @@ -68,20 +71,9 @@ void CSteamProto::OnGotHistoryMessages(const JSONNode &root, void *arg) recv.timestamp = timestamp; recv.szMessage = (char*)text.c_str(); - MCONTACT hContact = GetContact(cSteamId); - if (!hContact) - return; - if (IsMe(steamId)) - { - // Received message - ProtoChainRecvMsg(hContact, &recv); - } - else - { - // Sent message recv.flags = PREF_SENT; - Proto_RecvMessage(hContact, &recv); - } + + Proto_RecvMessage(hContact, &recv); } } |