diff options
author | George Hazan <george.hazan@gmail.com> | 2014-11-29 19:35:02 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2014-11-29 19:35:02 +0000 |
commit | adeae0289c3a08d6e8fae2d2644053341bd371ab (patch) | |
tree | 816589bea007bdf0af6e5d2b2cf039de21f2ba12 /plugins/UserInfoEx/src/svc_reminder.cpp | |
parent | 7c51a5c643c99f624147bd0fb56f5c29d65fd5dc (diff) |
code cleaning
git-svn-id: http://svn.miranda-ng.org/main/trunk@11157 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/UserInfoEx/src/svc_reminder.cpp')
-rw-r--r-- | plugins/UserInfoEx/src/svc_reminder.cpp | 41 |
1 files changed, 20 insertions, 21 deletions
diff --git a/plugins/UserInfoEx/src/svc_reminder.cpp b/plugins/UserInfoEx/src/svc_reminder.cpp index 7651ec6d09..59420bba5c 100644 --- a/plugins/UserInfoEx/src/svc_reminder.cpp +++ b/plugins/UserInfoEx/src/svc_reminder.cpp @@ -388,7 +388,7 @@ static BYTE CheckAnniversaries(MCONTACT hContact, MTime &Now, CEvent &evt, BYTE BYTE bOverflow = FALSE;
WORD wDaysEarlier;
- if ((gRemindOpts.RemindState == REMIND_ANNIV) || (gRemindOpts.RemindState == REMIND_ALL)) {
+ if (gRemindOpts.RemindState == REMIND_ANNIV || gRemindOpts.RemindState == REMIND_ALL) {
for (int i = 0; i < ANID_LAST && !mta.DBGetAnniversaryDate(hContact, i); i++) {
mta.DBGetReminderOpts(hContact);
@@ -537,8 +537,7 @@ static BYTE CheckBirthday(MCONTACT hContact, MTime &Now, CEvent &evt, BYTE bNoti static void CheckContact(MCONTACT hContact, MTime &Now, CEvent &evt, BYTE bNotify, PWORD LastAnwer = 0)
{
// ignore meta subcontacts here as their birthday information are collected explicitly
- if (hContact && (!gRemindOpts.bCheckVisibleOnly || !db_get_b(hContact, MOD_CLIST, "Hidden", FALSE)) && !db_mc_isSub(hContact))
- {
+ if (hContact && (!gRemindOpts.bCheckVisibleOnly || !db_get_b(hContact, MOD_CLIST, "Hidden", FALSE)) && !db_mc_isSub(hContact)) {
CEvent ca;
if (CheckBirthday(hContact, Now, ca, bNotify, LastAnwer) || CheckAnniversaries(hContact, Now, ca, bNotify)) {
@@ -560,30 +559,30 @@ static void CheckContact(MCONTACT hContact, MTime &Now, CEvent &evt, BYTE bNotif void SvcReminderCheckAll(const ENotify notify)
{
- if (gRemindOpts.RemindState != REMIND_OFF) {
- CEvent evt;
- MTime now;
- WORD a1 = 0;
+ if (gRemindOpts.RemindState == REMIND_OFF)
+ return;
- now.GetLocalTime();
+ MTime now;
+ now.GetLocalTime();
- //walk through all the contacts stored in the DB
- for (MCONTACT hContact = db_find_first(); hContact != NULL; hContact = db_find_next(hContact))
- CheckContact(hContact, now, evt, notify != NOTIFY_CLIST, &a1);
+ // walk through all the contacts stored in the DB
+ CEvent evt;
+ WORD a1 = 0;
+ for (MCONTACT hContact = db_find_first(); hContact != NULL; hContact = db_find_next(hContact))
+ CheckContact(hContact, now, evt, notify != NOTIFY_CLIST, &a1);
- if (notify != NOTIFY_CLIST) {
- // play sound for the next anniversary
- NotifyWithSound(evt);
+ if (notify != NOTIFY_CLIST) {
+ // play sound for the next anniversary
+ NotifyWithSound(evt);
- // popup anniversary list
- if (db_get_b(NULL, MODNAME, SET_ANNIVLIST_POPUP, FALSE))
- DlgAnniversaryListShow(0, 0);
+ // popup anniversary list
+ if (db_get_b(NULL, MODNAME, SET_ANNIVLIST_POPUP, FALSE))
+ DlgAnniversaryListShow(0, 0);
- if (evt._wDaysLeft > gRemindOpts.wDaysEarlier && notify == NOTIFY_NOANNIV)
- NotifyWithPopup(NULL, CEvent::NONE, 0, NULL, TranslateT("No anniversaries to remind of"));
- }
- UpdateTimer(FALSE);
+ if (evt._wDaysLeft > gRemindOpts.wDaysEarlier && notify == NOTIFY_NOANNIV)
+ NotifyWithPopup(NULL, CEvent::NONE, 0, NULL, TranslateT("No anniversaries to remind of"));
}
+ UpdateTimer(FALSE);
}
/***********************************************************************************************************
|