From 5f81d39808b16e87386e6cfa1777821aee727c5f Mon Sep 17 00:00:00 2001 From: George Hazan Date: Thu, 21 Jan 2021 13:44:14 +0300 Subject: Steam: misprint fix + minor code cleaning --- protocols/Steam/src/steam_messages.cpp | 9 +++------ protocols/Steam/src/steam_polling.cpp | 2 +- 2 files changed, 4 insertions(+), 7 deletions(-) (limited to 'protocols/Steam/src') diff --git a/protocols/Steam/src/steam_messages.cpp b/protocols/Steam/src/steam_messages.cpp index c4d9329761..deeb610a4b 100644 --- a/protocols/Steam/src/steam_messages.cpp +++ b/protocols/Steam/src/steam_messages.cpp @@ -35,12 +35,9 @@ void CSteamProto::OnMessageSent(const HttpResponse &response, void *arg) if (node) error = node.as_string(); - const JSONNode &time = root["utc_timestamp"]; - if (time) { - timestamp = atol(node.as_string().c_str()); - if (timestamp > getDword(param->hContact, DB_KEY_LASTMSGTS)) - setDword(param->hContact, DB_KEY_LASTMSGTS, timestamp); - } + timestamp = atol(root["utc_timestamp"].as_string().c_str()); + if (timestamp > getDword(param->hContact, DB_KEY_LASTMSGTS)) + setDword(param->hContact, DB_KEY_LASTMSGTS, timestamp); } if (mir_strcmpi(error.c_str(), "OK") != 0) { diff --git a/protocols/Steam/src/steam_polling.cpp b/protocols/Steam/src/steam_polling.cpp index e98341b1fd..4e921adf2c 100644 --- a/protocols/Steam/src/steam_polling.cpp +++ b/protocols/Steam/src/steam_polling.cpp @@ -63,7 +63,7 @@ void CSteamProto::ParsePollData(const JSONNode &data) continue; } - if (type == "saytext" || type =="emote") { + if (type == "saytext" || type == "emote") { json_string text = item["text"].as_string(); PROTORECVEVENT recv = { 0 }; -- cgit v1.2.3