From 16218c1592da1995ffedc41cfa46dc06ac1b27b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20P=C3=B6sel?= Date: Sat, 7 Feb 2015 13:31:44 +0000 Subject: Steam: Support for receiving typing notifications; version bump git-svn-id: http://svn.miranda-ng.org/main/trunk@12040 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/Steam/src/steam_pooling.cpp | 38 +++++++++++++++++------------------ 1 file changed, 18 insertions(+), 20 deletions(-) (limited to 'protocols/Steam/src/steam_pooling.cpp') 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"); -- cgit v1.2.3