From b050c8507e79855af4163c6efe3402a63320fa23 Mon Sep 17 00:00:00 2001 From: aunsane Date: Sat, 30 Dec 2017 19:46:10 +0300 Subject: Steam: fix message sending --- protocols/Steam/src/steam_messages.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'protocols/Steam') diff --git a/protocols/Steam/src/steam_messages.cpp b/protocols/Steam/src/steam_messages.cpp index 7374be5208..a4c8ebee94 100644 --- a/protocols/Steam/src/steam_messages.cpp +++ b/protocols/Steam/src/steam_messages.cpp @@ -31,7 +31,7 @@ void CSteamProto::OnMessageSent(const HttpResponse &response, void *arg) { SendMessageParam *param = (SendMessageParam*)arg; - const char *error = Translate("Unknown error"); + std::string error = Translate("Unknown error"); ptrW steamId(getWStringA(param->hContact, "SteamID")); time_t timestamp = NULL; @@ -40,7 +40,7 @@ void CSteamProto::OnMessageSent(const HttpResponse &response, void *arg) JSONNode root = JSONNode::parse(response.Content); JSONNode node = root["error"]; if (!node.isnull()) - error = node.as_string().c_str(); + error = node.as_string(); node = root["utc_timestamp"]; if (!node.isnull()) @@ -51,10 +51,10 @@ void CSteamProto::OnMessageSent(const HttpResponse &response, void *arg) } } - if (mir_strcmpi(error, "OK") != 0) + if (mir_strcmpi(error.c_str(), "OK") != 0) { - debugLogA(__FUNCTION__ ": failed to send message for %s (%s)", steamId, error); - ProtoBroadcastAck(param->hContact, ACKTYPE_MESSAGE, ACKRESULT_FAILED, param->hMessage, (LPARAM)error); + debugLogA(__FUNCTION__ ": failed to send message for %s (%s)", steamId, error.c_str()); + ProtoBroadcastAck(param->hContact, ACKTYPE_MESSAGE, ACKRESULT_FAILED, param->hMessage, (LPARAM)error.c_str()); } else { -- cgit v1.2.3