summaryrefslogtreecommitdiff
path: root/protocols/WhatsAppWeb
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2020-12-24 11:55:56 +0300
committerGeorge Hazan <ghazan@miranda.im>2020-12-24 11:55:56 +0300
commita3363c772c0be0d4734709d1949cc03f57957e92 (patch)
tree45cfdc58357f789e3ceee2c914419cb77a635ee6 /protocols/WhatsAppWeb
parentfd788ff3762a6dbecdbc5a7f5a367bdf3bfd9d9c (diff)
another code cleaning
Diffstat (limited to 'protocols/WhatsAppWeb')
-rw-r--r--protocols/WhatsAppWeb/WhatsAppWeb.vcxproj1
-rw-r--r--protocols/WhatsAppWeb/WhatsAppWeb.vcxproj.filters3
-rw-r--r--protocols/WhatsAppWeb/src/proto.h1
-rw-r--r--protocols/WhatsAppWeb/src/qrcode.cpp8
-rw-r--r--protocols/WhatsAppWeb/src/server.cpp5
5 files changed, 14 insertions, 4 deletions
diff --git a/protocols/WhatsAppWeb/WhatsAppWeb.vcxproj b/protocols/WhatsAppWeb/WhatsAppWeb.vcxproj
index d8e6a78e5e..ccc8d2ae3a 100644
--- a/protocols/WhatsAppWeb/WhatsAppWeb.vcxproj
+++ b/protocols/WhatsAppWeb/WhatsAppWeb.vcxproj
@@ -46,6 +46,7 @@
<ClCompile Include="src\main.cpp" />
<ClCompile Include="src\options.cpp" />
<ClCompile Include="src\proto.cpp" />
+ <ClCompile Include="src\qrcode.cpp" />
<ClCompile Include="src\server.cpp" />
<ClCompile Include="src\stdafx.cxx">
<PrecompiledHeader>Create</PrecompiledHeader>
diff --git a/protocols/WhatsAppWeb/WhatsAppWeb.vcxproj.filters b/protocols/WhatsAppWeb/WhatsAppWeb.vcxproj.filters
index b4d87bbcc5..81c15c821b 100644
--- a/protocols/WhatsAppWeb/WhatsAppWeb.vcxproj.filters
+++ b/protocols/WhatsAppWeb/WhatsAppWeb.vcxproj.filters
@@ -20,6 +20,9 @@
<ClCompile Include="src\stdafx.cxx">
<Filter>Source Files</Filter>
</ClCompile>
+ <ClCompile Include="src\qrcode.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="src\db.h">
diff --git a/protocols/WhatsAppWeb/src/proto.h b/protocols/WhatsAppWeb/src/proto.h
index ed6818f139..c502da3abb 100644
--- a/protocols/WhatsAppWeb/src/proto.h
+++ b/protocols/WhatsAppWeb/src/proto.h
@@ -45,6 +45,7 @@ class WhatsAppProto : public PROTO<WhatsAppProto>
EVP_PKEY *m_pKeys; // private & public keys
+ void CloseQrDialog();
bool ShowQrCode(const CMStringA &ref);
/// Network ////////////////////////////////////////////////////////////////////////////
diff --git a/protocols/WhatsAppWeb/src/qrcode.cpp b/protocols/WhatsAppWeb/src/qrcode.cpp
index f876052e87..ca77dd64fb 100644
--- a/protocols/WhatsAppWeb/src/qrcode.cpp
+++ b/protocols/WhatsAppWeb/src/qrcode.cpp
@@ -101,6 +101,14 @@ static INT_PTR __stdcall sttShowDialog(void *param)
/////////////////////////////////////////////////////////////////////////////////////////
+void WhatsAppProto::CloseQrDialog()
+{
+ if (m_pQRDlg) {
+ m_pQRDlg->Close();
+ m_pQRDlg = nullptr;
+ }
+}
+
bool WhatsAppProto::ShowQrCode(const CMStringA &ref)
{
MBinBuffer pubKey;
diff --git a/protocols/WhatsAppWeb/src/server.cpp b/protocols/WhatsAppWeb/src/server.cpp
index 2f062b15e8..8659e85a16 100644
--- a/protocols/WhatsAppWeb/src/server.cpp
+++ b/protocols/WhatsAppWeb/src/server.cpp
@@ -418,10 +418,7 @@ void WhatsAppProto::ProcessCmd(const JSONNode &root)
void WhatsAppProto::ProcessConn(const JSONNode &root)
{
- if (m_pQRDlg) {
- m_pQRDlg->Close();
- m_pQRDlg = nullptr;
- }
+ CloseQrDialog();
m_szJid = root["wid"].as_mstring();
setString(DBKEY_ID, m_szJid);