diff options
author | George Hazan <ghazan@miranda.im> | 2017-12-29 17:27:00 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2017-12-29 17:27:08 +0300 |
commit | f16cf071e51f4768f20692c99414cb39521fa413 (patch) | |
tree | 7dd3cc512fe65fdd546f7753937261c518e5008c /protocols/Steam/src/steam_polling.cpp | |
parent | 939048b7ebce6a70c8e243fec36983de7d931e8b (diff) |
PROTO_INTERFACE::setAllContactStatuses - common code moved to the core
Diffstat (limited to 'protocols/Steam/src/steam_polling.cpp')
-rw-r--r-- | protocols/Steam/src/steam_polling.cpp | 44 |
1 files changed, 19 insertions, 25 deletions
diff --git a/protocols/Steam/src/steam_polling.cpp b/protocols/Steam/src/steam_polling.cpp index 78ffd06c8b..2397b7531c 100644 --- a/protocols/Steam/src/steam_polling.cpp +++ b/protocols/Steam/src/steam_polling.cpp @@ -11,8 +11,7 @@ void CSteamProto::ParsePollData(const JSONNode &data) time_t timestamp = _wtol(item["utc_timestamp"].as_mstring()); MCONTACT hContact = NULL; - if (!IsMe(steamId.c_str()) && - !(hContact = FindContact(steamId.c_str()))) + if (!IsMe(steamId.c_str()) && !(hContact = FindContact(steamId.c_str()))) // probably this is info about random player playing on same server, so we ignore it continue; @@ -79,35 +78,30 @@ void CSteamProto::ParsePollData(const JSONNode &data) switch (state) { case 0: - {// removed - MCONTACT hContact = FindContact(steamId.c_str()); - if (hContact) - ContactIsRemoved(hContact); - } + hContact = FindContact(steamId.c_str()); + if (hContact) + ContactIsRemoved(hContact); break; case 1: - {// ignored - MCONTACT hContact = FindContact(steamId.c_str()); - if (hContact) - ContactIsIgnored(hContact); - } + hContact = FindContact(steamId.c_str()); + if (hContact) + ContactIsIgnored(hContact); break; case 2: - {// auth request - MCONTACT hContact = FindContact(steamId.c_str()); - if (hContact) - ContactIsAskingAuth(hContact); - else - { - // load info about this user from server - ptrA token(getStringA("TokenSecret")); - - PushRequest( - new GetUserSummariesRequest(token, steamId.c_str()), - &CSteamProto::OnAuthRequested); - } + // auth request + hContact = FindContact(steamId.c_str()); + if (hContact) + ContactIsAskingAuth(hContact); + else + { + // load info about this user from server + ptrA token(getStringA("TokenSecret")); + + PushRequest( + new GetUserSummariesRequest(token, steamId.c_str()), + &CSteamProto::OnAuthRequested); } break; |