summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2020-05-04 17:41:41 +0300
committerGeorge Hazan <ghazan@miranda.im>2020-05-04 17:41:41 +0300
commit82aa9dbec84f664174e760fbe3e4f97932bb8ee6 (patch)
treec6a30d4003cfa0ec6da733aa36ae1e8ddbcf6378 /plugins
parent39e19d52920d404fe6e6ff6bce8959657570a667 (diff)
fixes #2384 (NewStory: у многих контактов в time tree есть 1970 год) + code cleaning
Diffstat (limited to 'plugins')
-rw-r--r--plugins/NewStory/src/history.cpp13
1 files changed, 6 insertions, 7 deletions
diff --git a/plugins/NewStory/src/history.cpp b/plugins/NewStory/src/history.cpp
index 6f5cab65bd..e1aefa08eb 100644
--- a/plugins/NewStory/src/history.cpp
+++ b/plugins/NewStory/src/history.cpp
@@ -346,8 +346,10 @@ class CHistoryDlg : public CDlgBase
int CurYear = 0, CurMonth = 0, CurDay = 0, PrevYear = -1, PrevMonth = -1, PrevDay = -1;
HTREEITEM hCurYear = 0, hCurMonth = 0, hCurDay = 0;
- for (int i=0; i < numItems; i++) {
+ for (int i = 0; i < numItems; i++) {
auto *pItem = pArray->get(i, true);
+ if (pItem->dbe.timestamp == 0)
+ continue;
struct tm ts = { 0 };
time_t timestamp = pItem->dbe.timestamp;
@@ -362,24 +364,21 @@ class CHistoryDlg : public CDlgBase
TVINSERTSTRUCT tvi;
tvi.hParent = nullptr;
tvi.item.mask = TVIF_TEXT | TVIF_PARAM;
- if (CurYear != PrevYear)
- {
+ if (CurYear != PrevYear) {
_itow(CurYear, buf, 10);
tvi.item.pszText = buf;
tvi.item.lParam = 0;
hCurYear = TreeView_InsertItem(m_timeTree.GetHwnd(), &tvi);
PrevYear = CurYear;
}
- if (CurMonth != PrevMonth)
- {
+ if (CurMonth != PrevMonth) {
tvi.hParent = hCurYear;
tvi.item.pszText = TranslateW(months[CurMonth - 1]);
tvi.item.lParam = CurMonth;
hCurMonth = TreeView_InsertItem(m_timeTree.GetHwnd(), &tvi);
PrevMonth = CurMonth;
}
- if (CurDay != PrevDay)
- {
+ if (CurDay != PrevDay) {
_itow(CurDay, buf, 10);
tvi.hParent = hCurMonth;
tvi.item.pszText = buf;