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_thread.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_thread.cpp')
-rw-r--r-- | protocols/Steam/src/steam_thread.cpp | 28 |
1 files changed, 22 insertions, 6 deletions
diff --git a/protocols/Steam/src/steam_thread.cpp b/protocols/Steam/src/steam_thread.cpp index ef6cb813b0..a4adad5ba8 100644 --- a/protocols/Steam/src/steam_thread.cpp +++ b/protocols/Steam/src/steam_thread.cpp @@ -7,9 +7,10 @@ void CSteamProto::PollStatus(const char *token, const char *sessionId, UINT32 me if (!pollResult->IsSuccess())
return;
+ CMStringA updatedIds;
for (int i = 0; i < pollResult->GetItemCount(); i++)
{
- const SteamWebApi::PollApi::PoolItem *item = pollResult->operator[](i);
+ const SteamWebApi::PollApi::PoolItem *item = pollResult->GetAt(i);
switch (item->GetType())
{
case SteamWebApi::PollApi::POOL_TYPE_TYPING:
@@ -83,11 +84,19 @@ void CSteamProto::PollStatus(const char *token, const char *sessionId, UINT32 me SetContactStatus(hContact, status);
}
+
+ if (updatedIds.IsEmpty())
+ updatedIds.Append(steamId);
+ else
+ updatedIds.AppendFormat(",%s", steamId);
}
}
break;
}
}
+
+ if (!updatedIds.IsEmpty())
+ ForkThread(&CSteamProto::UpdateContactsThread, mir_strdup(updatedIds));
}
void CSteamProto::PollingThread(void*)
@@ -117,15 +126,22 @@ void CSteamProto::PollingThread(void*) }*/
if (!pollResult.IsSuccess())
+ {
+ SetStatus(ID_STATUS_OFFLINE);
+
+ // token has expired
+ if (pollResult.GetStatus() == HTTP_STATUS_UNAUTHORIZED)
+ {
+ delSetting("TokenSecret");
+ delSetting("Cookie");
+ }
+
break;
+ }
messageId = pollResult.GetMessageId();
- }
-
- if (pollResult.IsSuccess())
setDword("MessageID", messageId);
- else
- SetStatus(ID_STATUS_OFFLINE);
+ }
m_hPollingThread = NULL;
debugLogA("CSteamProto::PollingThread: leaving");
|