diff options
author | Robert Pösel <robyer@seznam.cz> | 2014-12-04 06:53:29 +0000 |
---|---|---|
committer | Robert Pösel <robyer@seznam.cz> | 2014-12-04 06:53:29 +0000 |
commit | 2c53355b27f4a44f2109f9a045d2f9e40cb06216 (patch) | |
tree | 65035849b3f894a0bf3caf63e7db427014813ee3 /protocols | |
parent | aaf41a3dbab17fc84a3fd448d6653beb280d3a7c (diff) |
Steam:
- Fixed saving URL of contact's avatar and thus avatar itself
- Fixed loading user infos (including current status) at login
- Use common name for logoff time value in db ("LogoffTS")
- Fixed setting real name (firstname, lastname)
git-svn-id: http://svn.miranda-ng.org/main/trunk@11235 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols')
-rw-r--r-- | protocols/Steam/src/steam_contacts.cpp | 23 |
1 files changed, 9 insertions, 14 deletions
diff --git a/protocols/Steam/src/steam_contacts.cpp b/protocols/Steam/src/steam_contacts.cpp index 884c1f9c59..7354fa3395 100644 --- a/protocols/Steam/src/steam_contacts.cpp +++ b/protocols/Steam/src/steam_contacts.cpp @@ -73,14 +73,11 @@ void CSteamProto::UpdateContact(MCONTACT hContact, JSONNODE *data) std::wstring realname = json_as_string(node);
if (!realname.empty())
{
- size_t pos = realname.find(' ', 1);
- if (pos != std::string::npos)
+ size_t pos = realname.find(L' ', 1);
+ if (pos != std::wstring::npos)
{
- const wchar_t *firstName = realname.substr(0, pos).c_str();
- const wchar_t *lastName = realname.substr(pos + 1).c_str();
-
- setWString(hContact, "FirstName", firstName);
- setWString(hContact, "LastName", lastName);
+ setWString(hContact, "FirstName", realname.substr(0, pos).c_str());
+ setWString(hContact, "LastName", realname.substr(pos + 1).c_str());
}
else
{
@@ -98,7 +95,7 @@ void CSteamProto::UpdateContact(MCONTACT hContact, JSONNODE *data) // avatar
node = json_get(data, "avatarfull");
ptrA avatarUrl(mir_u2a(json_as_string(node)));
- setString("AvatarUrl", avatarUrl);
+ setString(hContact, "AvatarUrl", avatarUrl);
PushRequest(
new SteamWebApi::GetAvatarRequest(avatarUrl),
@@ -114,16 +111,16 @@ void CSteamProto::UpdateContact(MCONTACT hContact, JSONNODE *data) setString(hContact, "Country", country);
}
else
- this->delSetting(hContact, "Country");
+ delSetting(hContact, "Country");
// only for contacts
if (hContact)
{
node = json_get(data, "lastlogoff");
- setDword(hContact, "LastEventDateTS", json_as_int(node));
+ setDword(hContact, "LogoffTS", json_as_int(node));
node = json_get(data, "gameid");
- DWORD gameId = atol(ptrA(mir_u2a(json_as_string(node))));
+ DWORD gameId = node ? atol(_T2A(json_as_string(node))) : 0;
if (gameId > 0)
{
node = json_get(data, "gameextrainfo");
@@ -203,13 +200,11 @@ void CSteamProto::OnGotFriendList(const NETLIBHTTPREQUEST *response, void *arg) node = json_get(child, "steamid");
ptrA steamId(mir_u2a(json_as_string(node)));
+ steamIds.append(steamId).append(",");
MCONTACT hContact = FindContact(steamId);
if (!hContact)
- {
hContact = AddContact(steamId);
- steamIds.append(steamId).append(",");
- }
node = json_get(child, "relationship");
ptrA relationship(mir_u2a(json_as_string(node)));
|