diff options
author | Robert Pösel <robyer@seznam.cz> | 2014-12-09 18:04:53 +0000 |
---|---|---|
committer | Robert Pösel <robyer@seznam.cz> | 2014-12-09 18:04:53 +0000 |
commit | 7a2293c2b3369309db885085863a50ec2b0d186a (patch) | |
tree | 16fabb87fb7b05e477f3a09fb4bfd092e88a29c4 /protocols/Steam | |
parent | 075b3c966ca40a1020614d5388f9efc02ee72e32 (diff) |
Steam: "Looking for trade/play" statuses write into StatusMsg
git-svn-id: http://svn.miranda-ng.org/main/trunk@11306 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/Steam')
-rw-r--r-- | protocols/Steam/src/steam_contacts.cpp | 46 |
1 files changed, 37 insertions, 9 deletions
diff --git a/protocols/Steam/src/steam_contacts.cpp b/protocols/Steam/src/steam_contacts.cpp index a950b8b436..96c92c285c 100644 --- a/protocols/Steam/src/steam_contacts.cpp +++ b/protocols/Steam/src/steam_contacts.cpp @@ -6,15 +6,44 @@ void CSteamProto::SetContactStatus(MCONTACT hContact, WORD status) if (oldStatus != status) { setWord(hContact, "Status", status); - - // If contact is offline, clear also xstatus - if (status == ID_STATUS_OFFLINE) + + // Special handling of some statuses + switch (status) { - delSetting(hContact, "XStatusId"); - delSetting(hContact, "XStatusName"); - delSetting(hContact, "XStatusMsg"); + case ID_STATUS_FREECHAT: + { + // Contact is looking to play, save it to as status message + if (hContact) + db_set_ts(hContact, "CList", "StatusMsg", TranslateT("Looking to play")); + } + break; + + case ID_STATUS_OUTTOLUNCH: + { + // Contact is looking to trade, save it to as status message + if (hContact) + db_set_ts(hContact, "CList", "StatusMsg", TranslateT("Looking to trade")); + } + break; - SetContactExtraIcon(hContact, NULL); + case ID_STATUS_OFFLINE: + { + // If contact is offline, clear also xstatus + delSetting(hContact, "XStatusId"); + delSetting(hContact, "XStatusName"); + delSetting(hContact, "XStatusMsg"); + + if (hContact) + SetContactExtraIcon(hContact, NULL); + } + // no break intentionally + + default: + { + if (hContact) + db_unset(hContact, "CList", "StatusMsg"); + } + break; } } } @@ -150,8 +179,7 @@ void CSteamProto::UpdateContact(MCONTACT hContact, JSONNODE *data) node = json_get(data, "personastate"); WORD steamStatus = json_as_int(node); WORD status = SteamToMirandaStatus(steamStatus); - if (hContact != NULL) - SetContactStatus(hContact, status); + SetContactStatus(hContact, status); // client node = json_get(data, "personastateflags"); |