summaryrefslogtreecommitdiff
path: root/plugins/RecentContacts/src/RecentContacts.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2018-11-13 21:42:51 +0300
committerGeorge Hazan <ghazan@miranda.im>2018-11-13 21:42:51 +0300
commit8890041a964a9ebd1f421f0a27b56b35862cb5ab (patch)
tree1cc9954601ca9d14e669620ddf7954424e15251e /plugins/RecentContacts/src/RecentContacts.cpp
parente4bb8311a88022722a563a94bfba3b5607a1eb5b (diff)
ClientChangeNotify, KeyboardNotify, RecentContacts -> g_plugin
Diffstat (limited to 'plugins/RecentContacts/src/RecentContacts.cpp')
-rw-r--r--plugins/RecentContacts/src/RecentContacts.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/plugins/RecentContacts/src/RecentContacts.cpp b/plugins/RecentContacts/src/RecentContacts.cpp
index 5aafc73a81..6512b02690 100644
--- a/plugins/RecentContacts/src/RecentContacts.cpp
+++ b/plugins/RecentContacts/src/RecentContacts.cpp
@@ -210,7 +210,7 @@ INT_PTR CALLBACK ShowListMainDlgProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM
szFormat = mir_strdup(dbLastUC_DateTimeFormatDefault);
for (auto curContact = DlgDat->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;
}