summaryrefslogtreecommitdiff
path: root/plugins/YARelay/src
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2018-11-12 21:44:56 +0300
committerGeorge Hazan <ghazan@miranda.im>2018-11-12 21:44:56 +0300
commit53fe3e46177d17b4941610de19f5cc6210700cb4 (patch)
treeb67a6bc208dad141f9db14035cd7e42ff2a51872 /plugins/YARelay/src
parent488214ac8af0c4aeb1a5c1d8fd48368daaf4c4c7 (diff)
db_* functions replaced with g_plugin calls
Diffstat (limited to 'plugins/YARelay/src')
-rw-r--r--plugins/YARelay/src/main.cpp18
-rw-r--r--plugins/YARelay/src/options.cpp18
2 files changed, 18 insertions, 18 deletions
diff --git a/plugins/YARelay/src/main.cpp b/plugins/YARelay/src/main.cpp
index 92617028c8..8d9a401489 100644
--- a/plugins/YARelay/src/main.cpp
+++ b/plugins/YARelay/src/main.cpp
@@ -214,23 +214,23 @@ static int MessageEventAdded(WPARAM hContact, LPARAM hDBEvent)
int CMPlugin::Load()
{
// Load plugin options from DB
- hForwardFrom = (MCONTACT)db_get_dw(NULL, MODULENAME, "ForwardFrom", 0);
- hForwardTo = (MCONTACT)db_get_dw(NULL, MODULENAME, "ForwardTo", 0);
+ hForwardFrom = (MCONTACT)g_plugin.getDword("ForwardFrom", 0);
+ hForwardTo = (MCONTACT)g_plugin.getDword("ForwardTo", 0);
- iForwardOnStatus = db_get_dw(NULL, MODULENAME, "ForwardOnStatus", STATUS_OFFLINE | STATUS_AWAY | STATUS_NA);
+ iForwardOnStatus = g_plugin.getDword("ForwardOnStatus", STATUS_OFFLINE | STATUS_AWAY | STATUS_NA);
- wchar_t *szForwardTemplate = db_get_wsa(NULL, MODULENAME, "ForwardTemplate");
+ wchar_t *szForwardTemplate = g_plugin.getWStringA("ForwardTemplate");
if (szForwardTemplate){
wcsncpy(tszForwardTemplate, szForwardTemplate, _countof(tszForwardTemplate));
mir_free(szForwardTemplate);
}
else wcsncpy(tszForwardTemplate, L"%u: %m", MAXTEMPLATESIZE-1);
- iSplit = db_get_dw(NULL, MODULENAME, "Split", 0);
- iSplitMaxSize = db_get_dw(NULL, MODULENAME, "SplitMaxSize", 100);
- iSendParts = db_get_dw(NULL, MODULENAME, "SendParts", 0);
- iMarkRead = db_get_dw(NULL, MODULENAME, "MarkRead", 0);
- iSendAndHistory = db_get_dw(NULL, MODULENAME, "SendAndHistory", 1);
+ iSplit = g_plugin.getDword("Split", 0);
+ iSplitMaxSize = g_plugin.getDword("SplitMaxSize", 100);
+ iSendParts = g_plugin.getDword("SendParts", 0);
+ iMarkRead = g_plugin.getDword("MarkRead", 0);
+ iSendAndHistory = g_plugin.getDword("SendAndHistory", 1);
// hook events
HookEvent(ME_DB_EVENT_ADDED, MessageEventAdded);
diff --git a/plugins/YARelay/src/options.cpp b/plugins/YARelay/src/options.cpp
index 5082c2f6bd..7e4d1eceef 100644
--- a/plugins/YARelay/src/options.cpp
+++ b/plugins/YARelay/src/options.cpp
@@ -168,15 +168,15 @@ static INT_PTR CALLBACK OptionsFrameProc(HWND hwndDlg, UINT uMsg, WPARAM wParam,
iSplitMaxSize = 1;
// write to database
- db_set_dw(NULL, MODULENAME, "ForwardFrom", (DWORD)hForwardFrom);
- db_set_dw(NULL, MODULENAME, "ForwardTo", (DWORD)hForwardTo);
- db_set_dw(NULL, MODULENAME, "ForwardOnStatus", iForwardOnStatus);
- db_set_ws(NULL, MODULENAME, "ForwardTemplate", tszForwardTemplate);
- db_set_dw(NULL, MODULENAME, "Split", iSplit);
- db_set_dw(NULL, MODULENAME, "SplitMaxSize", iSplitMaxSize);
- db_set_dw(NULL, MODULENAME, "SendParts", iSendParts);
- db_set_dw(NULL, MODULENAME, "MarkRead", iMarkRead);
- db_set_dw(NULL, MODULENAME, "SendAndHistory", iSendAndHistory);
+ g_plugin.setDword("ForwardFrom", (DWORD)hForwardFrom);
+ g_plugin.setDword("ForwardTo", (DWORD)hForwardTo);
+ g_plugin.setDword("ForwardOnStatus", iForwardOnStatus);
+ g_plugin.setWString("ForwardTemplate", tszForwardTemplate);
+ g_plugin.setDword("Split", iSplit);
+ g_plugin.setDword("SplitMaxSize", iSplitMaxSize);
+ g_plugin.setDword("SendParts", iSendParts);
+ g_plugin.setDword("MarkRead", iMarkRead);
+ g_plugin.setDword("SendAndHistory", iSendAndHistory);
return TRUE;
}
break;