summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Bolhovskoy <elzorfox@ya.ru>2014-12-22 09:54:53 +0000
committerSergey Bolhovskoy <elzorfox@ya.ru>2014-12-22 09:54:53 +0000
commit612e58d77fbd2e66d456ec8a942d1b725de86d14 (patch)
treeb38bf1c6294babdaf7367eaf939523b1838579e3
parentbc8396728b4b500e7349d84bc58b9ee300d592df (diff)
UserInfoEx: no messages with years when year not set
git-svn-id: http://svn.miranda-ng.org/main/trunk@11576 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
-rw-r--r--plugins/UserInfoEx/src/svc_reminder.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/plugins/UserInfoEx/src/svc_reminder.cpp b/plugins/UserInfoEx/src/svc_reminder.cpp
index a5b04fc55b..f8633d1622 100644
--- a/plugins/UserInfoEx/src/svc_reminder.cpp
+++ b/plugins/UserInfoEx/src/svc_reminder.cpp
@@ -508,9 +508,11 @@ static BYTE CheckBirthday(MCONTACT hContact, MTime &Now, CEvent &evt, BYTE bNoti
default:
cchMsg = mir_sntprintf(szMsg, SIZEOF(szMsg), TranslateT("%s has birthday in %d days."), DB::Contact::DisplayName(hContact), Diff);
}
- mir_sntprintf(szMsg + cchMsg, SIZEOF(szMsg) - cchMsg,
- TranslateT("\n%s becomes %d years old."),
- ContactGender(hContact), mtb.Age(&Now) + (Diff > 0));
+ int age = mtb.Age(&Now);
+ if (age > 0)
+ mir_sntprintf(szMsg + cchMsg, SIZEOF(szMsg) - cchMsg,
+ TranslateT("\n%s becomes %d years old."),
+ ContactGender(hContact), age + (Diff > 0));
NotifyWithPopup(hContact, CEvent::BIRTHDAY, Diff, mtb.Description(), szMsg);
}