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.cpp14
1 files changed, 5 insertions, 9 deletions
diff --git a/protocols/Steam/src/steam_messages.cpp b/protocols/Steam/src/steam_messages.cpp
index 418d57d814..f2f2c51c8a 100644
--- a/protocols/Steam/src/steam_messages.cpp
+++ b/protocols/Steam/src/steam_messages.cpp
@@ -17,30 +17,26 @@ void CSteamProto::OnMessageSent(const NETLIBHTTPREQUEST *response, void *arg)
{
SendMessageParam *param = (SendMessageParam*)arg;
- int status = ACKRESULT_FAILED;
- ptrT error;
-
+ ptrT error(mir_tstrdup(TranslateT("Unknown error")));
ptrT steamId(getTStringA(param->hContact, "SteamID"));
if (response != NULL && response->resultCode == HTTP_STATUS_OK)
{
JSONROOT root(response->pData);
JSONNODE *node = json_get(root, "error");
- error = json_as_string(node);
+ if (node)
+ error = json_as_string(node);
}
+ int status = ACKRESULT_FAILED;
+
if (!mir_tstrcmpi(error, _T("OK")))
{
status = ACKRESULT_SUCCESS;
error = NULL;
}
else
- {
- if (!error)
- error = mir_tstrdup(IsOnline() ? TranslateT("Unknown error") : TranslateT("You cannot send messages when you are offline."));
-
debugLog(_T("CSteamProto::OnMessageSent: failed to send message for %s (%s)"), steamId, error);
- }
ProtoBroadcastAck(
param->hContact,