diff options
author | George Hazan <ghazan@miranda.im> | 2023-02-27 21:19:03 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2023-02-27 21:19:03 +0300 |
commit | bf0e8f091cc5713fb4794723b398f1c4dfe0f7df (patch) | |
tree | 2a240daa9ddf6d80527da60de9be4bf2152e9b04 | |
parent | 6ad24e68ed6f8917322057137e5abd34a4bcf58f (diff) |
fixes #3216 completely
-rw-r--r-- | plugins/WhenWasIt/src/dlg_handlers.cpp | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/plugins/WhenWasIt/src/dlg_handlers.cpp b/plugins/WhenWasIt/src/dlg_handlers.cpp index 156f5b96f7..1c73ee9e8a 100644 --- a/plugins/WhenWasIt/src/dlg_handlers.cpp +++ b/plugins/WhenWasIt/src/dlg_handlers.cpp @@ -162,23 +162,27 @@ class CBirthdaysDlg : public CBasicListDlg int year = 0, month = 0, day = 0;
GetContactDOB(hContact, year, month, day, iModule);
- if (bShowAll || IsDOBValid(year, month, day)) {
- lastColumn = -1; //list isn't sorted anymore
+ if (!IsDOBValid(year, month, day))
+ return res;
+
+ PROTOACCOUNT *pAcc = Proto_GetContactAccount(hContact);
+ if (pAcc == nullptr)
+ return res;
+
+ if (bShowAll || pAcc->IsEnabled()) {
+ lastColumn = -1; // list isn't sorted anymore
int dtb = DaysToBirthday(Today(), year, month, day);
int age = GetContactAge(year, month, day);
- PROTOACCOUNT *pAcc = Proto_GetContactAccount(hContact);
- wchar_t *ptszAccName = (pAcc == nullptr) ? TranslateT("Unknown") : pAcc->tszAccountName;
-
if (bAdd) {
LVITEM item = {};
item.mask = LVIF_TEXT | LVIF_PARAM;
item.iItem = entry;
item.lParam = (iModule == DOB_PROTOCOL) ? hContact : -hContact;
- item.pszText = ptszAccName;
+ item.pszText = pAcc->tszAccountName;
m_list.InsertItem(&item);
}
- else m_list.SetItemText(entry, 0, ptszAccName);
+ else m_list.SetItemText(entry, 0, pAcc->tszAccountName);
m_list.SetItemText(entry, 1, Clist_GetContactDisplayName(hContact));
|