summaryrefslogtreecommitdiff
path: root/plugins/Non-IM Contact/src/timer.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2018-11-14 16:21:11 +0300
committerGeorge Hazan <ghazan@miranda.im>2018-11-14 16:21:11 +0300
commit36500a6016b2b4c73f6d1fa99fc2adb0bd8ef17c (patch)
treebbb25e67bbd1e89bcdb6313754e6a38aa99e2590 /plugins/Non-IM Contact/src/timer.cpp
parent74bea23a96d71d6ecee12a71dd024701c688a477 (diff)
Non-IM Contact -> g_plugin
Diffstat (limited to 'plugins/Non-IM Contact/src/timer.cpp')
-rw-r--r--plugins/Non-IM Contact/src/timer.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/plugins/Non-IM Contact/src/timer.cpp b/plugins/Non-IM Contact/src/timer.cpp
index ba658997d6..6e34352f2e 100644
--- a/plugins/Non-IM Contact/src/timer.cpp
+++ b/plugins/Non-IM Contact/src/timer.cpp
@@ -13,13 +13,13 @@ void timerFunc(void*)
{
char text[512], fn[16], szFileName[MAX_PATH], temp[MAX_PATH];
- int timerCount = db_get_w(0, MODNAME, "timerCount", 1) + 1;
+ int timerCount = g_plugin.getWord("timerCount", 1) + 1;
if (LCStatus == ID_STATUS_OFFLINE) {
killTimer();
return;
}
- db_set_w(0, MODNAME, "timerCount", (WORD)timerCount);
+ g_plugin.setWord("timerCount", (WORD)timerCount);
/* update the web pages*/
for (int i = 0;; i++) {
@@ -29,7 +29,7 @@ void timerFunc(void*)
if (!strncmp("http://", text, mir_strlen("http://")) || !strncmp("https://", text, mir_strlen("https://"))) {
mir_snprintf(fn, "fn%d_timer", i);
- int timer = db_get_w(0, MODNAME, fn, 60);
+ int timer = g_plugin.getWord(fn, 60);
if (timer && !(timerCount % timer)) {
if (!InternetDownloadFile(text)) {
mir_snprintf(szFileName, "%s\\plugins\\fn%d.html", getMimDir(temp), i);
@@ -41,7 +41,7 @@ void timerFunc(void*)
/* update all the contacts */
for (auto &hContact : Contacts(MODNAME)) {
- int timer = db_get_w(hContact, MODNAME, "Timer", 15);
+ int timer = g_plugin.getWord(hContact, "Timer", 15);
if (timer && !(timerCount % timer))
if (!db_get_static(hContact, MODNAME, "Name", text, _countof(text)))
replaceAllStrings(hContact);
@@ -77,7 +77,7 @@ int startTimer(int interval)
int killTimer()
{
if (timerId != 0) {
- db_set_w(0, MODNAME, "timerCount", 0);
+ g_plugin.setWord("timerCount", 0);
KillTimer(nullptr, timerId);
timerId = 0;
}