diff options
-rw-r--r-- | protocols/WhatsApp/src/chat.cpp | 9 |
1 files 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--) {
|