summaryrefslogtreecommitdiff
path: root/protocols/Steam/src/steam_messages.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'protocols/Steam/src/steam_messages.cpp')
-rw-r--r--protocols/Steam/src/steam_messages.cpp20
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,