From 8890041a964a9ebd1f421f0a27b56b35862cb5ab Mon Sep 17 00:00:00 2001 From: George Hazan Date: Tue, 13 Nov 2018 21:42:51 +0300 Subject: ClientChangeNotify, KeyboardNotify, RecentContacts -> g_plugin --- plugins/ClientChangeNotify/src/ClientChangeNotify.cpp | 6 +++--- plugins/KeyboardNotify/src/ignore.cpp | 4 ++-- plugins/RecentContacts/src/RecentContacts.cpp | 16 ++++++++-------- plugins/RecentContacts/src/options.cpp | 12 ++++++------ 4 files changed, 19 insertions(+), 19 deletions(-) (limited to 'plugins') diff --git a/plugins/ClientChangeNotify/src/ClientChangeNotify.cpp b/plugins/ClientChangeNotify/src/ClientChangeNotify.cpp index 086c447f38..51dd8c9265 100644 --- a/plugins/ClientChangeNotify/src/ClientChangeNotify.cpp +++ b/plugins/ClientChangeNotify/src/ClientChangeNotify.cpp @@ -196,7 +196,7 @@ int ContactSettingChanged(WPARAM hContact, LPARAM lParam) return 0; } sd.OldMirVer = db_get_s(hContact, MODULENAME, DB_OLDMIRVER, L""); - db_set_ws(hContact, MODULENAME, DB_OLDMIRVER, sd.MirVer); // we have to write it here, because we modify sd.OldMirVer and sd.MirVer to conform our settings later + g_plugin.setWString(hContact, DB_OLDMIRVER, sd.MirVer); // we have to write it here, because we modify sd.OldMirVer and sd.MirVer to conform our settings later if (sd.OldMirVer.IsEmpty()) // looks like it's the right way to do return 0; @@ -215,9 +215,9 @@ int ContactSettingChanged(WPARAM hContact, LPARAM lParam) if (hContact && db_get_b(hContactOrMeta, "CList", "Hidden", 0)) return 0; - int PerContactSetting = hContact ? db_get_b(hContact, MODULENAME, DB_CCN_NOTIFY, NOTIFY_USEGLOBAL) : NOTIFY_ALWAYS; // NOTIFY_ALWAYS for preview + int PerContactSetting = hContact ? g_plugin.getByte(hContact, DB_CCN_NOTIFY, NOTIFY_USEGLOBAL) : NOTIFY_ALWAYS; // NOTIFY_ALWAYS for preview if (PerContactSetting == NOTIFY_USEGLOBAL && hContactOrMeta != hContact) // subcontact setting has a priority over a metacontact setting - PerContactSetting = db_get_b(hContactOrMeta, MODULENAME, DB_CCN_NOTIFY, NOTIFY_USEGLOBAL); + PerContactSetting = g_plugin.getByte(hContactOrMeta, DB_CCN_NOTIFY, NOTIFY_USEGLOBAL); if (PerContactSetting && (PerContactSetting == NOTIFY_ALMOST_ALWAYS || PerContactSetting == NOTIFY_ALWAYS || !PopupOptPage.GetValue(IDC_POPUPOPTDLG_USESTATUSNOTIFYFLAG) || !(db_get_dw(hContactOrMeta, "Ignore", "Mask1", 0) & 0x8))) { // check if we need to notify at all sd.hContact = hContact; diff --git a/plugins/KeyboardNotify/src/ignore.cpp b/plugins/KeyboardNotify/src/ignore.cpp index 063a5a9432..190f82cf82 100644 --- a/plugins/KeyboardNotify/src/ignore.cpp +++ b/plugins/KeyboardNotify/src/ignore.cpp @@ -27,7 +27,7 @@ static const DWORD ignoreIdToPf1[IGNOREEVENT_MAX] = {PF1_IMRECV, PF1_URLRECV, PF static DWORD GetMask(MCONTACT hContact) { - DWORD mask = db_get_dw(hContact, MODULENAME, "Mask1", (DWORD)(-1)); + DWORD mask = g_plugin.getDword(hContact, "Mask1", (DWORD)(-1)); if(mask == (DWORD)(-1)) { if(hContact == NULL) mask=0; @@ -164,7 +164,7 @@ static void SaveItemMask(HWND hwndList, MCONTACT hContact, HANDLE hItem, const c if(iImage && iImage != EMPTY_EXTRA_ICON) mask |= 1<Contacts->begin(); curContact != DlgDat->Contacts->end(); curContact++) { - if (curContact->second != NULL && db_get_b(curContact->second, MODULENAME, dbLastUC_IgnoreContact, 0) == 0) { + if (curContact->second != NULL && g_plugin.getByte(curContact->second, dbLastUC_IgnoreContact) == 0) { wchar_t *cname = Clist_GetContactDisplayName(curContact->second); if (cname == nullptr) continue; @@ -359,8 +359,8 @@ INT_PTR CALLBACK ShowListMainDlgProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM static __time64_t GetLastUsedTimeStamp(MCONTACT hContact) { return - ((__time64_t)db_get_dw(hContact, MODULENAME, dbLastUC_LastUsedTimeLo, -1)) | - (((__time64_t)db_get_dw(hContact, MODULENAME, dbLastUC_LastUsedTimeHi, -1)) << 32); + ((__time64_t)g_plugin.getDword(hContact, dbLastUC_LastUsedTimeLo, -1)) | + (((__time64_t)g_plugin.getDword(hContact, dbLastUC_LastUsedTimeHi, -1)) << 32); } INT_PTR OnMenuCommandShowList(WPARAM, LPARAM) @@ -447,8 +447,8 @@ int Create_MenuitemShowList(void) static void SaveLastUsedTimeStamp(MCONTACT hContact) { __time64_t ct = _time64(nullptr); - db_set_dw(hContact, MODULENAME, dbLastUC_LastUsedTimeLo, (DWORD)ct); - db_set_dw(hContact, MODULENAME, dbLastUC_LastUsedTimeHi, (DWORD)(ct >> 32)); + g_plugin.setDword(hContact, dbLastUC_LastUsedTimeLo, (DWORD)ct); + g_plugin.setDword(hContact, dbLastUC_LastUsedTimeHi, (DWORD)(ct >> 32)); } static int OnGCInEvent(WPARAM, LPARAM lParam) @@ -495,7 +495,7 @@ static int OnProtoBroadcast(WPARAM, LPARAM lParam) static int OnPrebuildContactMenu(WPARAM hContact, LPARAM) { - if (db_get_b(hContact, MODULENAME, dbLastUC_IgnoreContact, 0) == 0) + if (g_plugin.getByte(hContact, dbLastUC_IgnoreContact) == 0) Menu_ModifyItem(hMenuItemRemove, LPGENW("Ignore Contact")); else Menu_ModifyItem(hMenuItemRemove, LPGENW("Show Contact")); @@ -523,8 +523,8 @@ static int OnModulesLoaded(WPARAM, LPARAM) static INT_PTR ToggleIgnore(WPARAM hContact, LPARAM) { if (hContact != NULL) { - int state = db_get_b(hContact, MODULENAME, dbLastUC_IgnoreContact, 0) == 0 ? 1 : 0; - db_set_b(hContact, MODULENAME, dbLastUC_IgnoreContact, state); + int state = !g_plugin.getByte(hContact, dbLastUC_IgnoreContact); + g_plugin.setByte(hContact, dbLastUC_IgnoreContact, state); return state; } diff --git a/plugins/RecentContacts/src/options.cpp b/plugins/RecentContacts/src/options.cpp index f6f5591ff3..247c9a14ba 100644 --- a/plugins/RecentContacts/src/options.cpp +++ b/plugins/RecentContacts/src/options.cpp @@ -18,16 +18,16 @@ static INT_PTR CALLBACK DlgProcOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LP strncpy_s(str, LastUCOpt.DateTimeFormat.c_str(), _TRUNCATE); SetDlgItemTextA(hwndDlg, IDC_DATETIME, str); - SetWindowLongPtr(hwndDlg,GWLP_USERDATA,lParam); + SetWindowLongPtr(hwndDlg, GWLP_USERDATA, lParam); return TRUE; case WM_COMMAND: - switch(HIWORD(wParam)) { + switch (HIWORD(wParam)) { case EN_CHANGE: case BN_CLICKED: case CBN_EDITCHANGE: case CBN_SELCHANGE: - SendMessage(GetParent(hwndDlg),PSM_CHANGED,0,0); + SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0); } break; @@ -41,11 +41,11 @@ static INT_PTR CALLBACK DlgProcOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LP g_plugin.setByte(dbLastUC_WindowAutosize, (BYTE)LastUCOpt.WindowAutoSize); GetDlgItemTextA(hwndDlg, IDC_SHOWNCONTACTS, str, _countof(str)); - LastUCOpt.MaxShownContacts= atoi(str); - db_set_b(0,MODULENAME, dbLastUC_MaxShownContacts, LastUCOpt.MaxShownContacts); + LastUCOpt.MaxShownContacts = atoi(str); + g_plugin.setByte(dbLastUC_MaxShownContacts, LastUCOpt.MaxShownContacts); GetDlgItemTextA(hwndDlg, IDC_DATETIME, str, _countof(str)); - db_set_s(0,MODULENAME, dbLastUC_DateTimeFormat, str ); + g_plugin.setString(dbLastUC_DateTimeFormat, str); LoadDBSettings(); return TRUE; -- cgit v1.2.3