summaryrefslogtreecommitdiff
path: root/protocols/Steam/src/steam_pooling.cpp
diff options
context:
space:
mode:
authorAlexander Lantsev <aunsane@gmail.com>2014-06-04 11:36:59 +0000
committerAlexander Lantsev <aunsane@gmail.com>2014-06-04 11:36:59 +0000
commitb3f2dd6e7b0ee526c8272fe8ad48cbeb4f51885a (patch)
tree1389ceef90ec8882c445edd81ff74feecb5d03f1 /protocols/Steam/src/steam_pooling.cpp
parent852e3bb1fa504e3f52f5a6a7a824ca3002e38b07 (diff)
Steam: removed unused code
git-svn-id: http://svn.miranda-ng.org/main/trunk@9412 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/Steam/src/steam_pooling.cpp')
-rw-r--r--protocols/Steam/src/steam_pooling.cpp128
1 files changed, 0 insertions, 128 deletions
diff --git a/protocols/Steam/src/steam_pooling.cpp b/protocols/Steam/src/steam_pooling.cpp
index 957a3dff68..f2b8ef94a1 100644
--- a/protocols/Steam/src/steam_pooling.cpp
+++ b/protocols/Steam/src/steam_pooling.cpp
@@ -1,133 +1,5 @@
#include "common.h"
-void CSteamProto::PollServer(const char *token, const char *umqId, UINT32 messageId, SteamWebApi::PollApi::PollResult *pollResult)
-{
- debugLogA("CSteamProto::PollServer: call SteamWebApi::PollApi::Poll");
- SteamWebApi::PollApi::Poll(m_hNetlibUser, token, umqId, messageId, pollResult);
-
- if (!pollResult->IsSuccess())
- return;
-
- CMStringA updatedIds;
- for (size_t i = 0; i < pollResult->GetItemCount(); i++)
- {
- const SteamWebApi::PollApi::PoolItem *item = pollResult->GetAt(i);
- switch (item->GetType())
- {
- case SteamWebApi::PollApi::POOL_TYPE_TYPING:
- break;
-
- case SteamWebApi::PollApi::POOL_TYPE_MESSAGE:
- {
- SteamWebApi::PollApi::Message *message = (SteamWebApi::PollApi::Message*)item;
-
- MCONTACT hContact = FindContact(message->GetSteamId());
- if (hContact)
- {
- const wchar_t *text = message->GetText();
-
- PROTORECVEVENT recv = { 0 };
- recv.flags = PREF_UTF;
- recv.timestamp = message->GetTimestamp();
- recv.szMessage = mir_utf8encodeW(text);
-
- ProtoChainRecvMsg(hContact, &recv);
- }
- }
- break;
-
- case SteamWebApi::PollApi::POOL_TYPE_MYMESSAGE:
- {
- SteamWebApi::PollApi::Message *message = (SteamWebApi::PollApi::Message*)item;
-
- MCONTACT hContact = FindContact(message->GetSteamId());
- if (hContact)
- {
- const wchar_t *text = message->GetText();
-
- AddDBEvent(hContact, EVENTTYPE_MESSAGE, time(NULL), DBEF_UTF | DBEF_SENT, lstrlen(text), (BYTE*)mir_utf8encodeW(text));
- }
- }
- break;
-
- case SteamWebApi::PollApi::POOL_TYPE_STATE:
- {
- SteamWebApi::PollApi::State *state = (SteamWebApi::PollApi::State*)item;
-
- WORD status = CSteamProto::SteamToMirandaStatus(state->GetStatus());
- const char *steamId = state->GetSteamId();
- const wchar_t *nickname = state->GetNickname();
-
- if (IsMe(steamId))
- {
- if (status == ID_STATUS_OFFLINE)
- continue;
-
- if (status != m_iStatus)
- {
- debugLogA("Change own status to %i", status);
- WORD oldStatus = m_iStatus;
- m_iStatus = m_iDesiredStatus = status;
- ProtoBroadcastAck(NULL, ACKTYPE_STATUS, ACKRESULT_SUCCESS, (HANDLE)oldStatus, m_iStatus);
- }
- }
- /*else
- {
- MCONTACT hContact = FindContact(steamId);
- if (hContact)
- SetContactStatus(hContact, status);
- }*/
-
- if (updatedIds.IsEmpty())
- updatedIds.Append(steamId);
- else
- updatedIds.AppendFormat(",%s", steamId);
- }
- break;
-
- case SteamWebApi::PollApi::POOL_TYPE_CONTACT_ADD:
- {
- SteamWebApi::PollApi::Relationship *crs = (SteamWebApi::PollApi::Relationship*)item;
-
- const char *steamId = crs->GetSteamId();
- if (updatedIds.IsEmpty())
- updatedIds.Append(steamId);
- else
- updatedIds.AppendFormat(",%s", steamId);
- }
- break;
-
- case SteamWebApi::PollApi::POOL_TYPE_CONTACT_REMOVE:
- {
- SteamWebApi::PollApi::Relationship *crs = (SteamWebApi::PollApi::Relationship*)item;
-
- const char *steamId = crs->GetSteamId();
- MCONTACT hContact = FindContact(steamId);
- if (hContact)
- CallService(MS_DB_CONTACT_DELETE, hContact, 0);
- }
- break;
-
- case SteamWebApi::PollApi::POOL_TYPE_CONTACT_REQUEST:
- {
- SteamWebApi::PollApi::Relationship *crs = (SteamWebApi::PollApi::Relationship*)item;
-
- const char *steamId = crs->GetSteamId();
-
- MCONTACT hContact = FindContact(steamId);
- if (!hContact)
- hContact = AddContact(steamId, true);
-
- RaiseAuthRequestThread((void*)hContact);
- }
- break;
- }
- }
-
- if (!updatedIds.IsEmpty())
- UpdateContactsThread(mir_strdup(updatedIds));
-}
-
void CSteamProto::ParsePollData(JSONNODE *data)
{
JSONNODE *node, *item = NULL;