diff options
-rw-r--r-- | protocols/Steam/src/steam_messages.cpp | 29 | ||||
-rw-r--r-- | protocols/Steam/src/version.h | 2 |
2 files changed, 19 insertions, 12 deletions
diff --git a/protocols/Steam/src/steam_messages.cpp b/protocols/Steam/src/steam_messages.cpp index f330e5a3ab..ba6a98649e 100644 --- a/protocols/Steam/src/steam_messages.cpp +++ b/protocols/Steam/src/steam_messages.cpp @@ -17,30 +17,37 @@ void CSteamProto::OnMessageSent(const NETLIBHTTPREQUEST *response, void *arg) {
SendMessageParam *param = (SendMessageParam*)arg;
- bool result = false;
+ int status = ACKRESULT_FAILED;
+ ptrT error;
- ptrA steamId(getStringA(param->hContact, "SteamID"));
+ ptrT steamId(getTStringA(param->hContact, "SteamID"));
if (response != NULL && response->resultCode == HTTP_STATUS_OK)
{
JSONROOT root(response->pData);
JSONNODE *node = json_get(root, "error");
- ptrA error(mir_utf8encodeW(ptrT(json_as_string(node))));
- if (lstrcmpiA(error, "OK") == 0)
- result = true;
- else
- debugLogA("CSteamProto::OnMessageSent: failed to send message for %s (%s)", steamId, error);
+ error = json_as_string(node);
}
- else
- debugLogA("CSteamProto::OnMessageSent: failed to send message for %s", steamId);
- int status = result ? ACKRESULT_SUCCESS : 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,
ACKTYPE_MESSAGE,
status,
- param->hMessage, 0);
+ param->hMessage,
+ error);
mir_free(param);
}
\ No newline at end of file diff --git a/protocols/Steam/src/version.h b/protocols/Steam/src/version.h index e493763ec5..802fa4e515 100644 --- a/protocols/Steam/src/version.h +++ b/protocols/Steam/src/version.h @@ -1,7 +1,7 @@ #define __MAJOR_VERSION 0
#define __MINOR_VERSION 11
#define __RELEASE_NUM 2
-#define __BUILD_NUM 2
+#define __BUILD_NUM 3
#include <stdver.h>
|