diff options
author | Robert Pösel <robyer@seznam.cz> | 2015-02-07 13:31:44 +0000 |
---|---|---|
committer | Robert Pösel <robyer@seznam.cz> | 2015-02-07 13:31:44 +0000 |
commit | 16218c1592da1995ffedc41cfa46dc06ac1b27b5 (patch) | |
tree | a56866537d037c1ce4ad97d3b91cde1d3b1efe70 | |
parent | 10a687c170007cc523d4cba3ed0ce5e1671d5af1 (diff) |
Steam: Support for receiving typing notifications; version bump
git-svn-id: http://svn.miranda-ng.org/main/trunk@12040 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
-rw-r--r-- | protocols/Steam/src/steam_pooling.cpp | 38 | ||||
-rw-r--r-- | protocols/Steam/src/steam_proto.cpp | 2 | ||||
-rw-r--r-- | protocols/Steam/src/steam_proto.h | 1 | ||||
-rw-r--r-- | protocols/Steam/src/steam_xstatus.cpp | 4 | ||||
-rw-r--r-- | protocols/Steam/src/version.h | 2 |
5 files changed, 23 insertions, 24 deletions
diff --git a/protocols/Steam/src/steam_pooling.cpp b/protocols/Steam/src/steam_pooling.cpp index e126f7c7d3..e7b41db3f5 100644 --- a/protocols/Steam/src/steam_pooling.cpp +++ b/protocols/Steam/src/steam_pooling.cpp @@ -24,38 +24,36 @@ void CSteamProto::ParsePollData(JSONNODE *data) if (!lstrcmpi(type, _T("saytext")) || !lstrcmpi(type, _T("emote")) || !lstrcmpi(type, _T("my_saytext")) || !lstrcmpi(type, _T("my_emote"))) { + MCONTACT hContact = FindContact(steamId); + if (!hContact) + continue; + node = json_get(item, "text"); ptrT text(json_as_string(node)); + ptrA szMessage(mir_utf8encodeT(text)); if (_tcsstr(type, _T("my_")) == NULL) { - MCONTACT hContact = FindContact(steamId); - if (hContact) - { - ptrA szMessage(mir_utf8encodeT(text)); + PROTORECVEVENT recv = { 0 }; + recv.flags = PREF_UTF; + recv.timestamp = timestamp; + recv.szMessage = szMessage; - PROTORECVEVENT recv = { 0 }; - recv.flags = PREF_UTF; - recv.timestamp = timestamp; - recv.szMessage = szMessage; - - ProtoChainRecvMsg(hContact, &recv); - } + ProtoChainRecvMsg(hContact, &recv); } else { - MCONTACT hContact = FindContact(steamId); - if (hContact) - { - ptrA szMessage(mir_utf8encodeT(text)); - - AddDBEvent(hContact, EVENTTYPE_MESSAGE, timestamp, DBEF_UTF | DBEF_SENT, mir_strlen(szMessage) + 1, (PBYTE)(char*)szMessage); - } + AddDBEvent(hContact, EVENTTYPE_MESSAGE, timestamp, DBEF_UTF | DBEF_SENT, mir_strlen(szMessage) + 1, (PBYTE)(char*)szMessage); } } - /*else if (!lstrcmpi(type, _T("typing"))) + else if (!lstrcmpi(type, _T("typing"))) { - }*/ + MCONTACT hContact = FindContact(steamId); + if (hContact) + { + CallService(MS_PROTO_CONTACTISTYPING, hContact, (LPARAM)STEAM_TYPING_TIME); + } + } else if (!lstrcmpi(type, _T("personastate"))) { node = json_get(item, "persona_state"); diff --git a/protocols/Steam/src/steam_proto.cpp b/protocols/Steam/src/steam_proto.cpp index 7c645b4eae..63305fbb6d 100644 --- a/protocols/Steam/src/steam_proto.cpp +++ b/protocols/Steam/src/steam_proto.cpp @@ -235,7 +235,7 @@ DWORD_PTR __cdecl CSteamProto:: GetCaps(int type, MCONTACT hContact) case PFLAGNUM_2: 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; + return PF4_AVATARS | PF4_NOCUSTOMAUTH | PF4_NOAUTHDENYREASON | PF4_FORCEAUTH | PF4_FORCEADDED | PF4_IMSENDUTF | PF4_SUPPORTIDLE | PF4_SUPPORTTYPING;// | PF4_IMSENDOFFLINE; case PFLAGNUM_5: return PF2_SHORTAWAY | PF2_LONGAWAY | PF2_HEAVYDND | PF2_OUTTOLUNCH | PF2_FREECHAT; case PFLAG_UNIQUEIDTEXT: diff --git a/protocols/Steam/src/steam_proto.h b/protocols/Steam/src/steam_proto.h index acbae5c3c5..7824578824 100644 --- a/protocols/Steam/src/steam_proto.h +++ b/protocols/Steam/src/steam_proto.h @@ -3,6 +3,7 @@ #define STEAM_SEARCH_BYID 1001 #define STEAM_SEARCH_BYNAME 1002 +#define STEAM_TYPING_TIME 10 struct GuardParam { diff --git a/protocols/Steam/src/steam_xstatus.cpp b/protocols/Steam/src/steam_xstatus.cpp index b157971331..ca20df452a 100644 --- a/protocols/Steam/src/steam_xstatus.cpp +++ b/protocols/Steam/src/steam_xstatus.cpp @@ -1,7 +1,7 @@ #include "common.h" #define STATUS_TITLE_MAX 64 -#define STATUS_DESC_MAX 255 +#define STATUS_DESC_MAX 250 static std::vector<int> xstatusIconsValid; static std::map<int, int> xstatusIcons; @@ -143,7 +143,7 @@ INT_PTR CSteamProto::OnRequestAdvStatusIconIdx(WPARAM wParam, LPARAM lParam) { std::map<int, int>::iterator it = xstatusIcons.find(status); if (it != xstatusIcons.end()) - return (it->second & 0xFFFF) << 16; + return ((INT_PTR) it->second & 0xFFFF) << 16; } } diff --git a/protocols/Steam/src/version.h b/protocols/Steam/src/version.h index 264807ab12..e493763ec5 100644 --- a/protocols/Steam/src/version.h +++ b/protocols/Steam/src/version.h @@ -1,7 +1,7 @@ #define __MAJOR_VERSION 0
#define __MINOR_VERSION 11
#define __RELEASE_NUM 2
-#define __BUILD_NUM 1
+#define __BUILD_NUM 2
#include <stdver.h>
|