From cc0cde8d87358738bcad304e8bdc9c944d55cdaa Mon Sep 17 00:00:00 2001 From: George Hazan Date: Mon, 3 Oct 2022 20:00:41 +0300 Subject: WhatsApp: - nick name added to all options dialogs; - added error popups; --- protocols/WhatsAppWeb/src/proto.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'protocols/WhatsAppWeb/src/proto.cpp') diff --git a/protocols/WhatsAppWeb/src/proto.cpp b/protocols/WhatsAppWeb/src/proto.cpp index c29a7d60d9..1aa6117446 100644 --- a/protocols/WhatsAppWeb/src/proto.cpp +++ b/protocols/WhatsAppWeb/src/proto.cpp @@ -36,7 +36,9 @@ WhatsAppProto::WhatsAppProto(const char *proto_name, const wchar_t *username) : m_arOwnMsgs(1, CompareOwnMsgs), m_arPersistent(1), m_arPacketQueue(10), + m_wszNick(this, "Nick"), m_wszDefaultGroup(this, "DefaultGroup", L"WhatsApp"), + m_bUsePopups(this, "UsePopups", true), m_bHideGroupchats(this, "HideChats", true) { db_set_resident(m_szModuleName, "StatusMsg"); @@ -50,6 +52,7 @@ WhatsAppProto::WhatsAppProto(const char *proto_name, const wchar_t *username) : HookProtoEvent(ME_OPT_INITIALISE, &WhatsAppProto::OnOptionsInit); + InitPopups(); InitPersistentHandlers(); // Create standard network connection @@ -136,8 +139,12 @@ int WhatsAppProto::SetStatus(int new_status) if (m_iDesiredStatus == new_status) return 0; + if (!mir_wstrlen(m_wszNick)) { + Popup(0, LPGENW("You need to specify nick name in the Options dialog"), LPGENW("Error")); + return 0; + } + int oldStatus = m_iStatus; - debugLogA("===== Beginning SetStatus process"); // Routing statuses not supported by WhatsApp switch (new_status) { -- cgit v1.2.3