summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--protocols/Steam/src/steam_dialogs.cpp3
-rw-r--r--protocols/Steam/src/steam_login.cpp3
-rw-r--r--protocols/Steam/src/steam_proto.h60
3 files changed, 38 insertions, 28 deletions
diff --git a/protocols/Steam/src/steam_dialogs.cpp b/protocols/Steam/src/steam_dialogs.cpp
index 04be9594d7..604db1e3e2 100644
--- a/protocols/Steam/src/steam_dialogs.cpp
+++ b/protocols/Steam/src/steam_dialogs.cpp
@@ -47,6 +47,8 @@ CSteamGuardDialog::CSteamGuardDialog(CSteamProto *proto, const char *domain) :
bool CSteamGuardDialog::OnInitDialog()
{
+ m_proto->m_hwndGuard = m_hwnd;
+
char iconName[100];
mir_snprintf(iconName, "%s_%s", MODULE, "main");
Window_SetIcon_IcoLib(m_hwnd, IcoLib_GetIconHandle(iconName));
@@ -65,6 +67,7 @@ bool CSteamGuardDialog::OnApply()
bool CSteamGuardDialog::OnClose()
{
+ m_proto->m_hwndGuard = nullptr;
Utils_SaveWindowPosition(m_hwnd, NULL, m_proto->m_szModuleName, "GuardWindow");
return true;
}
diff --git a/protocols/Steam/src/steam_login.cpp b/protocols/Steam/src/steam_login.cpp
index 80dee8a4f3..a0d716aa3f 100644
--- a/protocols/Steam/src/steam_login.cpp
+++ b/protocols/Steam/src/steam_login.cpp
@@ -217,6 +217,9 @@ void CSteamProto::OnAuthorizationError(const JSONNode &root)
if (domain.find("://") == std::string::npos)
domain = "http://" + domain;
+ if (m_hwndGuard != nullptr)
+ return;
+
CSteamGuardDialog guardDialog(this, domain.c_str());
if (guardDialog.DoModal() != DIALOG_RESULT_OK) {
DeleteAuthSettings();
diff --git a/protocols/Steam/src/steam_proto.h b/protocols/Steam/src/steam_proto.h
index 2fe4b12f36..3df953c975 100644
--- a/protocols/Steam/src/steam_proto.h
+++ b/protocols/Steam/src/steam_proto.h
@@ -51,9 +51,38 @@ struct RequestQueueItem
class CSteamProto : public PROTO<CSteamProto>
{
- friend CSteamPasswordEditor;
- friend CSteamOptionsMain;
- friend CSteamOptionsBlockList;
+ friend class CSteamGuardDialog;
+ friend class CSteamPasswordEditor;
+ friend class CSteamOptionsMain;
+ friend class CSteamOptionsBlockList;
+
+ ptrW m_password;
+ ptrW m_defaultGroup;
+ bool isLoginAgain;
+ time_t m_idleTS;
+ HWND m_hwndGuard;
+
+ // requests
+ bool m_isTerminated;
+ mir_cs m_requestQueueLock;
+ HANDLE m_hRequestsQueueEvent;
+ HANDLE m_hRequestQueueThread;
+ LIST<RequestQueueItem> m_requestQueue;
+
+ // pooling
+ HANDLE m_hPollingThread;
+ ULONG hAuthProcess;
+ ULONG hMessageProcess;
+ mir_cs m_addContactLock;
+ mir_cs m_setStatusLock;
+ std::map<HANDLE, time_t> m_mpOutMessages;
+ std::map<std::string, time_t> m_typingTimestamps;
+
+ /**
+ * Used only to compare in steam_history.cpp, others should write such value directly to db profile, because PollingThread
+ * may start sooner than steam_history requests so it could possibly break getting history messages from server
+ */
+ time_t m_lastMessageTS;
public:
// PROTO_INTERFACE
@@ -87,31 +116,6 @@ public:
static void InitMenus();
protected:
- ptrW m_password;
- ptrW m_defaultGroup;
- bool isLoginAgain;
- time_t m_idleTS;
- // requests
- bool m_isTerminated;
- mir_cs m_requestQueueLock;
- HANDLE m_hRequestsQueueEvent;
- HANDLE m_hRequestQueueThread;
- LIST<RequestQueueItem> m_requestQueue;
- // pooling
- HANDLE m_hPollingThread;
- ULONG hAuthProcess;
- ULONG hMessageProcess;
- mir_cs m_addContactLock;
- mir_cs m_setStatusLock;
- std::map<HANDLE, time_t> m_mpOutMessages;
- std::map<std::string, time_t> m_typingTimestamps;
-
- /**
- * Used only to compare in steam_history.cpp, others should write such value directly to db profile, because PollingThread
- * may start sooner than steam_history requests so it could possibly break getting history messages from server
- */
- time_t m_lastMessageTS;
-
// requests
void SendRequest(HttpRequest *request);
void SendRequest(HttpRequest *request, HttpCallback callback, void *param = nullptr);