summaryrefslogtreecommitdiff
path: root/protocols/Steam
diff options
context:
space:
mode:
authorAlexander Lantsev <aunsane@gmail.com>2015-09-14 19:49:42 +0000
committerAlexander Lantsev <aunsane@gmail.com>2015-09-14 19:49:42 +0000
commit134439511d180795dc79f25dd617a9dcdce8dd29 (patch)
treeeca9f9496392fa320f6ce6b6d24bdfcbdac81188 /protocols/Steam
parentdda141f0798b79cfa71e78934ed1b968fcc20f53 (diff)
Steam: minor fixes
git-svn-id: http://svn.miranda-ng.org/main/trunk@15355 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/Steam')
-rw-r--r--protocols/Steam/src/steam_contacts.cpp10
-rw-r--r--protocols/Steam/src/steam_login.cpp9
2 files changed, 14 insertions, 5 deletions
diff --git a/protocols/Steam/src/steam_contacts.cpp b/protocols/Steam/src/steam_contacts.cpp
index 85c2dc2fd6..03acc8a65f 100644
--- a/protocols/Steam/src/steam_contacts.cpp
+++ b/protocols/Steam/src/steam_contacts.cpp
@@ -112,7 +112,7 @@ void CSteamProto::UpdateContact(MCONTACT hContact, JSONNode *data)
node = json_get(data, "realname");
if (node != NULL)
{
- std::wstring realname = ptrT(json_as_string(node));
+ std::wstring realname = (TCHAR*)ptrT(json_as_string(node));
if (!realname.empty())
{
size_t pos = realname.find(L' ', 1);
@@ -137,7 +137,7 @@ void CSteamProto::UpdateContact(MCONTACT hContact, JSONNode *data)
// avatar
bool biggerAvatars = getBool("UseBigAvatars", false);
node = json_get(data, biggerAvatars ? "avatarfull" : "avatarmedium");
- std::string avatarUrl = _T2A(ptrT(json_as_string(node)));
+ std::string avatarUrl = (char*)_T2A(ptrT(json_as_string(node)));
CheckAvatarChange(hContact, avatarUrl);
// set country
@@ -364,7 +364,7 @@ void CSteamProto::OnGotFriendList(const NETLIBHTTPREQUEST *response)
if (root == NULL)
return;
- std::string steamIds = ptrA(getStringA("SteamID"));
+ std::string steamIds = (char*)ptrA(getStringA("SteamID"));
std::map<std::string, JSONNode*> friends;
@@ -383,7 +383,7 @@ void CSteamProto::OnGotFriendList(const NETLIBHTTPREQUEST *response)
if (node == NULL)
continue;
- std::string steamId = _T2A(ptrT(json_as_string(node)));
+ std::string steamId = (char*)_T2A(ptrT(json_as_string(node)));
friends.insert(std::make_pair(steamId, child));
}
}
@@ -725,7 +725,7 @@ void CSteamProto::OnSearchByIdEnded(const NETLIBHTTPREQUEST *response, void *arg
node = json_get(nroot, "realname");
if (node != NULL)
{
- std::wstring realname = ptrT(json_as_string(node));
+ std::wstring realname = (TCHAR*)ptrT(json_as_string(node));
if (!realname.empty())
{
size_t pos = realname.find(' ', 1);
diff --git a/protocols/Steam/src/steam_login.cpp b/protocols/Steam/src/steam_login.cpp
index 3b209d97de..771051a68b 100644
--- a/protocols/Steam/src/steam_login.cpp
+++ b/protocols/Steam/src/steam_login.cpp
@@ -19,6 +19,9 @@ void CSteamProto::OnGotRsaKey(const NETLIBHTTPREQUEST *response)
if (!response)
return;
+ if (!response->pData)
+ return;
+
// load rsa key parts
JSONNode root = JSONNode::parse(response->pData);
if (!root)
@@ -81,6 +84,12 @@ void CSteamProto::OnAuthorization(const NETLIBHTTPREQUEST *response)
return;
}
+ if (!response->pData)
+ {
+ SetStatus(ID_STATUS_OFFLINE);
+ return;
+ }
+
JSONNode root = JSONNode::parse(response->pData);
if (!root)
{