From 47b79689fcbe77ab19eb577487ef70642fa291f7 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Tue, 15 Oct 2024 20:00:52 +0300 Subject: =?UTF-8?q?fixes=20#4720=20(NewStory:=20=D0=B2=D1=81=D1=82=D1=80?= =?UTF-8?q?=D0=BE=D0=B8=D1=82=D1=8C=20=D1=84=D1=83=D0=BD=D0=BA=D1=86=D0=B8?= =?UTF-8?q?=D0=BE=D0=BD=D0=B0=D0=BB=D1=8C=D0=BD=D0=BE=D1=81=D1=82=D1=8C=20?= =?UTF-8?q?MessageState)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugins/NewStory/src/history_array.cpp | 38 ++++++++++++++++++---------------- 1 file changed, 20 insertions(+), 18 deletions(-) (limited to 'plugins/NewStory/src/history_array.cpp') diff --git a/plugins/NewStory/src/history_array.cpp b/plugins/NewStory/src/history_array.cpp index d4e2cf5634..b356038208 100644 --- a/plugins/NewStory/src/history_array.cpp +++ b/plugins/NewStory/src/history_array.cpp @@ -211,7 +211,7 @@ int ItemData::calcHeight(int width) xPos += 18; cx -= xPos; - if (m_bOfflineDownloaded != 0) // Download completed icon + if (m_bOfflineDownloaded != 0 || m_bDelivered || m_bRemoteRead) // Download completed icon cx -= 18; } @@ -559,7 +559,7 @@ void HistoryArray::addChatEvent(NewstoryListData *pOwner, SESSION_INFO *si, cons } } -bool HistoryArray::addEvent(NewstoryListData *pOwner, MCONTACT hContact, MEVENT hEvent, int count) +ItemData* HistoryArray::addEvent(NewstoryListData *pOwner, MCONTACT hContact, MEVENT hEvent, int count) { if (count == -1) count = MAXINT; @@ -582,27 +582,29 @@ bool HistoryArray::addEvent(NewstoryListData *pOwner, MCONTACT hContact, MEVENT pPrev = p.checkPrevGC(pPrev); } else pPrev = p.checkPrev(pPrev); + return &p; } - else { - DB::ECPTR pCursor(DB::Events(hContact, hEvent)); - for (int i = 0; i < count; i++) { - hEvent = pCursor.FetchNext(); - if (!hEvent) - break; - auto &p = allocateItem(); - p.pOwner = pOwner; - p.dbe.hContact = hContact; - p.dbe = hEvent; - if (isChat) { - checkGC(p, si); - pPrev = p.checkPrevGC(pPrev); - } - else pPrev = p.checkPrev(pPrev); + ItemData *pRet = nullptr; + DB::ECPTR pCursor(DB::Events(hContact, hEvent)); + for (int i = 0; i < count; i++) { + hEvent = pCursor.FetchNext(); + if (!hEvent) + break; + + auto &p = allocateItem(); + p.pOwner = pOwner; + p.dbe.hContact = hContact; + p.dbe = hEvent; + if (isChat) { + checkGC(p, si); + pPrev = p.checkPrevGC(pPrev); } + else pPrev = p.checkPrev(pPrev); + pRet = &p; } - return true; + return pRet; } void HistoryArray::addNick(ItemData &pItem, wchar_t *pwszNick) -- cgit v1.2.3