From b078dfb78c89aea87cd422eae52694738e473cf3 Mon Sep 17 00:00:00 2001 From: dartraiden Date: Sun, 21 Jul 2019 19:59:18 +0300 Subject: Restore "Free for chat" status support (fixes #1963) --- protocols/Steam/src/steam_contacts.cpp | 7 ++++++- protocols/Steam/src/steam_proto.cpp | 4 ++-- protocols/Steam/src/steam_utils.cpp | 6 ++++-- 3 files changed, 12 insertions(+), 5 deletions(-) (limited to 'protocols/Steam/src') diff --git a/protocols/Steam/src/steam_contacts.cpp b/protocols/Steam/src/steam_contacts.cpp index 4cd9ffc563..63e4c05905 100644 --- a/protocols/Steam/src/steam_contacts.cpp +++ b/protocols/Steam/src/steam_contacts.cpp @@ -19,6 +19,11 @@ void CSteamProto::SetContactStatus(MCONTACT hContact, WORD status) // Special handling of some statuses switch (status) { + case ID_STATUS_FREECHAT: + // Contact is looking to play, save it to as status message + db_set_ws(hContact, "CList", "StatusMsg", TranslateT("Looking to play")); + break; + case ID_STATUS_OFFLINE: // if contact is offline, remove played game info delSetting(hContact, "GameID"); @@ -162,7 +167,7 @@ void CSteamProto::UpdateContactDetails(MCONTACT hContact, const JSONNode &data) if (stateflags == PersonaStateFlag::None) { // 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) + if (status == ID_STATUS_ONLINE || status == ID_STATUS_FREECHAT) setWString(hContact, "MirVer", L"Steam"); } else if (contains_flag(stateflags, PersonaStateFlag::InJoinableGame)) { diff --git a/protocols/Steam/src/steam_proto.cpp b/protocols/Steam/src/steam_proto.cpp index 143a26e444..40d6e8ae09 100644 --- a/protocols/Steam/src/steam_proto.cpp +++ b/protocols/Steam/src/steam_proto.cpp @@ -189,11 +189,11 @@ INT_PTR CSteamProto::GetCaps(int type, MCONTACT) case PFLAGNUM_1: return PF1_IM | PF1_BASICSEARCH | PF1_SEARCHBYNAME | PF1_AUTHREQ | PF1_SERVERCLIST | PF1_ADDSEARCHRES | PF1_MODEMSGRECV; case PFLAGNUM_2: - return PF2_ONLINE | PF2_SHORTAWAY | PF2_LONGAWAY | PF2_HEAVYDND; + return PF2_ONLINE | PF2_SHORTAWAY | PF2_LONGAWAY | PF2_HEAVYDND | PF2_FREECHAT; case PFLAGNUM_4: return PF4_AVATARS | PF4_NOCUSTOMAUTH | PF4_NOAUTHDENYREASON | PF4_FORCEAUTH | PF4_SUPPORTIDLE | PF4_SUPPORTTYPING;// | PF4_IMSENDOFFLINE; case PFLAGNUM_5: - return PF2_HEAVYDND; + return PF2_HEAVYDND | PF2_FREECHAT; case PFLAG_UNIQUEIDTEXT: return (INT_PTR)Translate("SteamID"); default: diff --git a/protocols/Steam/src/steam_utils.cpp b/protocols/Steam/src/steam_utils.cpp index e4a45e7dbe..ad6b8b3732 100644 --- a/protocols/Steam/src/steam_utils.cpp +++ b/protocols/Steam/src/steam_utils.cpp @@ -13,9 +13,9 @@ WORD CSteamProto::SteamToMirandaStatus(PersonaState state) return ID_STATUS_AWAY; case PersonaState::Snooze: return ID_STATUS_NA; - - case PersonaState::LookingToTrade: case PersonaState::LookingToPlay: + return ID_STATUS_FREECHAT; + case PersonaState::LookingToTrade: default: return ID_STATUS_ONLINE; } @@ -34,6 +34,8 @@ PersonaState CSteamProto::MirandaToSteamState(int status) return PersonaState::Away; case ID_STATUS_NA: return PersonaState::Snooze; + case ID_STATUS_FREECHAT: + return PersonaState::LookingToPlay; default: return PersonaState::Online; } -- cgit v1.2.3