diff options
author | George Hazan <george.hazan@gmail.com> | 2023-11-30 17:00:54 +0300 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2023-11-30 17:00:54 +0300 |
commit | ee46074d500e5ea300f9bef0b979f47a8f0a0c75 (patch) | |
tree | c8e7a37887b378af2a7680b03d3dabf8cb608f84 /plugins/NewStory | |
parent | c1849a9d50be0951bc4b2a5c0f14dbde5a8340e0 (diff) |
fixes #3981 (NewStory: в групчатах входящие отображаются от имени группы)
Diffstat (limited to 'plugins/NewStory')
-rw-r--r-- | plugins/NewStory/src/history_array.cpp | 74 |
1 files changed, 38 insertions, 36 deletions
diff --git a/plugins/NewStory/src/history_array.cpp b/plugins/NewStory/src/history_array.cpp index 380b23785e..f05ac90363 100644 --- a/plugins/NewStory/src/history_array.cpp +++ b/plugins/NewStory/src/history_array.cpp @@ -464,48 +464,50 @@ void HistoryArray::addChatEvent(SESSION_INFO *si, const LOGINFO *lin) if (si == nullptr) return; - if (si->pMI->bDatabase && lin->hEvent) { - addEvent(si->hContact, lin->hEvent, 1); - return; - } - - CMStringW wszText; - bool bTextUsed = Chat_GetDefaultEventDescr(si, lin, wszText); - if (!bTextUsed && lin->ptszText) { - if (!wszText.IsEmpty()) - wszText.AppendChar(' '); - wszText.Append(g_chatApi.RemoveFormatting(lin->ptszText)); - } - int numItems = getCount(); auto &p = allocateItem(); p.hContact = si->hContact; - p.wtext = wszText.Detach(); - p.m_bLoaded = true; - p.m_bHighlighted = lin->bIsHighlighted; - p.dbe.timestamp = lin->time; - if (lin->bIsMe) - p.dbe.flags |= DBEF_SENT; - - switch (lin->iType) { - case GC_EVENT_MESSAGE: - case GC_EVENT_INFORMATION: - p.dbe.eventType = EVENTTYPE_MESSAGE; - break; - case GC_EVENT_SETCONTACTSTATUS: - p.dbe.eventType = EVENTTYPE_STATUSCHANGE; - break; + if (si->pMI->bDatabase && lin->hEvent) { + p.hEvent = lin->hEvent; + p.load(true); + } + else { + CMStringW wszText; + bool bTextUsed = Chat_GetDefaultEventDescr(si, lin, wszText); + if (!bTextUsed && lin->ptszText) { + if (!wszText.IsEmpty()) + wszText.AppendChar(' '); + wszText.Append(g_chatApi.RemoveFormatting(lin->ptszText)); + } - case GC_EVENT_JOIN: - case GC_EVENT_PART: - case GC_EVENT_QUIT: - p.dbe.eventType = EVENTTYPE_JABBER_PRESENCE; - break; + p.wtext = wszText.Detach(); + p.m_bLoaded = true; + p.m_bHighlighted = lin->bIsHighlighted; + p.dbe.timestamp = lin->time; + if (lin->bIsMe) + p.dbe.flags |= DBEF_SENT; + + switch (lin->iType) { + case GC_EVENT_MESSAGE: + case GC_EVENT_INFORMATION: + p.dbe.eventType = EVENTTYPE_MESSAGE; + break; - default: - p.dbe.eventType = EVENTTYPE_OTHER; - break; + case GC_EVENT_SETCONTACTSTATUS: + p.dbe.eventType = EVENTTYPE_STATUSCHANGE; + break; + + case GC_EVENT_JOIN: + case GC_EVENT_PART: + case GC_EVENT_QUIT: + p.dbe.eventType = EVENTTYPE_JABBER_PRESENCE; + break; + + default: + p.dbe.eventType = EVENTTYPE_OTHER; + break; + } } if (lin->ptszNick) { |