summaryrefslogtreecommitdiff
path: root/protocols/Steam/src/steam_proto.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'protocols/Steam/src/steam_proto.cpp')
-rw-r--r--protocols/Steam/src/steam_proto.cpp25
1 files changed, 22 insertions, 3 deletions
diff --git a/protocols/Steam/src/steam_proto.cpp b/protocols/Steam/src/steam_proto.cpp
index 4d6da4e763..8644f9fa50 100644
--- a/protocols/Steam/src/steam_proto.cpp
+++ b/protocols/Steam/src/steam_proto.cpp
@@ -231,13 +231,32 @@ HANDLE CSteamProto::SearchBasic(const TCHAR* id)
PushRequest(
new GetUserSummariesRequest(token, steamId),
- &CSteamProto::OnSearchByIdEnded,
- mir_tstrdup(id),
- MirFreeArg);
+ &CSteamProto::OnSearchResults,
+ (HANDLE)STEAM_SEARCH_BYID);
return (HANDLE)STEAM_SEARCH_BYID;
}
+HANDLE CSteamProto::SearchByName(const TCHAR* nick, const TCHAR* firstName, const TCHAR* lastName)
+{
+ if (!this->IsOnline())
+ return 0;
+
+ // Combine all fields to single text
+ TCHAR keywordsT[200];
+ mir_sntprintf(keywordsT, _T("%s %s %s"), nick, firstName, lastName);
+
+ ptrA token(getStringA("TokenSecret"));
+ ptrA keywords(mir_utf8encodeW(keywordsT));
+
+ PushRequest(
+ new SearchRequest(token, keywords),
+ &CSteamProto::OnSearchByNameStarted,
+ (HANDLE)STEAM_SEARCH_BYNAME);
+
+ return (HANDLE)STEAM_SEARCH_BYNAME;
+}
+
int CSteamProto::SendMsg(MCONTACT hContact, int, const char *message)
{
if (!IsOnline())