diff options
author | George Hazan <george.hazan@gmail.com> | 2024-10-15 20:00:52 +0300 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2024-10-15 20:00:52 +0300 |
commit | 47b79689fcbe77ab19eb577487ef70642fa291f7 (patch) | |
tree | 0a3b3c0679346ff1d49f6f7f898f71001459de47 /plugins/NewStory/src/history_array.cpp | |
parent | b210af86bcfb49c791ef8f74f0791ff6d36763bd (diff) |
fixes #4720 (NewStory: встроить функциональность MessageState)
Diffstat (limited to 'plugins/NewStory/src/history_array.cpp')
-rw-r--r-- | plugins/NewStory/src/history_array.cpp | 38 |
1 files changed, 20 insertions, 18 deletions
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)
|