diff options
author | Alexander Lantsev <aunsane@gmail.com> | 2014-04-09 12:06:39 +0000 |
---|---|---|
committer | Alexander Lantsev <aunsane@gmail.com> | 2014-04-09 12:06:39 +0000 |
commit | 5d2487dc97a63b0545b2d7d56405e7417fa2dd75 (patch) | |
tree | 8dea03916b8f166232dfe2fe28c5c218596e75c5 /protocols/Steam/src/steam_proto.cpp | |
parent | 33011dcb857b9e762c44bc9a9875365e2f5d0f91 (diff) |
Steam:
- add searching by name
- added contact info updating
- small improvements
git-svn-id: http://svn.miranda-ng.org/main/trunk@8901 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/Steam/src/steam_proto.cpp')
-rw-r--r-- | protocols/Steam/src/steam_proto.cpp | 25 |
1 files changed, 19 insertions, 6 deletions
diff --git a/protocols/Steam/src/steam_proto.cpp b/protocols/Steam/src/steam_proto.cpp index 2684818880..1a7f7f2b7b 100644 --- a/protocols/Steam/src/steam_proto.cpp +++ b/protocols/Steam/src/steam_proto.cpp @@ -27,6 +27,8 @@ CSteamProto::CSteamProto(const char* protoName, const TCHAR* userName) : sid.ptszDescription = LPGENT("Protocol icon");
sid.iDefaultIndex = -IDI_STEAM;
Skin_AddIcon(&sid);
+
+ SetAllContactsStatus(ID_STATUS_OFFLINE);
}
CSteamProto::~CSteamProto()
@@ -36,11 +38,11 @@ CSteamProto::~CSteamProto() MCONTACT __cdecl CSteamProto::AddToList(int flags, PROTOSEARCHRESULT* psr)
{
- /*CContact::Ref contact;
- this->GetContact((char *)mir_ptr<char>(::mir_utf8encodeW(psr->id)), contact);
- return this->AddContact(contact);*/
+ if (psr->cbSize != sizeof(STEAM_SEARCH_RESULT))
+ return 0;
- return 0;
+ STEAM_SEARCH_RESULT *ssr = (STEAM_SEARCH_RESULT*)psr;
+ return AddContact(ssr->contact);
}
MCONTACT __cdecl CSteamProto::AddToListByEvent(int flags, int iContact, HANDLE hDbEvent)
@@ -93,7 +95,7 @@ DWORD_PTR __cdecl CSteamProto:: GetCaps(int type, MCONTACT hContact) switch(type)
{
case PFLAGNUM_1:
- return PF1_IM | PF1_BASICSEARCH;
+ return PF1_IM | PF1_BASICSEARCH | PF1_SEARCHBYNAME;
case PFLAGNUM_2:
return PF2_ONLINE;
case PFLAG_UNIQUEIDTEXT:
@@ -124,7 +126,18 @@ HANDLE __cdecl CSteamProto::SearchByEmail(const TCHAR* email) HANDLE __cdecl CSteamProto::SearchByName(const TCHAR* nick, const TCHAR* firstName, const TCHAR* lastName)
{
- return 0;
+ if (!this->IsOnline())
+ return 0;
+
+ CMString keywords;
+ keywords.AppendFormat(L" %s", nick);
+ keywords.AppendFormat(L" %s", firstName);
+ keywords.AppendFormat(L" %s", lastName);
+ keywords.Trim();
+
+ ForkThread(&CSteamProto::SearchByNameThread, mir_wstrdup(keywords));
+
+ return (HANDLE)STEAM_SEARCH_BYNAME;
}
HWND __cdecl CSteamProto::SearchAdvanced( HWND owner ) { return 0; }
|