From 559dbc7b53b097c0beb326bf82302aaed6cfa0a8 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sun, 31 Jul 2022 20:07:18 +0300 Subject: =?UTF-8?q?fixes=20#3130=20(WhenWasIt=20=D0=B2=D0=B5=D0=B4=D1=91?= =?UTF-8?q?=D1=82=20=D1=81=D0=B5=D0=B1=D1=8F=20=D1=81=D1=82=D1=80=D0=B0?= =?UTF-8?q?=D0=BD=D0=BD=D0=BE)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugins/UserInfoEx/src/classMAnnivDate.cpp | 19 +++---------------- 1 file changed, 3 insertions(+), 16 deletions(-) (limited to 'plugins/UserInfoEx/src/classMAnnivDate.cpp') diff --git a/plugins/UserInfoEx/src/classMAnnivDate.cpp b/plugins/UserInfoEx/src/classMAnnivDate.cpp index 940ddcda6c..c237fbb343 100644 --- a/plugins/UserInfoEx/src/classMAnnivDate.cpp +++ b/plugins/UserInfoEx/src/classMAnnivDate.cpp @@ -468,9 +468,7 @@ int MAnnivDate::DBGetBirthDate(MCONTACT hContact, LPSTR pszProto) Clear(); // try to get birthday from any custom module - if ( !DBGetDate(hContact, USERINFO, SET_CONTACT_BIRTHDAY, SET_CONTACT_BIRTHMONTH, SET_CONTACT_BIRTHYEAR) || - !DBGetDate(hContact, SET_CONTACT_BIRTHDAY, SET_CONTACT_BIRTHDAY, SET_CONTACT_BIRTHMONTH, SET_CONTACT_BIRTHYEAR) || - !DBGetDate(hContact, USERINFO, SET_CONTACT_DOBD, SET_CONTACT_DOBM, SET_CONTACT_DOBY)) + if (!DBGetDate(hContact, USERINFO, SET_CONTACT_BIRTHDAY, SET_CONTACT_BIRTHMONTH, SET_CONTACT_BIRTHYEAR)) { SetFlags(MADF_HASCUSTOM); } @@ -528,20 +526,9 @@ int MAnnivDate::DBGetBirthDate(MCONTACT hContact, LPSTR pszProto) int MAnnivDate::DBWriteBirthDate(MCONTACT hContact) { int rc = DBWriteDate(hContact, USERINFO, SET_CONTACT_BIRTHDAY, SET_CONTACT_BIRTHMONTH, SET_CONTACT_BIRTHYEAR); - if (!rc) { - if ( - // only delete values from current contact's custom modules - !(_wFlags & (MADF_HASPROTO|MADF_HASMETA)) && - // check whether user wants this feature - g_plugin.getByte(SET_REMIND_SECUREBIRTHDAY, TRUE)) - { - // keep the database clean - DBDeleteDate(hContact, SET_CONTACT_BIRTHDAY, SET_CONTACT_BIRTHDAY, SET_CONTACT_BIRTHMONTH, SET_CONTACT_BIRTHYEAR); - DBDeleteDate(hContact, USERINFO, SET_CONTACT_DOBD, SET_CONTACT_DOBM, SET_CONTACT_DOBY); - } - + if (!rc) rc = db_set_w(hContact, USERINFO, SET_CONTACT_AGE, Age()); - } + return rc; } -- cgit v1.2.3