From fc14cd04c3894702603bb4db7e56258608c5c8d7 Mon Sep 17 00:00:00 2001 From: aunsane Date: Wed, 17 Jan 2018 23:11:36 +0300 Subject: Steam: fixed #1106 --- protocols/Steam/src/steam_history.cpp | 22 +++++++--------------- 1 file changed, 7 insertions(+), 15 deletions(-) (limited to 'protocols/Steam/src/steam_history.cpp') 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); } } -- cgit v1.2.3