diff options
Diffstat (limited to 'protocols/Steam/src')
-rw-r--r-- | protocols/Steam/src/steam_contacts.cpp | 3 | ||||
-rw-r--r-- | protocols/Steam/src/steam_proto.cpp | 28 | ||||
-rw-r--r-- | protocols/Steam/src/steam_proto.h | 1 | ||||
-rw-r--r-- | protocols/Steam/src/steam_request.cpp | 2 |
4 files changed, 26 insertions, 8 deletions
diff --git a/protocols/Steam/src/steam_contacts.cpp b/protocols/Steam/src/steam_contacts.cpp index 2f20ba9378..22c71fb386 100644 --- a/protocols/Steam/src/steam_contacts.cpp +++ b/protocols/Steam/src/steam_contacts.cpp @@ -35,8 +35,7 @@ void CSteamProto::SetContactStatus(MCONTACT hContact, WORD status) delSetting(hContact, "XStatusMsg"); // and extra icon SetContactExtraIcon(hContact, NULL); - // no break intentionally - [[fallthrough]] ; + __fallthrough; default: db_unset(hContact, "CList", "StatusMsg"); diff --git a/protocols/Steam/src/steam_proto.cpp b/protocols/Steam/src/steam_proto.cpp index 445a0b94db..635db0c9cc 100644 --- a/protocols/Steam/src/steam_proto.cpp +++ b/protocols/Steam/src/steam_proto.cpp @@ -1,7 +1,7 @@ #include "stdafx.h" -CSteamProto::CSteamProto(const char *protoName, const wchar_t *userName) - : PROTO<CSteamProto>(protoName, userName), +CSteamProto::CSteamProto(const char *protoName, const wchar_t *userName) : + PROTO<CSteamProto>(protoName, userName), m_requestQueue(1), hAuthProcess(1), hMessageProcess(1) { CreateProtoService(PS_CREATEACCMGRUI, &CSteamProto::OnAccountManagerInit); @@ -95,7 +95,7 @@ CSteamProto::~CSteamProto() MCONTACT CSteamProto::AddToList(int, PROTOSEARCHRESULT *psr) { - MCONTACT hContact = AddContact(_T2A(psr->id.w), psr->nick.w, true); + MCONTACT hContact = AddContact(T2Utf(psr->id.w), psr->nick.w, true); if (psr->cbSize == sizeof(STEAM_SEARCH_RESULT)) { STEAM_SEARCH_RESULT *ssr = (STEAM_SEARCH_RESULT *)psr; @@ -105,6 +105,24 @@ MCONTACT CSteamProto::AddToList(int, PROTOSEARCHRESULT *psr) return hContact; } +MCONTACT CSteamProto::AddToListByEvent(int, int, MEVENT hDbEvent) +{ + DBEVENTINFO dbei = {}; + if ((dbei.cbBlob = db_event_getBlobSize(hDbEvent)) == (DWORD)(-1)) + return NULL; + if ((dbei.pBlob = (PBYTE)alloca(dbei.cbBlob)) == nullptr) + return NULL; + if (db_event_get(hDbEvent, &dbei)) + return NULL; + if (mir_strcmp(dbei.szModule, m_szModuleName)) + return NULL; + if (dbei.eventType != EVENTTYPE_AUTHREQUEST) + return NULL; + + DB::AUTH_BLOB blob(dbei.pBlob); + return AddContact(blob.get_email(), Utf2T(blob.get_nick())); +} + int CSteamProto::Authorize(MEVENT hDbEvent) { if (IsOnline() && hDbEvent) { @@ -291,7 +309,7 @@ int CSteamProto::SetStatus(int new_status) m_isTerminated = false; - m_hRequestQueueThread = ForkThreadEx(&CSteamProto::RequestQueueThread, nullptr, nullptr); + ForkThread(&CSteamProto::RequestQueueThread); Login(); ProtoBroadcastAck(NULL, ACKTYPE_STATUS, ACKRESULT_SUCCESS, (HANDLE)old_status, m_iStatus); @@ -341,4 +359,4 @@ void CSteamProto::OnContactDeleted(MCONTACT hContact) char *who = getStringA(hContact, "SteamID"); PushRequest(new RemoveFriendRequest(token, sessionId, steamId, who), &CSteamProto::OnFriendRemoved, (void*)who); } -}
\ No newline at end of file +} diff --git a/protocols/Steam/src/steam_proto.h b/protocols/Steam/src/steam_proto.h index 76a2d57789..6ebec59789 100644 --- a/protocols/Steam/src/steam_proto.h +++ b/protocols/Steam/src/steam_proto.h @@ -92,6 +92,7 @@ public: // PROTO_INTERFACE
MCONTACT AddToList(int flags, PROTOSEARCHRESULT *psr) override;
+ MCONTACT AddToListByEvent(int flags, int iContact, MEVENT hDbEvent) override;
int Authorize(MEVENT hDbEvent) override;
int AuthRecv(MCONTACT, PROTORECVEVENT*) override;
diff --git a/protocols/Steam/src/steam_request.cpp b/protocols/Steam/src/steam_request.cpp index 06e83c4c25..9c31d78409 100644 --- a/protocols/Steam/src/steam_request.cpp +++ b/protocols/Steam/src/steam_request.cpp @@ -98,4 +98,4 @@ void CSteamProto::RequestQueueThread(void*) for (auto &it : m_requestQueue)
delete it;
m_requestQueue.destroy();
-}
\ No newline at end of file +}
|