From 612e58d77fbd2e66d456ec8a942d1b725de86d14 Mon Sep 17 00:00:00 2001 From: Sergey Bolhovskoy Date: Mon, 22 Dec 2014 09:54:53 +0000 Subject: 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 --- plugins/UserInfoEx/src/svc_reminder.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'plugins/UserInfoEx/src') 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); } -- cgit v1.2.3