From 45bf5f51cc788cb8f19e1b8fcd5b8818dc7a2e00 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Mon, 25 Feb 2019 21:02:11 +0300 Subject: GCEVENT::GCEF_UTF8 - flag for direct communication with utf8-encoded chat events (UTF16LE by default) --- protocols/ICQ-WIM/src/groupchats.cpp | 16 +++++++++------- protocols/ICQ-WIM/src/server.cpp | 7 ++++--- 2 files changed, 13 insertions(+), 10 deletions(-) (limited to 'protocols/ICQ-WIM/src') diff --git a/protocols/ICQ-WIM/src/groupchats.cpp b/protocols/ICQ-WIM/src/groupchats.cpp index 7d61b15407..5f5854b6b6 100644 --- a/protocols/ICQ-WIM/src/groupchats.cpp +++ b/protocols/ICQ-WIM/src/groupchats.cpp @@ -35,13 +35,14 @@ void CIcqProto::LoadChatInfo(SESSION_INFO *si) CMStringW role((*node)["role"].as_mstring()); CMStringW sn((*node)["sn"].as_mstring()); - GCEVENT gce = { m_szModuleName, si->ptszID, GC_EVENT_JOIN }; + GCEVENT gce = { m_szModuleName, 0, GC_EVENT_JOIN }; gce.dwFlags = GCEF_SILENT; - gce.ptszNick = nick; - gce.ptszUID = sn; + gce.pszID.w = si->ptszID; + gce.pszNick.w = nick; + gce.pszUID.w = sn; gce.time = ::time(0); gce.bIsMe = sn == m_szOwnId; - gce.ptszStatus = TranslateW(role); + gce.pszStatus.w = TranslateW(role); Chat_Event(&gce); json_delete(node); @@ -279,7 +280,8 @@ void CIcqProto::ProcessGroupChat(const JSONNode &ev) continue; CMStringW method(it["method"].as_mstring()); - GCEVENT gce = { m_szModuleName, si->ptszID, (method == "add_members") ? GC_EVENT_JOIN : GC_EVENT_PART }; + GCEVENT gce = { m_szModuleName, 0, (method == "add_members") ? GC_EVENT_JOIN : GC_EVENT_PART }; + gce.pszID.w = si->ptszID; int iStart = 0; CMStringW members(it["members"].as_mstring()); @@ -292,8 +294,8 @@ void CIcqProto::ProcessGroupChat(const JSONNode &ev) if (pCache == nullptr) continue; - gce.ptszNick = Clist_GetContactDisplayName(pCache->m_hContact); - gce.ptszUID = member; + gce.pszNick.w = Clist_GetContactDisplayName(pCache->m_hContact); + gce.pszUID.w = member; gce.time = ::time(0); gce.bIsMe = member == m_szOwnId; Chat_Event(&gce); diff --git a/protocols/ICQ-WIM/src/server.cpp b/protocols/ICQ-WIM/src/server.cpp index b086a9bd53..6567e8a390 100644 --- a/protocols/ICQ-WIM/src/server.cpp +++ b/protocols/ICQ-WIM/src/server.cpp @@ -351,10 +351,11 @@ void CIcqProto::ParseMessage(MCONTACT hContact, __int64 &lastMsgId, const JSONNo CMStringW wszSender(it["chat"]["sender"].as_mstring()); CMStringW wszChatId(getMStringW(hContact, "ChatRoomID")); - GCEVENT gce = { m_szModuleName, wszChatId, GC_EVENT_MESSAGE }; + GCEVENT gce = { m_szModuleName, 0, GC_EVENT_MESSAGE }; + gce.pszID.w = wszChatId; gce.dwFlags = GCEF_ADDTOLOG; - gce.ptszUID = wszSender; - gce.ptszText = wszText; + gce.pszUID.w = wszSender; + gce.pszText.w = wszText; gce.time = iMsgTime; gce.bIsMe = wszSender == m_szOwnId; Chat_Event(&gce); -- cgit v1.2.3