From 822419030c568b40e8a7921232f74a1ecfd749ce Mon Sep 17 00:00:00 2001 From: George Hazan Date: Mon, 9 Feb 2015 20:32:09 +0000 Subject: small fix for the subject changing logic git-svn-id: http://svn.miranda-ng.org/main/trunk@12074 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/WhatsApp/src/chat.cpp | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) (limited to 'protocols/WhatsApp/src/chat.cpp') diff --git a/protocols/WhatsApp/src/chat.cpp b/protocols/WhatsApp/src/chat.cpp index 7c78a1d5c4..28c20c80e8 100644 --- a/protocols/WhatsApp/src/chat.cpp +++ b/protocols/WhatsApp/src/chat.cpp @@ -400,20 +400,21 @@ void WhatsAppProto::onGroupNewSubject(const std::string &gjid, const std::string return; ptrT tszText(str2t(newSubject)); - ptrT tszTextDb(getTStringA(pInfo->hContact, "Nick")); - ptrT tszUID(str2t(author)); - ptrT tszNick(GetChatUserNick(author)); + ptrT tszTextDb(getTStringA(pInfo->hContact, "Topic")); + if (mir_tstrcmp(tszText, tszTextDb)) { // notify about subject change only if differs from the stored one + ptrT tszUID(str2t(author)); + ptrT tszNick(GetChatUserNick(author)); - GCDEST gcd = { m_szModuleName, pInfo->tszJid, GC_EVENT_TOPIC }; + GCDEST gcd = { m_szModuleName, pInfo->tszJid, GC_EVENT_TOPIC }; - GCEVENT gce = { sizeof(gce), &gcd }; - if (!mir_tstrcmp(tszText, tszTextDb)) // notify about subject change only if differs from the stored one - gce.dwFlags = GCEF_NOTNOTIFY; - gce.ptszUID = tszUID; - gce.ptszNick = tszNick; - gce.time = ts; - gce.ptszText = tszText; - CallServiceSync(MS_GC_EVENT, NULL, (LPARAM)&gce); + GCEVENT gce = { sizeof(gce), &gcd }; + gce.dwFlags = 0; + gce.ptszUID = tszUID; + gce.ptszNick = tszNick; + gce.time = ts; + gce.ptszText = tszText; + CallServiceSync(MS_GC_EVENT, NULL, (LPARAM)&gce); + } setTString(pInfo->hContact, "Nick", tszText); } -- cgit v1.2.3