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 /protocols/Steam/src/steam_pooling.cpp | |
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
Diffstat (limited to 'protocols/Steam/src/steam_pooling.cpp')
-rw-r--r-- | protocols/Steam/src/steam_pooling.cpp | 38 |
1 files changed, 18 insertions, 20 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"); |