diff options
author | Alexander Lantsev <aunsane@gmail.com> | 2014-04-06 18:55:34 +0000 |
---|---|---|
committer | Alexander Lantsev <aunsane@gmail.com> | 2014-04-06 18:55:34 +0000 |
commit | dea767bfe91ba408b09e4f9bcd503dd2150276a7 (patch) | |
tree | d44ac7a5e0460144feee1c2996dac5a1d02e67f5 /protocols/Steam/src/steam_messages.cpp | |
parent | 8457a7c95db2775bd977ba8de5091f5d5d9277eb (diff) |
Steam: server polling, status changing, messaging
git-svn-id: http://svn.miranda-ng.org/main/trunk@8873 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/Steam/src/steam_messages.cpp')
-rw-r--r-- | protocols/Steam/src/steam_messages.cpp | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/protocols/Steam/src/steam_messages.cpp b/protocols/Steam/src/steam_messages.cpp new file mode 100644 index 0000000000..20496bc039 --- /dev/null +++ b/protocols/Steam/src/steam_messages.cpp @@ -0,0 +1,47 @@ +#include "common.h"
+
+void CSteamProto::SendMessageThread(void *arg)
+{
+ SendMessageParam *param = (SendMessageParam*)arg;
+
+ ptrA token(getStringA("TokenSecret"));
+ ptrA sessionId(getStringA("SessionID"));
+ ptrA steamId(getStringA(param->hContact, "SteamID"));
+
+ SteamWebApi::MessageApi::SendResult sendResult;
+ SteamWebApi::MessageApi::SendMessage(m_hNetlibUser, token, sessionId, steamId, param->text, &sendResult);
+
+ ProtoBroadcastAck(
+ param->hContact,
+ ACKTYPE_MESSAGE,
+ sendResult.IsSuccess() ? ACKRESULT_SUCCESS : ACKRESULT_FAILED,
+ param->hMessage, 0);
+
+ if (sendResult.IsSuccess())
+ {
+ DBEVENTINFO dbei = { sizeof(dbei) };
+ dbei.szModule = this->m_szModuleName;
+ dbei.timestamp = sendResult.GetTimestamp();
+ dbei.eventType = EVENTTYPE_MESSAGE;
+ dbei.cbBlob = strlen(param->text);
+ dbei.pBlob = (BYTE*)param->text;
+ dbei.flags = DBEF_UTF | DBEF_SENT;
+
+ db_event_add(param->hContact, &dbei);
+ }
+
+ //mir_free((void*)param->text);
+ mir_free(param);
+}
+
+void CSteamProto::SendTypingThread(void *arg)
+{
+ MCONTACT hContact = (MCONTACT)arg;
+
+ ptrA token(getStringA("TokenSecret"));
+ ptrA sessionId(getStringA("SessionID"));
+ ptrA steamId(getStringA(hContact, "SteamID"));
+
+ SteamWebApi::MessageApi::SendResult sendResult;
+ SteamWebApi::MessageApi::SendTyping(m_hNetlibUser, token, sessionId, steamId, &sendResult);
+}
\ No newline at end of file |