From c9ad04d06a3dcbb59a79e4b9af07b5a57417025c Mon Sep 17 00:00:00 2001 From: George Hazan Date: Wed, 11 Feb 2015 21:24:46 +0000 Subject: fix for converting old wassup chats into the new ones git-svn-id: http://svn.miranda-ng.org/main/trunk@12090 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/WhatsApp/src/chat.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/protocols/WhatsApp/src/chat.cpp b/protocols/WhatsApp/src/chat.cpp index c3c4fbb0f4..0ac289edff 100644 --- a/protocols/WhatsApp/src/chat.cpp +++ b/protocols/WhatsApp/src/chat.cpp @@ -294,6 +294,13 @@ WAChatInfo* WhatsAppProto::InitChat(const std::string &jid, const std::string &n WAChatInfo *pInfo = new WAChatInfo(ptszJid, ptszNick); m_chats[jid] = pInfo; + pInfo->hContact = ContactIDToHContact(jid); + if (!isChatRoom(pInfo->hContact)) { + delSetting(pInfo->hContact, "ID"); + setByte(pInfo->hContact, "ChatRoom", 1); + setString(pInfo->hContact, "ChatRoomID", jid.c_str()); + } + GCSESSION gcw = { sizeof(GCSESSION) }; gcw.iType = GCW_CHATROOM; gcw.pszModule = m_szModuleName; @@ -301,8 +308,6 @@ WAChatInfo* WhatsAppProto::InitChat(const std::string &jid, const std::string &n gcw.ptszID = ptszJid; CallServiceSync(MS_GC_NEWSESSION, NULL, (LPARAM)&gcw); - pInfo->hContact = ContactIDToHContact(jid); - GCDEST gcd = { m_szModuleName, ptszJid, GC_EVENT_ADDGROUP }; GCEVENT gce = { sizeof(gce), &gcd }; for (int i = SIZEOF(sttStatuses) - 1; i >= 0; i--) { -- cgit v1.2.3