diff options
author | George Hazan <ghazan@miranda.im> | 2022-01-30 18:39:25 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2022-01-30 18:39:25 +0300 |
commit | 1c008b3bda59815fbe9e690826accfb043b27c07 (patch) | |
tree | 2b0660358ddde07b8397c04a996e4099715602cf /plugins/UserInfoEx/src | |
parent | bd5c44b8596067d5fffbd253ec9f5399dbd72339 (diff) |
fixes #3001 (WhenWasIt: remove mBirthday support)
Diffstat (limited to 'plugins/UserInfoEx/src')
-rw-r--r-- | plugins/UserInfoEx/src/classMAnnivDate.cpp | 52 | ||||
-rw-r--r-- | plugins/UserInfoEx/src/classMAnnivDate.h | 64 | ||||
-rw-r--r-- | plugins/UserInfoEx/src/ctrl_annivedit.cpp | 2 | ||||
-rw-r--r-- | plugins/UserInfoEx/src/dlg_anniversarylist.cpp | 15 | ||||
-rw-r--r-- | plugins/UserInfoEx/src/dlg_propsheet.cpp | 2 | ||||
-rw-r--r-- | plugins/UserInfoEx/src/ex_import/classExImContactXML.cpp | 1 | ||||
-rw-r--r-- | plugins/UserInfoEx/src/ex_import/dlg_ExImModules.cpp | 13 | ||||
-rw-r--r-- | plugins/UserInfoEx/src/ex_import/svc_ExImVCF.cpp | 6 | ||||
-rw-r--r-- | plugins/UserInfoEx/src/psp_options.cpp | 28 | ||||
-rw-r--r-- | plugins/UserInfoEx/src/resource.h | 2 | ||||
-rw-r--r-- | plugins/UserInfoEx/src/svc_constants.h | 1 | ||||
-rw-r--r-- | plugins/UserInfoEx/src/svc_reminder.cpp | 15 | ||||
-rw-r--r-- | plugins/UserInfoEx/src/svc_reminder.h | 100 | ||||
-rw-r--r-- | plugins/UserInfoEx/src/version.h | 2 |
14 files changed, 109 insertions, 194 deletions
diff --git a/plugins/UserInfoEx/src/classMAnnivDate.cpp b/plugins/UserInfoEx/src/classMAnnivDate.cpp index 462b7ee500..b1c4a8f9ee 100644 --- a/plugins/UserInfoEx/src/classMAnnivDate.cpp +++ b/plugins/UserInfoEx/src/classMAnnivDate.cpp @@ -469,7 +469,6 @@ int MAnnivDate::DBGetBirthDate(MCONTACT hContact, LPSTR pszProto) // try to get birthday from any custom module
if ( !DBGetDate(hContact, USERINFO, SET_CONTACT_BIRTHDAY, SET_CONTACT_BIRTHMONTH, SET_CONTACT_BIRTHYEAR) ||
- !DBGetDate(hContact, MOD_MBIRTHDAY, 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))
{
@@ -518,42 +517,6 @@ int MAnnivDate::DBGetBirthDate(MCONTACT hContact, LPSTR pszProto) }
/**
- * name: DBMoveBirthDate
- * class: MAnnivDate
- * desc: keep the database clean
- * param: hContact - handle to a contact to read the date from
- * bOld - byte RemindBirthModule src
- * bNew - byte RemindBirthModule dest
- * return: 0 on success, 1 otherwise
- **/
-
-int MAnnivDate::DBMoveBirthDate(MCONTACT hContact, uint8_t bOld, uint8_t)
-{
- Clear();
- switch(bOld) {
- case 0: //MOD_MBIRTHDAY
- if (!DBGetDate(hContact, MOD_MBIRTHDAY, SET_CONTACT_BIRTHDAY, SET_CONTACT_BIRTHMONTH, SET_CONTACT_BIRTHYEAR)) {
- if (DBWriteDate(hContact, USERINFO, SET_CONTACT_BIRTHDAY, SET_CONTACT_BIRTHMONTH, SET_CONTACT_BIRTHYEAR))
- return 1;
- DBDeleteDate(hContact, MOD_MBIRTHDAY, SET_CONTACT_BIRTHDAY, SET_CONTACT_BIRTHMONTH, SET_CONTACT_BIRTHYEAR);
- db_unset(hContact, MOD_MBIRTHDAY, "BirthMode");
- }
- break;
- case 1: //USERINFO
- if (!DBGetDate(hContact, USERINFO, SET_CONTACT_BIRTHDAY, SET_CONTACT_BIRTHMONTH, SET_CONTACT_BIRTHYEAR)) {
- if (DBWriteDate(hContact, MOD_MBIRTHDAY, SET_CONTACT_BIRTHDAY, SET_CONTACT_BIRTHMONTH, SET_CONTACT_BIRTHYEAR))
- return 1;
- db_set_b(hContact, MOD_MBIRTHDAY, "BirthMode", 2);
- DBDeleteDate(hContact, USERINFO, SET_CONTACT_BIRTHDAY, SET_CONTACT_BIRTHMONTH, SET_CONTACT_BIRTHYEAR);
- }
- break;
- default:
- return 1;
- }
- return 0;
-}
-
-/**
* name: DBWriteBirthDate
* class: MAnnivDate
* desc: write birthday date to desired module
@@ -564,13 +527,8 @@ int MAnnivDate::DBMoveBirthDate(MCONTACT hContact, uint8_t bOld, uint8_t) int MAnnivDate::DBWriteBirthDate(MCONTACT hContact)
{
- LPCSTR pszModule = SvcReminderGetMyBirthdayModule();
-
- int rc = DBWriteDate(hContact, pszModule, SET_CONTACT_BIRTHDAY, SET_CONTACT_BIRTHMONTH, SET_CONTACT_BIRTHYEAR);
+ int rc = DBWriteDate(hContact, USERINFO, SET_CONTACT_BIRTHDAY, SET_CONTACT_BIRTHMONTH, SET_CONTACT_BIRTHYEAR);
if (!rc) {
- if (!mir_strcmp(pszModule, MOD_MBIRTHDAY))
- db_set_b(hContact, MOD_MBIRTHDAY, "BirthMode", 2);
-
if (
// only delete values from current contact's custom modules
!(_wFlags & (MADF_HASPROTO|MADF_HASMETA)) &&
@@ -578,14 +536,6 @@ int MAnnivDate::DBWriteBirthDate(MCONTACT hContact) g_plugin.getByte(SET_REMIND_SECUREBIRTHDAY, TRUE))
{
// keep the database clean
-
- if (mir_strcmp(pszModule, MOD_MBIRTHDAY) != 0) {
- DBDeleteDate(hContact, MOD_MBIRTHDAY, SET_CONTACT_BIRTHDAY, SET_CONTACT_BIRTHMONTH, SET_CONTACT_BIRTHYEAR);
- db_unset(hContact, MOD_MBIRTHDAY, "BirthMode");
- }
- else if (mir_strcmp(pszModule, USERINFO) != 0)
- DBDeleteDate(hContact, USERINFO, SET_CONTACT_BIRTHDAY, SET_CONTACT_BIRTHMONTH, SET_CONTACT_BIRTHYEAR);
-
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);
}
diff --git a/plugins/UserInfoEx/src/classMAnnivDate.h b/plugins/UserInfoEx/src/classMAnnivDate.h index bb4cce0dee..559c2c1c83 100644 --- a/plugins/UserInfoEx/src/classMAnnivDate.h +++ b/plugins/UserInfoEx/src/classMAnnivDate.h @@ -21,9 +21,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #pragma once
-#define ANID_LAST 0xFFFC
-#define ANID_BIRTHDAY 0xFFFE
-#define ANID_NONE 0xFFFF
+#define ANID_LAST 0xFFFC
+#define ANID_BIRTHDAY 0xFFFE
+#define ANID_NONE 0xFFFF
struct MZodiac {
HICON hIcon;
@@ -43,13 +43,14 @@ public: } EFlags;
private:
- uint16_t _wID; // index to anniversary in database or ANID_BIRTHDAY
- wstring _strDesc; // descripes the anniversary (e.g. birthday)
- string _strModule; // the module the anniversary has been read from
- uint16_t _wFlags; // the flags
- uint8_t _bRemind; // per user setting for reminder (0 - disabled, 1 - use local offset, 2 - use global offset)
- uint16_t _wDaysEarlier; // number of days to the anniversary the user wants to be reminded of this anniversary
+ uint16_t _wID; // index to anniversary in database or ANID_BIRTHDAY
+ wstring _strDesc; // descripes the anniversary (e.g. birthday)
+ string _strModule; // the module the anniversary has been read from
+ uint16_t _wFlags; // the flags
+ uint8_t _bRemind; // per user setting for reminder (0 - disabled, 1 - use local offset, 2 - use global offset)
+ uint16_t _wDaysEarlier; // number of days to the anniversary the user wants to be reminded of this anniversary
+public:
int DBWriteDate(MCONTACT hContact, LPCSTR pszModule, LPCSTR szDay, LPCSTR szMonth, LPCSTR szYear);
int DBDeleteDate(MCONTACT hContact, LPCSTR pszModule, LPCSTR szDay, LPCSTR szMonth, LPCSTR szYear) const;
@@ -58,39 +59,39 @@ public: MAnnivDate(MAnnivDate &mda);
// basic access to attributes
- __inline LPCTSTR Description() const { return _strDesc.c_str(); };
- __inline void Description(LPCTSTR pszDesc) { if (pszDesc) _strDesc = pszDesc; };
- __inline LPCSTR Module() const { return _strModule.c_str(); };
- __inline void Module(LPCSTR pszModule) { if (pszModule) _strModule = pszModule; else _strModule.clear(); };
- __inline uint8_t RemindOption() const { return _bRemind; };
- __inline void RemindOption(uint8_t bRemind) { if (bRemind <= BST_INDETERMINATE) _bRemind = bRemind; };
- __inline uint16_t RemindOffset() const { return _wDaysEarlier; };
- __inline void RemindOffset(uint16_t wOffset) { _wDaysEarlier = wOffset; };
- __inline uint16_t Id() const { return _wID; };
- __inline void Id(uint16_t wId) { if (_wID == ANID_NONE) _wID = wId; };
+ __inline LPCTSTR Description() const { return _strDesc.c_str(); };
+ __inline void Description(LPCTSTR pszDesc) { if (pszDesc) _strDesc = pszDesc; };
+ __inline LPCSTR Module() const { return _strModule.c_str(); };
+ __inline void Module(LPCSTR pszModule) { if (pszModule) _strModule = pszModule; else _strModule.clear(); };
+ __inline uint8_t RemindOption() const { return _bRemind; };
+ __inline void RemindOption(uint8_t bRemind) { if (bRemind <= BST_INDETERMINATE) _bRemind = bRemind; };
+ __inline uint16_t RemindOffset() const { return _wDaysEarlier; };
+ __inline void RemindOffset(uint16_t wOffset) { _wDaysEarlier = wOffset; };
+ __inline uint16_t Id() const { return _wID; };
+ __inline void Id(uint16_t wId) { if (_wID == ANID_NONE) _wID = wId; };
- uint32_t DateStamp() const;
- void DateStamp(const uint32_t dwStamp);
+ uint32_t DateStamp() const;
+ void DateStamp(const uint32_t dwStamp);
// basic checks
__inline uint8_t IsValid() const;
- __inline uint8_t IsChanged() const { return (_wFlags & MADF_CHANGED); };
- __inline uint8_t IsReminderChanged() const { return (_wFlags & MADF_REMINDER_CHANGED); };
+ __inline uint8_t IsChanged() const { return (_wFlags & MADF_CHANGED); };
+ __inline uint8_t IsReminderChanged() const { return (_wFlags & MADF_REMINDER_CHANGED); };
__inline uint8_t IsEqual(const MAnnivDate &mda) const { return IsEqual(mda.SystemTime()); };
uint8_t IsEqual(const SYSTEMTIME &st) const;
// handling flags
- __inline uint16_t Flags() const { return _wFlags; };
- __inline void Flags(uint16_t wFlags) { _wFlags = wFlags; };
- __inline void SetFlags(uint16_t wFlag) { _wFlags |= wFlag; };
- __inline void RemoveFlags(uint16_t wFlag) { _wFlags &= ~wFlag; };
+ __inline uint16_t Flags() const { return _wFlags; };
+ __inline void Flags(uint16_t wFlags) { _wFlags = wFlags; };
+ __inline void SetFlags(uint16_t wFlag) { _wFlags |= wFlag; };
+ __inline void RemoveFlags(uint16_t wFlag) { _wFlags &= ~wFlag; };
// return diffence of days, ignoring the date
- int CompareDays(MTime mt) const;
+ int CompareDays(MTime mt) const;
- MZodiac Zodiac();
- int Age(MTime *pNow = nullptr);
- void Clear();
+ MZodiac Zodiac();
+ int Age(MTime *pNow = nullptr);
+ void Clear();
// read date from database
int DBGetDate(MCONTACT hContact, LPCSTR pszModule, LPCSTR szDay, LPCSTR szMonth, LPCSTR szYear);
@@ -108,7 +109,6 @@ public: // delete date from database
int DBDeleteBirthDate(MCONTACT hContact);
- int DBMoveBirthDate(MCONTACT hContact, uint8_t bOld, uint8_t bNew);
int BackupBirthday (MCONTACT hContact, LPSTR pszProto = nullptr, const uint8_t bDontIgnoreAnything = FALSE, PWORD lastAnswer = nullptr);
// setting values
diff --git a/plugins/UserInfoEx/src/ctrl_annivedit.cpp b/plugins/UserInfoEx/src/ctrl_annivedit.cpp index bc19dd5b55..c8d43f11db 100644 --- a/plugins/UserInfoEx/src/ctrl_annivedit.cpp +++ b/plugins/UserInfoEx/src/ctrl_annivedit.cpp @@ -322,8 +322,8 @@ INT_PTR CAnnivEditCtrl::DBWriteBirthDay(MCONTACT hContact) if ((pmdb = FindDateById(ANID_BIRTHDAY)) == nullptr)
return 1;
+ // save birthday
if (pmdb->IsChanged()) {
- // save birthday, to mBirthday module by default
if (pmdb->Flags() & pmdb->MADF_HASCUSTOM)
pmdb->DBWriteBirthDate(hContact);
else
diff --git a/plugins/UserInfoEx/src/dlg_anniversarylist.cpp b/plugins/UserInfoEx/src/dlg_anniversarylist.cpp index af5807bb3a..c13f69613c 100644 --- a/plugins/UserInfoEx/src/dlg_anniversarylist.cpp +++ b/plugins/UserInfoEx/src/dlg_anniversarylist.cpp @@ -906,6 +906,8 @@ INT_PTR DlgAnniversaryListShow(WPARAM, LPARAM) * loading and unloading module
***********************************************************************************************************/
+#define MOD_MBIRTHDAY "mBirthday"
+
void DlgAnniversaryListLoadModule()
{
CreateServiceFunction(MS_USERINFO_REMINDER_LIST, DlgAnniversaryListShow);
@@ -916,4 +918,17 @@ void DlgAnniversaryListLoadModule() hk.szDescription.a = LPGEN("Popup anniversary list");
hk.pszService = MS_USERINFO_REMINDER_LIST;
g_plugin.addHotkey(&hk);
+
+ if (!g_plugin.getByte("Bug3001")) {
+ // walk through all the contacts stored in the DB
+ MAnnivDate mdb;
+ for (auto &hContact : Contacts()) {
+ if (!mdb.DBGetDate(hContact, MOD_MBIRTHDAY, SET_CONTACT_BIRTHDAY, SET_CONTACT_BIRTHMONTH, SET_CONTACT_BIRTHYEAR)) {
+ mdb.DBWriteDate(hContact, USERINFO, SET_CONTACT_BIRTHDAY, SET_CONTACT_BIRTHMONTH, SET_CONTACT_BIRTHYEAR);
+ mdb.DBDeleteDate(hContact, MOD_MBIRTHDAY, SET_CONTACT_BIRTHDAY, SET_CONTACT_BIRTHMONTH, SET_CONTACT_BIRTHYEAR);
+ }
+ }
+
+ g_plugin.setByte("Bug3001", 1);
+ }
}
diff --git a/plugins/UserInfoEx/src/dlg_propsheet.cpp b/plugins/UserInfoEx/src/dlg_propsheet.cpp index d6d5acd4e8..24fb405c45 100644 --- a/plugins/UserInfoEx/src/dlg_propsheet.cpp +++ b/plugins/UserInfoEx/src/dlg_propsheet.cpp @@ -1087,7 +1087,7 @@ static INT_PTR CALLBACK DlgProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lPar // update the windowtitle
DlgProc(hDlg, HM_SETWINDOWTITLE, NULL, lParam);
}
- else if (!strcmp(pdbcws->szModule, USERINFO) || !strcmp(pdbcws->szModule, pPs->pszProto) || !strcmp(pdbcws->szModule, MOD_MBIRTHDAY)) {
+ else if (!strcmp(pdbcws->szModule, USERINFO) || !strcmp(pdbcws->szModule, pPs->pszProto)) {
// force the update of all propertysheetpages
DlgProc(hDlg, PSM_FORCECHANGED, NULL, NULL);
}
diff --git a/plugins/UserInfoEx/src/ex_import/classExImContactXML.cpp b/plugins/UserInfoEx/src/ex_import/classExImContactXML.cpp index 6827856ce7..3e4cd100de 100644 --- a/plugins/UserInfoEx/src/ex_import/classExImContactXML.cpp +++ b/plugins/UserInfoEx/src/ex_import/classExImContactXML.cpp @@ -152,7 +152,6 @@ int CExImContactXML::ExportContact(DB::CEnumList *pModules) }
else {
ExportModule(USERINFO);
- ExportModule(MOD_MBIRTHDAY);
}
}
diff --git a/plugins/UserInfoEx/src/ex_import/dlg_ExImModules.cpp b/plugins/UserInfoEx/src/ex_import/dlg_ExImModules.cpp index 105c770ddb..46abcece72 100644 --- a/plugins/UserInfoEx/src/ex_import/dlg_ExImModules.cpp +++ b/plugins/UserInfoEx/src/ex_import/dlg_ExImModules.cpp @@ -245,7 +245,6 @@ INT_PTR CALLBACK SelectModulesToExport_DlgProc(HWND hDlg, UINT uMsg, WPARAM wPar // insert essential items (modul from UIEX)
ExportTree_AddItem(hTree, hItemEssential, USERINFO, bImagesLoaded, 0);
- ExportTree_AddItem(hTree, hItemEssential, MOD_MBIRTHDAY, bImagesLoaded, 0);
/*Filter/ protocol module is ignored for owner contact
if (pDat->hContact != NULL) {
@@ -303,7 +302,7 @@ INT_PTR CALLBACK SelectModulesToExport_DlgProc(HWND hDlg, UINT uMsg, WPARAM wPar // add optional module, which is valid for at least one contact
/*/Filter/*/
- if (mir_strcmpi(p, USERINFO) && mir_strcmpi(p, MOD_MBIRTHDAY) && mir_strcmpi(p, META_PROTO)) {
+ if (mir_strcmpi(p, USERINFO) && mir_strcmpi(p, META_PROTO)) {
ExportTree_AddItem(hTree, hItemOptional, p, bImagesLoaded, 1);
break;
}
@@ -312,16 +311,10 @@ INT_PTR CALLBACK SelectModulesToExport_DlgProc(HWND hDlg, UINT uMsg, WPARAM wPar } // end TRUE = All Contacts
// module must exist in the selected contact
- else if (
- /*Filter/*/
- !DB::Module::IsEmpty(pDat->ExImContact->hContact, p) &&
- (!pDat->ExImContact->hContact || mir_strcmpi(p, pszProto)) &&
- //mir_strcmpi(p, "Protocol") &&
- mir_strcmpi(p, USERINFO) &&
- mir_strcmpi(p, MOD_MBIRTHDAY)) {
+ else if (!DB::Module::IsEmpty(pDat->ExImContact->hContact, p) && (!pDat->ExImContact->hContact || mir_strcmpi(p, pszProto)) && mir_strcmpi(p, USERINFO)) {
ExportTree_AddItem(hTree, hItemOptional, (LPSTR)p, bImagesLoaded, 1);
}
- } // end
+ }
}
}
}
diff --git a/plugins/UserInfoEx/src/ex_import/svc_ExImVCF.cpp b/plugins/UserInfoEx/src/ex_import/svc_ExImVCF.cpp index f7cba427a6..1dc8fc82d4 100644 --- a/plugins/UserInfoEx/src/ex_import/svc_ExImVCF.cpp +++ b/plugins/UserInfoEx/src/ex_import/svc_ExImVCF.cpp @@ -1234,13 +1234,13 @@ uint8_t CVCardFileVCF::Import() memcpy(buf, _clVal.GetBuffer(), 4);
buf[4] = 0;
- db_set_w(_hContact, MOD_MBIRTHDAY, SET_CONTACT_BIRTHYEAR, (uint16_t)strtol(buf, nullptr, 10));
+ db_set_w(_hContact, USERINFO, SET_CONTACT_BIRTHYEAR, (uint16_t)strtol(buf, nullptr, 10));
memcpy(buf, _clVal.GetBuffer() + 4, 2);
buf[2] = 0;
- db_set_b(_hContact, MOD_MBIRTHDAY, SET_CONTACT_BIRTHMONTH, (uint8_t)strtol(buf, nullptr, 10));
+ db_set_b(_hContact, USERINFO, SET_CONTACT_BIRTHMONTH, (uint8_t)strtol(buf, nullptr, 10));
memcpy(buf, _clVal.GetBuffer() + 6, 2);
buf[2] = 0;
- db_set_b(_hContact, MOD_MBIRTHDAY, SET_CONTACT_BIRTHDAY, (uint8_t)strtol(buf, nullptr, 10));
+ db_set_b(_hContact, USERINFO, SET_CONTACT_BIRTHDAY, (uint8_t)strtol(buf, nullptr, 10));
}
}
continue;
diff --git a/plugins/UserInfoEx/src/psp_options.cpp b/plugins/UserInfoEx/src/psp_options.cpp index d4cb66ed4d..f8e525a0d6 100644 --- a/plugins/UserInfoEx/src/psp_options.cpp +++ b/plugins/UserInfoEx/src/psp_options.cpp @@ -566,10 +566,6 @@ static INT_PTR CALLBACK DlgProc_ReminderOpts(HWND hDlg, UINT uMsg, WPARAM wParam ComboBox_AddString(hCtrl, TranslateT("Anniversaries only"));
ComboBox_AddString(hCtrl, TranslateT("Everything"));
}
- if (hCtrl = GetDlgItem(hDlg, EDIT_BIRTHMODULE)) {
- ComboBox_AddString(hCtrl, TranslateT("mBirthday"));
- ComboBox_AddString(hCtrl, TranslateT("UserInfo (default)"));
- }
bInitialized = 0;
{
@@ -589,8 +585,6 @@ static INT_PTR CALLBACK DlgProc_ReminderOpts(HWND hDlg, UINT uMsg, WPARAM wParam SetDlgItemInt(hDlg, EDIT_REMIND_SOUNDOFFSET, g_plugin.getByte(SET_REMIND_SOUNDOFFSET, DEFVAL_REMIND_SOUNDOFFSET), FALSE);
SetDlgItemInt(hDlg, EDIT_REMIND2, g_plugin.getWord(SET_REMIND_NOTIFYINTERVAL, DEFVAL_REMIND_NOTIFYINTERVAL), FALSE);
- SendDlgItemMessage(hDlg, EDIT_BIRTHMODULE, CB_SETCURSEL, g_plugin.getByte(SET_REMIND_BIRTHMODULE, DEFVAL_REMIND_BIRTHMODULE), NULL);
-
MTime mtLast;
wchar_t szTime[MAX_PATH];
@@ -620,19 +614,6 @@ static INT_PTR CALLBACK DlgProc_ReminderOpts(HWND hDlg, UINT uMsg, WPARAM wParam DBWriteEditWord(hDlg, EDIT_REMIND2, SET_REMIND_NOTIFYINTERVAL, DEFVAL_REMIND_NOTIFYINTERVAL);
bReminderCheck = DBWriteEditWord(hDlg, EDIT_REMIND, SET_REMIND_OFFSET, DEFVAL_REMIND_OFFSET);
- // save primary birthday module
- uint8_t bOld = g_plugin.getByte(SET_REMIND_BIRTHMODULE, DEFVAL_REMIND_BIRTHMODULE); // = 1
- uint8_t bNew = (uint8_t)ComboBox_GetCurSel(GetDlgItem(hDlg, EDIT_BIRTHMODULE));
- if (bOld != bNew) {
- // keep the database clean
- DBWriteComboByte(hDlg, EDIT_BIRTHMODULE, SET_REMIND_BIRTHMODULE, DEFVAL_REMIND_BIRTHMODULE);
-
- // walk through all the contacts stored in the DB
- MAnnivDate mdb;
- for (auto &hContact : Contacts())
- mdb.DBMoveBirthDate(hContact, bOld, bNew);
- }
-
// update current reminder state
uint8_t bNewVal = (uint8_t)SendDlgItemMessage(hDlg, EDIT_REMIND_ENABLED, CB_GETCURSEL, NULL, NULL);
if (g_plugin.getByte(SET_REMIND_ENABLED, 1) != bNewVal) {
@@ -661,8 +642,8 @@ static INT_PTR CALLBACK DlgProc_ReminderOpts(HWND hDlg, UINT uMsg, WPARAM wParam int bEnabled = ComboBox_GetCurSel((HWND)lParam) > 0;
const int idCtrl[] = {
CHECK_REMIND_MI, EDIT_REMIND, EDIT_REMIND2, SPIN_REMIND, SPIN_REMIND2, TXT_REMIND,
- TXT_REMIND2, TXT_REMIND3, TXT_REMIND4, TXT_REMIND6, TXT_REMIND7, TXT_REMIND8, TXT_REMIND9,
- TXT_REMIND_LASTCHECK, CHECK_REMIND_FLASHICON, EDIT_BIRTHMODULE, CHECK_REMIND_VISIBLEONLY,
+ TXT_REMIND2, TXT_REMIND3, TXT_REMIND4, TXT_REMIND6, TXT_REMIND8, TXT_REMIND9,
+ TXT_REMIND_LASTCHECK, CHECK_REMIND_FLASHICON, CHECK_REMIND_VISIBLEONLY,
CHECK_REMIND_SECURED, CHECK_REMIND_STARTUP, EDIT_REMIND_SOUNDOFFSET, SPIN_REMIND_SOUNDOFFSET
};
@@ -670,11 +651,6 @@ static INT_PTR CALLBACK DlgProc_ReminderOpts(HWND hDlg, UINT uMsg, WPARAM wParam }
__fallthrough;
- case EDIT_BIRTHMODULE:
- if (bInitialized && HIWORD(wParam) == CBN_SELCHANGE)
- NotifyParentOfChange(hDlg);
- break;
-
case CHECK_REMIND_MI:
case CHECK_REMIND_FLASHICON:
case CHECK_REMIND_VISIBLEONLY:
diff --git a/plugins/UserInfoEx/src/resource.h b/plugins/UserInfoEx/src/resource.h index 928b94476b..7e230fc9d2 100644 --- a/plugins/UserInfoEx/src/resource.h +++ b/plugins/UserInfoEx/src/resource.h @@ -77,7 +77,6 @@ #define TXT_OPT_CLR_USER 1128
#define TXT_REMIND_LASTCHECK 1128
#define TXT_OPT_CLR_BOTH 1129
-#define TXT_REMIND7 1129
#define TXT_OPT_CLR_CHANGED 1130
#define TXT_REMIND8 1130
#define TXT_OPT_POPUP_CLR_BACK 1131
@@ -156,7 +155,6 @@ #define EDIT_METASUBCONTACTS 1506
#define EDIT_HISTORY_GROUPING 1506
#define COMBO_VIEW 1506
-#define EDIT_BIRTHMODULE 1507
#define EDIT_PATH 1512
#define BTN_BROWSE 1513
#define BTN_CHECK 1514
diff --git a/plugins/UserInfoEx/src/svc_constants.h b/plugins/UserInfoEx/src/svc_constants.h index 77f7c1e264..f9f7054dd2 100644 --- a/plugins/UserInfoEx/src/svc_constants.h +++ b/plugins/UserInfoEx/src/svc_constants.h @@ -36,7 +36,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #define MAXUID 260 // maximum character count for a uin
// most important modules
-#define MOD_MBIRTHDAY "mBirthday"
#define MOD_CLIST "CList"
// database settings (propertysheet)
diff --git a/plugins/UserInfoEx/src/svc_reminder.cpp b/plugins/UserInfoEx/src/svc_reminder.cpp index 55443210fb..261b6b97aa 100644 --- a/plugins/UserInfoEx/src/svc_reminder.cpp +++ b/plugins/UserInfoEx/src/svc_reminder.cpp @@ -645,7 +645,7 @@ static int OnContactSettingChanged(MCONTACT hContact, DBCONTACTWRITESETTING* pdb CEvent evt;
MTime now;
now.GetLocalTime();
- if (!mir_strcmp(pdbcws->szModule, SvcReminderGetMyBirthdayModule())) {
+ if (!mir_strcmp(pdbcws->szModule, USERINFO)) {
uint16_t LastAnswer = IDNONE;
CheckContact(hContact, now, evt, FALSE, &LastAnswer);
}
@@ -713,19 +713,6 @@ static INT_PTR BackupBirthdayService(WPARAM hContact, LPARAM lParam) return 0;
}
-/**
-* This function returns a constant pointer to the module the date should be saved to
-*
-* @param none
-*
-* @return module to write birthday information to, MOD_MBIRTHDAY by default
-**/
-
-LPCSTR SvcReminderGetMyBirthdayModule()
-{
- return ((g_plugin.getByte(SET_REMIND_BIRTHMODULE, DEFVAL_REMIND_BIRTHMODULE) == 1) ? USERINFO : MOD_MBIRTHDAY);
-}
-
/***********************************************************************************************************
* timer stuff
***********************************************************************************************************/
diff --git a/plugins/UserInfoEx/src/svc_reminder.h b/plugins/UserInfoEx/src/svc_reminder.h index c8ebc1164f..c177d0d29e 100644 --- a/plugins/UserInfoEx/src/svc_reminder.h +++ b/plugins/UserInfoEx/src/svc_reminder.h @@ -21,58 +21,57 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #ifndef _SVCREMINDER_H_
#define _SVCREMINDER_H_
-#define POPUP_TYPE_BIRTHDAY 1
-#define POPUP_TYPE_ANNIVERSARY 2
-
-// for PopupDelayType
-#define POPUP_DELAY_DEFAULT 3
-#define POPUP_DELAY_CUSTOM 4
-#define POPUP_DELAY_PERMANENT 5
-
-// for PopupColorType
-#define POPUP_COLOR_DEFAULT 6
-#define POPUP_COLOR_WINDOWS 7
-#define POPUP_COLOR_CUSTOM 8
-
-#define SOUND_BIRTHDAY_TODAY "Birthday"
-#define SOUND_BIRTHDAY_SOON "BirthdayComing"
-#define SOUND_ANNIVERSARY "Anniversary"
-
-// databbase settings
-#define SET_REMIND_LASTCHECK "RemindLastCheck"
-#define SET_REMIND_ENABLED "RemindEnabled"
-#define SET_REMIND_OFFSET "RemindOffset"
-#define SET_REMIND_CHECKVISIBLE "RemindCheckVisible"
-#define SET_REMIND_NOTIFYINTERVAL "RemindNotifyInterval"
-#define SET_REMIND_FLASHICON "RemindFlashIcon"
-#define SET_REMIND_EXTRAICON "RemindExtraIcon"
-#define SET_REMIND_BIRTHMODULE "RemindBirthModule"
-#define SET_REMIND_MENUENABLED "RemindMenuEnabled"
-#define SET_REMIND_BIRTHDAY_ENABLED "RemindBirthday"
-#define SET_REMIND_BIRTHDAY_OFFSET "RemindBirthdayOffset"
-#define SET_REMIND_CHECKON_STARTUP "RemindStartupCheck"
-#define SET_REMIND_SECUREBIRTHDAY "RemindSecureBirthday"
-#define SET_REMIND_BIRTHDAY_IGNORED "RemindSecureIgnored"
-#define SET_REMIND_SOUNDOFFSET "RemindSoundOffset"
-#define SET_POPUP_ENABLED "PopupEnabled"
-#define SET_POPUP_BIRTHDAY_COLORTYPE "PopupBirthClrType"
-#define SET_POPUP_BIRTHDAY_COLOR_TEXT "PopupBirthClrBirthText"
-#define SET_POPUP_BIRTHDAY_COLOR_BACK "PopupBirthClrBirthBack"
-#define SET_POPUP_ANNIVERSARY_COLORTYPE "PopupAnnivClrType"
-#define SET_POPUP_ANNIVERSARY_COLOR_TEXT "PopupAnnivClrText"
-#define SET_POPUP_ANNIVERSARY_COLOR_BACK "PopupAnnivClrBack"
-#define SET_POPUP_DELAY "PopupDelay"
+#define POPUP_TYPE_BIRTHDAY 1
+#define POPUP_TYPE_ANNIVERSARY 2
+
+// for PopupDelayType
+#define POPUP_DELAY_DEFAULT 3
+#define POPUP_DELAY_CUSTOM 4
+#define POPUP_DELAY_PERMANENT 5
+
+// for PopupColorType
+#define POPUP_COLOR_DEFAULT 6
+#define POPUP_COLOR_WINDOWS 7
+#define POPUP_COLOR_CUSTOM 8
+
+#define SOUND_BIRTHDAY_TODAY "Birthday"
+#define SOUND_BIRTHDAY_SOON "BirthdayComing"
+#define SOUND_ANNIVERSARY "Anniversary"
+
+// databbase settings
+#define SET_REMIND_LASTCHECK "RemindLastCheck"
+#define SET_REMIND_ENABLED "RemindEnabled"
+#define SET_REMIND_OFFSET "RemindOffset"
+#define SET_REMIND_CHECKVISIBLE "RemindCheckVisible"
+#define SET_REMIND_NOTIFYINTERVAL "RemindNotifyInterval"
+#define SET_REMIND_FLASHICON "RemindFlashIcon"
+#define SET_REMIND_EXTRAICON "RemindExtraIcon"
+#define SET_REMIND_MENUENABLED "RemindMenuEnabled"
+#define SET_REMIND_BIRTHDAY_ENABLED "RemindBirthday"
+#define SET_REMIND_BIRTHDAY_OFFSET "RemindBirthdayOffset"
+#define SET_REMIND_CHECKON_STARTUP "RemindStartupCheck"
+#define SET_REMIND_SECUREBIRTHDAY "RemindSecureBirthday"
+#define SET_REMIND_BIRTHDAY_IGNORED "RemindSecureIgnored"
+#define SET_REMIND_SOUNDOFFSET "RemindSoundOffset"
+#define SET_POPUP_ENABLED "PopupEnabled"
+#define SET_POPUP_BIRTHDAY_COLORTYPE "PopupBirthClrType"
+#define SET_POPUP_BIRTHDAY_COLOR_TEXT "PopupBirthClrBirthText"
+#define SET_POPUP_BIRTHDAY_COLOR_BACK "PopupBirthClrBirthBack"
+#define SET_POPUP_ANNIVERSARY_COLORTYPE "PopupAnnivClrType"
+#define SET_POPUP_ANNIVERSARY_COLOR_TEXT "PopupAnnivClrText"
+#define SET_POPUP_ANNIVERSARY_COLOR_BACK "PopupAnnivClrBack"
+#define SET_POPUP_DELAY "PopupDelay"
// default values
-#define DEFVAL_REMIND_ENABLED REMIND_ALL
-#define DEFVAL_REMIND_MENUENABLED 1
-#define DEFVAL_REMIND_OFFSET 9
-#define DEFVAL_REMIND_SOUNDOFFSET 3
-#define DEFVAL_REMIND_NOTIFYINTERVAL 12
-#define DEFVAL_REMIND_BIRTHMODULE 1
-#define DEFVAL_POPUP_ENABLED 1
-#define DEFVAL_REMIND_CHECKVISIBLE 0
-#define HM_OPENMSG (WM_USER+1)
+#define DEFVAL_REMIND_ENABLED REMIND_ALL
+#define DEFVAL_REMIND_MENUENABLED 1
+#define DEFVAL_REMIND_OFFSET 9
+#define DEFVAL_REMIND_SOUNDOFFSET 3
+#define DEFVAL_REMIND_NOTIFYINTERVAL 12
+#define DEFVAL_POPUP_ENABLED 1
+#define DEFVAL_REMIND_CHECKVISIBLE 0
+
+#define HM_OPENMSG (WM_USER+1)
/**
* typedefs:
@@ -96,7 +95,6 @@ enum ENotify * Global functions:
**/
void SvcReminderCheckAll(const ENotify notify);
-LPCSTR SvcReminderGetMyBirthdayModule(void);
void SvcReminderOnTopToolBarLoaded(void);
void SvcReminderOnModulesLoaded(void);
diff --git a/plugins/UserInfoEx/src/version.h b/plugins/UserInfoEx/src/version.h index afd0729fb2..798e0d7831 100644 --- a/plugins/UserInfoEx/src/version.h +++ b/plugins/UserInfoEx/src/version.h @@ -1,7 +1,7 @@ #define __MAJOR_VERSION 0
#define __MINOR_VERSION 9
#define __RELEASE_NUM 0
-#define __BUILD_NUM 1
+#define __BUILD_NUM 2
#include <stdver.h>
|