diff options
author | Robert Pösel <robyer@seznam.cz> | 2014-12-08 23:53:49 +0000 |
---|---|---|
committer | Robert Pösel <robyer@seznam.cz> | 2014-12-08 23:53:49 +0000 |
commit | 97d772455be44b3693678bb5192e5c6bc777bc98 (patch) | |
tree | 3729e0320c19d4a6d888d2003119e707d27104d1 /protocols/Steam/src/steam_proto.cpp | |
parent | 13eb656152eb83e6b246293da72294ce22c6cc48 (diff) |
Steam: Refactor statuses support
- allow changing own status
- change own status when it changes on server
- temporary don't distinguish between playing/not playing contacts
- fix steam<->miranda status mapping
git-svn-id: http://svn.miranda-ng.org/main/trunk@11291 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/Steam/src/steam_proto.cpp')
-rw-r--r-- | protocols/Steam/src/steam_proto.cpp | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/protocols/Steam/src/steam_proto.cpp b/protocols/Steam/src/steam_proto.cpp index 612d66768f..36592a4082 100644 --- a/protocols/Steam/src/steam_proto.cpp +++ b/protocols/Steam/src/steam_proto.cpp @@ -35,6 +35,7 @@ CSteamProto::CSteamProto(const char* protoName, const TCHAR* userName) : Skin_AddIcon(&sid); // temporary DB settings + db_set_resident(m_szModuleName, "Status"); // NOTE: XStatus cannot be temporary db_set_resident(m_szModuleName, "IdleTS"); SetAllContactsStatus(ID_STATUS_OFFLINE); @@ -199,11 +200,11 @@ DWORD_PTR __cdecl CSteamProto:: GetCaps(int type, MCONTACT hContact) case PFLAGNUM_1: return PF1_IM | PF1_BASICSEARCH | PF1_SEARCHBYNAME | PF1_AUTHREQ | PF1_SERVERCLIST | PF1_ADDSEARCHRES; case PFLAGNUM_2: - return PF2_ONLINE | PF2_SHORTAWAY | PF2_HEAVYDND | PF2_OUTTOLUNCH; + return PF2_ONLINE | PF2_SHORTAWAY | PF2_LONGAWAY | PF2_HEAVYDND | PF2_OUTTOLUNCH | PF2_FREECHAT; case PFLAGNUM_4: return PF4_AVATARS | PF4_NOCUSTOMAUTH | PF4_NOAUTHDENYREASON | PF4_FORCEAUTH | PF4_FORCEADDED | PF4_IMSENDUTF | PF4_SUPPORTIDLE;// | PF4_IMSENDOFFLINE | PF4_SUPPORTTYPING; case PFLAGNUM_5: - return PF2_SHORTAWAY | PF2_HEAVYDND | PF2_OUTTOLUNCH; + return 0; case PFLAG_UNIQUEIDTEXT: return (DWORD_PTR)Translate("SteamID"); case PFLAG_UNIQUEIDSETTING: @@ -325,10 +326,15 @@ int CSteamProto::SetStatus(int new_status) // Routing statuses not supported by Steam switch (new_status) { - case ID_STATUS_OFFLINE: + case ID_STATUS_OCCUPIED: + new_status = ID_STATUS_DND; break; - default: + case ID_STATUS_ONTHEPHONE: + new_status = ID_STATUS_AWAY; + break; + + case ID_STATUS_INVISIBLE: new_status = ID_STATUS_ONLINE; break; } @@ -362,6 +368,16 @@ int CSteamProto::SetStatus(int new_status) //ForkThread(&CSteamProto::LogInThread, NULL); StartQueue(); } + else { + ptrA token(getStringA("TokenSecret")); + ptrA sessionId(getStringA("SessionID")); + int state = MirandaToSteamState(new_status); + + PushRequest( + new SteamWebApi::SetStatusRequest(token, sessionId, state), + &CSteamProto::OnStatusChanged, + (void *)new_status); + } return 0; } |