diff options
-rw-r--r-- | plugins/NewStory/src/history_array.cpp | 20 | ||||
-rw-r--r-- | plugins/NewStory/src/history_array.h | 1 | ||||
-rw-r--r-- | plugins/NewStory/src/history_control.cpp | 4 |
3 files changed, 21 insertions, 4 deletions
diff --git a/plugins/NewStory/src/history_array.cpp b/plugins/NewStory/src/history_array.cpp index 6824862726..0510a95d25 100644 --- a/plugins/NewStory/src/history_array.cpp +++ b/plugins/NewStory/src/history_array.cpp @@ -60,6 +60,19 @@ ItemData::~ItemData() MTextDestroy(data); } +bool ItemData::isEqual(const ItemData *p) const +{ + if (p->hContact != hContact) + return false; + if (p->dbe.eventType != dbe.eventType) + return false; + if ((p->dbe.flags & DBEF_SENT) != (dbe.flags & DBEF_SENT)) + return false; + if (p->dbe.timestamp / 86400 != dbe.timestamp / 86400) + return false; + return true; +} + ItemData* ItemData::checkPrev(ItemData *pPrev) { m_grouping = GROUPING_NONE; @@ -73,9 +86,12 @@ ItemData* ItemData::checkPrev(ItemData *pPrev) if (dbe.eventType != EVENTTYPE_MESSAGE) return this; - if (pPrev->hContact == hContact && pPrev->dbe.eventType == dbe.eventType && (pPrev->dbe.flags & DBEF_SENT) == (dbe.flags & DBEF_SENT)) { - if (pPrev->m_grouping != GROUPING_ITEM) + if (isEqual(pPrev)) { + if (pPrev->m_grouping == GROUPING_NONE) { pPrev->m_grouping = GROUPING_HEAD; + if (pPrev->m_bLoaded) + pPrev->setText(); + } m_grouping = GROUPING_ITEM; } return this; diff --git a/plugins/NewStory/src/history_array.h b/plugins/NewStory/src/history_array.h index 804ebebeb2..5ca180ff82 100644 --- a/plugins/NewStory/src/history_array.h +++ b/plugins/NewStory/src/history_array.h @@ -35,6 +35,7 @@ struct ItemData void setText(); void load(bool bFullLoad); + bool isEqual(const ItemData *p) const; bool isLink(POINT pt, CMStringW &url) const; bool isLinkChar(int idx) const; diff --git a/plugins/NewStory/src/history_control.cpp b/plugins/NewStory/src/history_control.cpp index 342ba3d856..5da6bc1a02 100644 --- a/plugins/NewStory/src/history_control.cpp +++ b/plugins/NewStory/src/history_control.cpp @@ -497,7 +497,7 @@ void NewstoryListData::LineUp() scrollTopPixel = 0; } FixScrollPosition(); - ScheduleDraw(); + InvalidateRect(hwnd, 0, FALSE); } void NewstoryListData::LineDown() @@ -507,7 +507,7 @@ void NewstoryListData::LineDown() scrollTopItem++; FixScrollPosition(); - ScheduleDraw(); + InvalidateRect(hwnd, 0, FALSE); } void NewstoryListData::PageUp() |