diff options
author | George Hazan <george.hazan@gmail.com> | 2015-05-31 11:46:05 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2015-05-31 11:46:05 +0000 |
commit | 1ce3da1cca093143d9629bc46e221dd8be962e12 (patch) | |
tree | b99d12d635a65f8c78499137137df2bd591b50be /protocols/Steam/src | |
parent | 03512ff2ed0f3d1ed6857ee85b0eb7268931ec3f (diff) |
- MAllStrings: a handy union to hold an incoming string parameter of any type;
- FNAMECHAR: atavism extincted;
- PROTOSEARCHRESULT: structure prepared to use results of any type, including utf
git-svn-id: http://svn.miranda-ng.org/main/trunk@13932 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/Steam/src')
-rw-r--r-- | protocols/Steam/src/steam_contacts.cpp | 10 | ||||
-rw-r--r-- | protocols/Steam/src/steam_proto.cpp | 44 |
2 files changed, 27 insertions, 27 deletions
diff --git a/protocols/Steam/src/steam_contacts.cpp b/protocols/Steam/src/steam_contacts.cpp index 655c0814f2..85537b886a 100644 --- a/protocols/Steam/src/steam_contacts.cpp +++ b/protocols/Steam/src/steam_contacts.cpp @@ -716,10 +716,10 @@ void CSteamProto::OnSearchByIdEnded(const NETLIBHTTPREQUEST *response, void *arg ssr.hdr.cbSize = sizeof(STEAM_SEARCH_RESULT); ssr.hdr.flags = PSR_TCHAR; - ssr.hdr.id = (TCHAR*)arg; + ssr.hdr.id.t = (TCHAR*)arg; node = json_get(nroot, "personaname"); - ssr.hdr.nick = mir_wstrdup(ptrT(json_as_string(node))); + ssr.hdr.nick.t = mir_wstrdup(ptrT(json_as_string(node))); node = json_get(nroot, "realname"); if (node != NULL) @@ -730,11 +730,11 @@ void CSteamProto::OnSearchByIdEnded(const NETLIBHTTPREQUEST *response, void *arg size_t pos = realname.find(' ', 1); if (pos != std::string::npos) { - ssr.hdr.firstName = mir_wstrdup(realname.substr(0, pos).c_str()); - ssr.hdr.lastName = mir_wstrdup(realname.substr(pos + 1).c_str()); + ssr.hdr.firstName.t = mir_wstrdup(realname.substr(0, pos).c_str()); + ssr.hdr.lastName.t = mir_wstrdup(realname.substr(pos + 1).c_str()); } else - ssr.hdr.firstName = mir_wstrdup(realname.c_str()); + ssr.hdr.firstName.t = mir_wstrdup(realname.c_str()); } } diff --git a/protocols/Steam/src/steam_proto.cpp b/protocols/Steam/src/steam_proto.cpp index f4fbfb8d65..577a896979 100644 --- a/protocols/Steam/src/steam_proto.cpp +++ b/protocols/Steam/src/steam_proto.cpp @@ -70,7 +70,7 @@ CSteamProto::~CSteamProto() MCONTACT CSteamProto::AddToList(int, PROTOSEARCHRESULT* psr) { MCONTACT hContact = NULL; - ptrA steamId(mir_u2a(psr->id)); + ptrA steamId(mir_u2a(psr->id.t)); if (psr->cbSize == sizeof(PROTOSEARCHRESULT)) { if (!FindContact(steamId)) @@ -230,10 +230,10 @@ HANDLE CSteamProto::SearchBasic(const TCHAR* id) int CSteamProto::RecvMsg(MCONTACT hContact, PROTORECVEVENT* pre) { - return (INT_PTR)AddDBEvent(hContact, EVENTTYPE_MESSAGE, pre->timestamp, DBEF_UTF, mir_strlen(pre->szMessage), (BYTE*)pre->szMessage); + return (INT_PTR)AddDBEvent(hContact, EVENTTYPE_MESSAGE, pre->timestamp, DBEF_UTF, (DWORD)mir_strlen(pre->szMessage), (BYTE*)pre->szMessage); } -int CSteamProto::SendMsg(MCONTACT hContact, int flags, const char *message) +int CSteamProto::SendMsg(MCONTACT hContact, int, const char *message) { if (!IsOnline()) { @@ -312,26 +312,26 @@ int CSteamProto::SetStatus(int new_status) requestQueue->Start(); - ptrA token(getStringA("TokenSecret"));
- if (mir_strlen(token) > 0)
- {
- PushRequest(
- new LogonRequest(token),
- &CSteamProto::OnLoggedOn);
- }
- else
- {
- ptrA username(mir_urlEncode(ptrA(mir_utf8encodeT(getTStringA("Username")))));
- if (username == NULL || username[0] == '\0')
- {
+ ptrA token(getStringA("TokenSecret")); + if (mir_strlen(token) > 0) + { + PushRequest( + new LogonRequest(token), + &CSteamProto::OnLoggedOn); + } + else + { + ptrA username(mir_urlEncode(ptrA(mir_utf8encodeT(getTStringA("Username"))))); + if (username == NULL || username[0] == '\0') + { m_iStatus = m_iDesiredStatus = ID_STATUS_OFFLINE; - ProtoBroadcastAck(NULL, ACKTYPE_STATUS, ACKRESULT_SUCCESS, (HANDLE)ID_STATUS_CONNECTING, m_iStatus);
- return 0;
- }
-
- PushRequest(
- new GetRsaKeyRequest(username),
- &CSteamProto::OnGotRsaKey);
+ ProtoBroadcastAck(NULL, ACKTYPE_STATUS, ACKRESULT_SUCCESS, (HANDLE)ID_STATUS_CONNECTING, m_iStatus); + return 0; + } + + PushRequest( + new GetRsaKeyRequest(username), + &CSteamProto::OnGotRsaKey); } } else |