summaryrefslogtreecommitdiff
path: root/protocols
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2022-10-30 19:33:08 +0300
committerGeorge Hazan <ghazan@miranda.im>2022-10-30 19:33:08 +0300
commit8e1d8f637c18e003da31db3144c5dcff261f0f0b (patch)
tree8b85916acd6a177199c66d81c1196178de05ddaa /protocols
parent7efa6ec72313264d94a79ba71216bf0ac8aadc15 (diff)
fixes #3220 (WhatsApp: закрытое окно с QR-кодом недоступно до переподключения)
Diffstat (limited to 'protocols')
-rw-r--r--protocols/WhatsApp/src/proto.h1
-rw-r--r--protocols/WhatsApp/src/qrcode.cpp11
2 files changed, 12 insertions, 0 deletions
diff --git a/protocols/WhatsApp/src/proto.h b/protocols/WhatsApp/src/proto.h
index 1d17a1ed27..a11c992768 100644
--- a/protocols/WhatsApp/src/proto.h
+++ b/protocols/WhatsApp/src/proto.h
@@ -212,6 +212,7 @@ public:
class WhatsAppProto : public PROTO<WhatsAppProto>
{
friend class WANoise;
+ friend class CWhatsAppQRDlg;
class CWhatsAppProtoImpl
{
diff --git a/protocols/WhatsApp/src/qrcode.cpp b/protocols/WhatsApp/src/qrcode.cpp
index f38ef2f286..1cdc797916 100644
--- a/protocols/WhatsApp/src/qrcode.cpp
+++ b/protocols/WhatsApp/src/qrcode.cpp
@@ -14,6 +14,17 @@ public:
CProtoDlgBase<WhatsAppProto>(ppro, IDD_SHOWQR)
{}
+ void OnDestroy() override
+ {
+ if (!m_bSucceeded)
+ m_proto->ShutdownSession();
+ }
+
+ void SetSuccess()
+ {
+ m_bSucceeded = true;
+ }
+
void SetData(const CMStringA &str)
{
auto *pQR = QRcode_encodeString(str, 0, QR_ECLEVEL_L, QR_MODE_8, 1);