summaryrefslogtreecommitdiff
path: root/plugins/Non-IM Contact/src
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/Non-IM Contact/src')
-rw-r--r--plugins/Non-IM Contact/src/files.cpp47
-rw-r--r--plugins/Non-IM Contact/src/timer.cpp12
2 files changed, 27 insertions, 32 deletions
diff --git a/plugins/Non-IM Contact/src/files.cpp b/plugins/Non-IM Contact/src/files.cpp
index cdf17aed7c..d559fc6df8 100644
--- a/plugins/Non-IM Contact/src/files.cpp
+++ b/plugins/Non-IM Contact/src/files.cpp
@@ -14,31 +14,28 @@ INT_PTR exportContacts(WPARAM wParam,LPARAM lParam)
if (!file)
return 0;
- for (HANDLE hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
- const char* proto = GetContactProto(hContact);
- if (proto && !strcmp(proto, MODNAME)) {
- int tmp;
- char DBVar[1024];
- if (db_get_static(hContact, MODNAME, "Name", DBVar)) {
- fprintf(file, "\r\n[Non-IM Contact]\r\nName=%s\r\n", DBVar);
- if (db_get_static(hContact, MODNAME, "ProgramString", DBVar))
- fprintf(file, "ProgramString=%s\r\n", DBVar);
- if (db_get_static(hContact, MODNAME, "ProgramParamString", DBVar))
- fprintf(file, "ProgramParamString=%s\r\n", DBVar);
- if (db_get_static(hContact, MODNAME, "ToolTip", DBVar))
- fprintf(file, "ToolTip=%s</tooltip>\r\n", DBVar);
- if (db_get_static(hContact, "CList", "Group", DBVar))
- fprintf(file, "Group=%s\r\n", DBVar);
- if (tmp = db_get_w(hContact, MODNAME, "Icon", 40072))
- fprintf(file, "Icon=%d\r\n", tmp);
- if (tmp = db_get_b(hContact, MODNAME, "UseTimer", 0))
- fprintf(file, "UseTimer=%d\r\n", tmp);
- if (tmp = db_get_b(hContact, MODNAME, "Minutes", 1))
- fprintf(file, "Minutes=%d\r\n", tmp);
- if (tmp = db_get_w(hContact, MODNAME, "Timer", 0))
- fprintf(file, "Timer=%d\r\n", tmp);
- fprintf(file, "[/Non-IM Contact]\r\n");
- }
+ for (HANDLE hContact = db_find_first(MODNAME); hContact; hContact = db_find_next(hContact, MODNAME)) {
+ int tmp;
+ char DBVar[1024];
+ if (db_get_static(hContact, MODNAME, "Name", DBVar)) {
+ fprintf(file, "\r\n[Non-IM Contact]\r\nName=%s\r\n", DBVar);
+ if (db_get_static(hContact, MODNAME, "ProgramString", DBVar))
+ fprintf(file, "ProgramString=%s\r\n", DBVar);
+ if (db_get_static(hContact, MODNAME, "ProgramParamString", DBVar))
+ fprintf(file, "ProgramParamString=%s\r\n", DBVar);
+ if (db_get_static(hContact, MODNAME, "ToolTip", DBVar))
+ fprintf(file, "ToolTip=%s</tooltip>\r\n", DBVar);
+ if (db_get_static(hContact, "CList", "Group", DBVar))
+ fprintf(file, "Group=%s\r\n", DBVar);
+ if (tmp = db_get_w(hContact, MODNAME, "Icon", 40072))
+ fprintf(file, "Icon=%d\r\n", tmp);
+ if (tmp = db_get_b(hContact, MODNAME, "UseTimer", 0))
+ fprintf(file, "UseTimer=%d\r\n", tmp);
+ if (tmp = db_get_b(hContact, MODNAME, "Minutes", 1))
+ fprintf(file, "Minutes=%d\r\n", tmp);
+ if (tmp = db_get_w(hContact, MODNAME, "Timer", 0))
+ fprintf(file, "Timer=%d\r\n", tmp);
+ fprintf(file, "[/Non-IM Contact]\r\n");
}
}
fclose(file);
diff --git a/plugins/Non-IM Contact/src/timer.cpp b/plugins/Non-IM Contact/src/timer.cpp
index 42e2b47df1..0abd79e458 100644
--- a/plugins/Non-IM Contact/src/timer.cpp
+++ b/plugins/Non-IM Contact/src/timer.cpp
@@ -40,13 +40,11 @@ void timerFunc(LPVOID di)
}
/* update all the contacts */
- for (HANDLE hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
- if (!strcmp(MODNAME, GetContactProto(hContact))) {
- int timer = db_get_w(hContact, MODNAME, "Timer", 15);
- if (timer && !(timerCount % timer))
- if (db_get_static(hContact, MODNAME, "Name", text))
- replaceAllStrings(hContact);
- }
+ for (HANDLE hContact = db_find_first(MODNAME); hContact; hContact = db_find_next(hContact, MODNAME)) {
+ int timer = db_get_w(hContact, MODNAME, "Timer", 15);
+ if (timer && !(timerCount % timer))
+ if (db_get_static(hContact, MODNAME, "Name", text))
+ replaceAllStrings(hContact);
}
}