diff options
author | Alexander Lantsev <aunsane@gmail.com> | 2014-06-03 17:45:05 +0000 |
---|---|---|
committer | Alexander Lantsev <aunsane@gmail.com> | 2014-06-03 17:45:05 +0000 |
commit | 4c533c2fd10ff3d0e40ec384f5828c71e8b0e0f8 (patch) | |
tree | 83a04a05dd66c460e72f7f12e51a9de07203ee83 /protocols/Steam/src/steam_messages.cpp | |
parent | b7c991c686cd440cb8b81745ec587fbf29deb97d (diff) |
Steam:
- fixed message sending
- fixed auth request
git-svn-id: http://svn.miranda-ng.org/main/trunk@9406 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/Steam/src/steam_messages.cpp')
-rw-r--r-- | protocols/Steam/src/steam_messages.cpp | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/protocols/Steam/src/steam_messages.cpp b/protocols/Steam/src/steam_messages.cpp index 80e68ecdc0..c6a06672f3 100644 --- a/protocols/Steam/src/steam_messages.cpp +++ b/protocols/Steam/src/steam_messages.cpp @@ -39,7 +39,25 @@ void CSteamProto::OnMessageSent(const NETLIBHTTPREQUEST *response, void *arg) {
SendMessageParam *param = (SendMessageParam*)arg;
- int status = response->resultCode == HTTP_STATUS_OK ? ACKRESULT_SUCCESS : ACKRESULT_FAILED;
+ bool result = false;
+
+ ptrA steamId((char*)arg);
+
+ if (response != NULL && response->resultCode == HTTP_STATUS_OK)
+ {
+ JSONNODE *root = json_parse(response->pData), *node;
+
+ node = json_get(root, "error");
+ ptrA error(mir_utf8encodeW(json_as_string(node)));
+ if (lstrcmpiA(error, "OK") == 0)
+ result = true;
+ else
+ debugLogA("CSteamProto::OnMessageSent: failed to send message for %s (%s)", steamId, error);
+ }
+ else
+ debugLogA("CSteamProto::OnMessageSent: failed to send message for %s", steamId);
+
+ int status = result ? ACKRESULT_SUCCESS : ACKRESULT_FAILED;
ProtoBroadcastAck(
param->hContact,
|