summaryrefslogtreecommitdiff
path: root/protocols
diff options
context:
space:
mode:
authorRobert Pösel <robyer@seznam.cz>2015-05-19 18:51:11 +0000
committerRobert Pösel <robyer@seznam.cz>2015-05-19 18:51:11 +0000
commit867fce85e3d993662eb07af5376e178e4c0a2e45 (patch)
treea3d7aa3c64fc7adedee7af5278bc52d57894b83c /protocols
parentd04e6d87584b145046a62c660fac99bfd1acc947 (diff)
Steam: Fix MirVer when user is connected from different clients
git-svn-id: http://svn.miranda-ng.org/main/trunk@13698 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols')
-rw-r--r--protocols/Steam/src/steam_contacts.cpp33
1 files changed, 14 insertions, 19 deletions
diff --git a/protocols/Steam/src/steam_contacts.cpp b/protocols/Steam/src/steam_contacts.cpp
index 13bfcba0a4..8f8455b710 100644
--- a/protocols/Steam/src/steam_contacts.cpp
+++ b/protocols/Steam/src/steam_contacts.cpp
@@ -183,34 +183,29 @@ void CSteamProto::UpdateContact(MCONTACT hContact, JSONNODE *data)
// client
node = json_get(data, "personastateflags");
int stateflags = node ? json_as_int(node) : -1;
- switch (stateflags)
- {
- case 0:
- {
- // nothing special, either standard client or in different status (only online, I want to play, I want to trade statuses support this flags)
- WORD status = getWord(hContact, "Status", ID_STATUS_OFFLINE);
- if (status == ID_STATUS_ONLINE || status == ID_STATUS_OUTTOLUNCH || status == ID_STATUS_FREECHAT)
- setTString(hContact, "MirVer", _T("Steam"));
- }
- break;
- case 256:
+
+ if (stateflags == 0) {
+ // nothing special, either standard client or in different status (only online, I want to play, I want to trade statuses support this flags)
+ WORD status = getWord(hContact, "Status", ID_STATUS_OFFLINE);
+ if (status == ID_STATUS_ONLINE || status == ID_STATUS_OUTTOLUNCH || status == ID_STATUS_FREECHAT)
+ setTString(hContact, "MirVer", _T("Steam"));
+ } else if (stateflags & 2) {
+ // game
+ setTString(hContact, "MirVer", _T("Steam (in game)"));
+ } else if (stateflags & 256) {
// on website
setTString(hContact, "MirVer", _T("Steam (website)"));
- break;
- case 512:
+ } else if (stateflags & 512) {
// on mobile
setTString(hContact, "MirVer", _T("Steam (mobile)"));
- break;
- case 1024:
+ } else if (stateflags & 1024) {
// big picture mode
setTString(hContact, "MirVer", _T("Steam (Big Picture)"));
- break;
- default:
+ } else {
// none/unknown (e.g. when contact is offline)
delSetting(hContact, "MirVer");
- break;
}
-
+
// playing game
node = json_get(data, "gameid");
DWORD gameId = node ? atol(_T2A(ptrT(json_as_string(node)))) : 0;