From 4eccffd2cb24cfaf32959fcf400aaea1930af15f Mon Sep 17 00:00:00 2001 From: Kirill Volinsky Date: Fri, 1 May 2015 11:02:35 +0000 Subject: warnings fix not used file removed git-svn-id: http://svn.miranda-ng.org/main/trunk@13330 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/Steam/src/steam_account.cpp | 9 +- protocols/Steam/src/steam_contacts.cpp | 8 +- protocols/Steam/src/steam_dialogs.cpp | 4 - protocols/Steam/src/steam_events.cpp | 6 +- protocols/Steam/src/steam_proto.cpp | 8 +- protocols/Steam/src/steam_thread.cpp | 171 --------------------------------- 6 files changed, 15 insertions(+), 191 deletions(-) delete mode 100644 protocols/Steam/src/steam_thread.cpp (limited to 'protocols/Steam/src') diff --git a/protocols/Steam/src/steam_account.cpp b/protocols/Steam/src/steam_account.cpp index a01bc51e38..43328069a3 100644 --- a/protocols/Steam/src/steam_account.cpp +++ b/protocols/Steam/src/steam_account.cpp @@ -14,7 +14,7 @@ bool CSteamProto::IsMe(const char *steamId) return false; } -void CSteamProto::OnGotRsaKey(const NETLIBHTTPREQUEST *response, void *arg) +void CSteamProto::OnGotRsaKey(const NETLIBHTTPREQUEST *response, void *) { if (response == NULL) return; @@ -46,7 +46,6 @@ void CSteamProto::OnGotRsaKey(const NETLIBHTTPREQUEST *response, void *arg) DWORD error = 0; DWORD encryptedSize = 0; - DWORD passwordSize = (DWORD)strlen(password); if ((error = RsaEncrypt(modulus, password, NULL, encryptedSize)) != 0) { debugLogA("CSteamProto::OnGotRsaKey: encryption error (%lu)", error); @@ -74,7 +73,7 @@ void CSteamProto::OnGotRsaKey(const NETLIBHTTPREQUEST *response, void *arg) &CSteamProto::OnAuthorization); } -void CSteamProto::OnAuthorization(const NETLIBHTTPREQUEST *response, void *arg) +void CSteamProto::OnAuthorization(const NETLIBHTTPREQUEST *response, void *) { if (response == NULL) { SetStatus(ID_STATUS_OFFLINE); @@ -190,7 +189,7 @@ void CSteamProto::OnAuthorization(const NETLIBHTTPREQUEST *response, void *arg) &CSteamProto::OnLoggedOn); } -void CSteamProto::OnGotSession(const NETLIBHTTPREQUEST *response, void *arg) +void CSteamProto::OnGotSession(const NETLIBHTTPREQUEST *response, void *) { if(response == NULL) return; @@ -209,7 +208,7 @@ void CSteamProto::OnGotSession(const NETLIBHTTPREQUEST *response, void *arg) } } -void CSteamProto::OnLoggedOn(const NETLIBHTTPREQUEST *response, void *arg) +void CSteamProto::OnLoggedOn(const NETLIBHTTPREQUEST *response, void *) { if (response == NULL) { diff --git a/protocols/Steam/src/steam_contacts.cpp b/protocols/Steam/src/steam_contacts.cpp index 64c98467de..13bfcba0a4 100644 --- a/protocols/Steam/src/steam_contacts.cpp +++ b/protocols/Steam/src/steam_contacts.cpp @@ -359,7 +359,7 @@ void CSteamProto::ProcessContact(std::map::iterator *it, } } -void CSteamProto::OnGotFriendList(const NETLIBHTTPREQUEST *response, void *arg) +void CSteamProto::OnGotFriendList(const NETLIBHTTPREQUEST *response, void *) { if (response == NULL) return; @@ -444,7 +444,7 @@ void CSteamProto::OnGotFriendList(const NETLIBHTTPREQUEST *response, void *arg) } } -void CSteamProto::OnGotBlockList(const NETLIBHTTPREQUEST *response, void *arg) +void CSteamProto::OnGotBlockList(const NETLIBHTTPREQUEST *response, void *) { if (response == NULL) return; @@ -488,7 +488,7 @@ void CSteamProto::OnGotBlockList(const NETLIBHTTPREQUEST *response, void *arg) } } -void CSteamProto::OnGotUserSummaries(const NETLIBHTTPREQUEST *response, void *arg) +void CSteamProto::OnGotUserSummaries(const NETLIBHTTPREQUEST *response, void *) { if (response == NULL) return; @@ -753,7 +753,7 @@ void CSteamProto::OnSearchByIdEnded(const NETLIBHTTPREQUEST *response, void *arg json_delete(nodes); } -void CSteamProto::OnSearchByNameStarted(const NETLIBHTTPREQUEST *response, void *arg) +void CSteamProto::OnSearchByNameStarted(const NETLIBHTTPREQUEST *, void *) { } diff --git a/protocols/Steam/src/steam_dialogs.cpp b/protocols/Steam/src/steam_dialogs.cpp index e75d1a913f..8819c17ad8 100644 --- a/protocols/Steam/src/steam_dialogs.cpp +++ b/protocols/Steam/src/steam_dialogs.cpp @@ -231,10 +231,6 @@ void CSteamOptionsBlockList::OnInitDialog() { m_list.SetExtendedListViewStyle(LVS_EX_SUBITEMIMAGES | LVS_EX_FULLROWSELECT | LVS_EX_LABELTIP); - HIMAGELIST hIml = m_list.CreateImageList(LVSIL_SMALL); - //ImageList_AddIcon_Icolib(hIml, m_proto->LoadIconEx("group")); - //ImageList_AddIcon_Icolib(hIml, LoadSkinnedIcon(SKINICON_EVENT_URL)); - m_list.AddColumn(0, TranslateT("Name"), 220); m_list.AddColumn(1, _T(""), 32 - GetSystemMetrics(SM_CXVSCROLL)); } diff --git a/protocols/Steam/src/steam_events.cpp b/protocols/Steam/src/steam_events.cpp index ee4669ca5b..434eaed925 100644 --- a/protocols/Steam/src/steam_events.cpp +++ b/protocols/Steam/src/steam_events.cpp @@ -29,12 +29,12 @@ int CSteamProto::OnPreShutdown(WPARAM, LPARAM) return 0; } -INT_PTR CSteamProto::OnAccountManagerInit(WPARAM wParam, LPARAM lParam) +INT_PTR CSteamProto::OnAccountManagerInit(WPARAM, LPARAM lParam) { return (INT_PTR)(CSteamOptionsMain::CreateAccountManagerPage(this, (HWND)lParam))->GetHwnd(); } -int CSteamProto::OnOptionsInit(WPARAM wParam, LPARAM lParam) +int CSteamProto::OnOptionsInit(WPARAM wParam, LPARAM) { OPTIONSDIALOGPAGE odp = { 0 }; odp.hInstance = g_hInstance; @@ -52,7 +52,7 @@ int CSteamProto::OnOptionsInit(WPARAM wParam, LPARAM lParam) return 0; } -int CSteamProto::OnIdleChanged(WPARAM wParam, LPARAM lParam) +int CSteamProto::OnIdleChanged(WPARAM, LPARAM lParam) { bool idle = (lParam & IDF_ISIDLE) != 0; bool privacy = (lParam & IDF_PRIVACY) != 0; diff --git a/protocols/Steam/src/steam_proto.cpp b/protocols/Steam/src/steam_proto.cpp index 1b005a628d..405f598d5e 100644 --- a/protocols/Steam/src/steam_proto.cpp +++ b/protocols/Steam/src/steam_proto.cpp @@ -71,7 +71,7 @@ CSteamProto::~CSteamProto() UninitQueue(); } -MCONTACT __cdecl CSteamProto::AddToList(int flags, PROTOSEARCHRESULT* psr) +MCONTACT __cdecl CSteamProto::AddToList(int, PROTOSEARCHRESULT* psr) { MCONTACT hContact = NULL; ptrA steamId(mir_u2a(psr->id)); @@ -126,7 +126,7 @@ int __cdecl CSteamProto::Authorize(MEVENT hDbEvent) return 1; } -int __cdecl CSteamProto::AuthDeny(MEVENT hDbEvent, const TCHAR* szReason) +int __cdecl CSteamProto::AuthDeny(MEVENT hDbEvent, const TCHAR*) { if (IsOnline() && hDbEvent) { @@ -153,7 +153,7 @@ int __cdecl CSteamProto::AuthDeny(MEVENT hDbEvent, const TCHAR* szReason) return 1; } -int __cdecl CSteamProto::AuthRequest(MCONTACT hContact, const TCHAR* szMessage) +int __cdecl CSteamProto::AuthRequest(MCONTACT hContact, const TCHAR*) { if (IsOnline() && hContact) { @@ -193,7 +193,7 @@ int __cdecl CSteamProto::AuthRequest(MCONTACT hContact, const TCHAR* szMessage) return 1; } -DWORD_PTR __cdecl CSteamProto:: GetCaps(int type, MCONTACT hContact) +DWORD_PTR __cdecl CSteamProto:: GetCaps(int type, MCONTACT) { switch(type) { diff --git a/protocols/Steam/src/steam_thread.cpp b/protocols/Steam/src/steam_thread.cpp deleted file mode 100644 index 91f202a955..0000000000 --- a/protocols/Steam/src/steam_thread.cpp +++ /dev/null @@ -1,171 +0,0 @@ -#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::PollingThread(void*) -{ - debugLogA("CSteamProto::PollingThread: entering"); - - ptrA token(getStringA("TokenSecret")); - ptrA umqId(getStringA("UMQID")); - UINT32 messageId = getDword("MessageID", 0); - - SteamWebApi::PollApi::PollResult pollResult; - while (!m_bTerminated) - { - PollServer(token, umqId, messageId, &pollResult); - - if (pollResult.IsNeedRelogin()) - { - debugLogA("CSteamProto::PollingThread: need to relogin"); - SetStatus(ID_STATUS_OFFLINE); - } - - if (!pollResult.IsSuccess()) - { - debugLogA("CSteamProto::PollServer: call SteamWebApi::PollApi::Poll"); - SetStatus(ID_STATUS_OFFLINE); - - // token has expired - if (pollResult.GetStatus() == HTTP_STATUS_UNAUTHORIZED) - { - delSetting("TokenSecret"); - //delSetting("Cookie"); - } - - break; - } - - messageId = pollResult.GetMessageId(); - setDword("MessageID", messageId); - } - - m_hPollingThread = NULL; - debugLogA("CSteamProto::PollingThread: leaving"); -} \ No newline at end of file -- cgit v1.2.3