diff options
-rw-r--r-- | protocols/Steam/src/api/message.h | 17 | ||||
-rw-r--r-- | protocols/Steam/src/steam_messages.cpp | 14 | ||||
-rw-r--r-- | protocols/Steam/src/steam_proto.h | 2 |
3 files changed, 33 insertions, 0 deletions
diff --git a/protocols/Steam/src/api/message.h b/protocols/Steam/src/api/message.h index 4c3ec6c80f..7c38bfb430 100644 --- a/protocols/Steam/src/api/message.h +++ b/protocols/Steam/src/api/message.h @@ -19,4 +19,21 @@ public: }
};
+class SendTypingRequest : public HttpRequest
+{
+public:
+ SendTypingRequest(const char *token, const char *umqId, const char *steamId) :
+ HttpRequest(REQUEST_POST, STEAM_API_URL "/ISteamWebUserPresenceOAuth/Message/v0001")
+ {
+ CMStringA data;
+ data.AppendFormat("access_token=%s&umqid=%s&steamid_dst=%s&type=typing",
+ token,
+ umqId,
+ steamId);
+
+ SetData(data, data.GetLength());
+ AddHeader("Content-Type", "application/x-www-form-urlencoded; charset=utf-8");
+ }
+};
+
#endif //_STEAM_REQUEST_MESSAGE_H_
diff --git a/protocols/Steam/src/steam_messages.cpp b/protocols/Steam/src/steam_messages.cpp index f55a31366a..c2172bb380 100644 --- a/protocols/Steam/src/steam_messages.cpp +++ b/protocols/Steam/src/steam_messages.cpp @@ -86,3 +86,17 @@ int CSteamProto::OnPreCreateMessage(WPARAM, LPARAM lParam) return 0;
}
+
+int CSteamProto::UserIsTyping(MCONTACT hContact, int type)
+{
+ // NOTE: Steam doesn't support sending "user stopped typing" so we're sending only positive info
+ if (hContact && IsOnline() && type == PROTOTYPE_SELFTYPING_ON)
+ {
+ ptrA token(getStringA("TokenSecret"));
+ ptrA umqid(getStringA("UMQID"));
+ ptrA steamId(getStringA(hContact, "SteamID"));
+ PushRequest(new SendTypingRequest(token, umqid, steamId));
+ }
+
+ return 0;
+}
diff --git a/protocols/Steam/src/steam_proto.h b/protocols/Steam/src/steam_proto.h index 2784377976..3c282f35e7 100644 --- a/protocols/Steam/src/steam_proto.h +++ b/protocols/Steam/src/steam_proto.h @@ -58,6 +58,8 @@ public: virtual int __cdecl SetStatus(int iNewStatus);
+ virtual int __cdecl UserIsTyping(MCONTACT hContact, int type);
+
virtual int __cdecl OnEvent(PROTOEVENTTYPE eventType, WPARAM wParam, LPARAM lParam);
// instances
|