summaryrefslogtreecommitdiff
path: root/plugins/NewsAggregator/Src/Services.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2013-04-09 21:40:22 +0000
committerGeorge Hazan <george.hazan@gmail.com>2013-04-09 21:40:22 +0000
commit3dc0d9b0b7c30ea2f77d74c4ce5b6ccd67bd525c (patch)
treeefee912ee654baafeb98efcd117921db6b7489bc /plugins/NewsAggregator/Src/Services.cpp
parentbcb27264ba737778e5d3edad36088bacf74f0236 (diff)
- the kernel filters out contacts by proto names much faster than a plugin;
- database cycles simplified git-svn-id: http://svn.miranda-ng.org/main/trunk@4404 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/NewsAggregator/Src/Services.cpp')
-rw-r--r--plugins/NewsAggregator/Src/Services.cpp21
1 files changed, 9 insertions, 12 deletions
diff --git a/plugins/NewsAggregator/Src/Services.cpp b/plugins/NewsAggregator/Src/Services.cpp
index da1c899b86..43ecd6bd14 100644
--- a/plugins/NewsAggregator/Src/Services.cpp
+++ b/plugins/NewsAggregator/Src/Services.cpp
@@ -33,9 +33,8 @@ static void __cdecl WorkingThread(void* param)
{
int nStatus = (int)param;
- for (HANDLE hContact = db_find_first(); hContact; hContact = db_find_next(hContact))
- if(IsMyContact(hContact))
- SetContactStatus(hContact, nStatus);
+ for (HANDLE hContact = db_find_first(MODULE); hContact; hContact = db_find_next(hContact, MODULE))
+ SetContactStatus(hContact, nStatus);
}
int OnFoldersChanged(WPARAM, LPARAM)
@@ -52,12 +51,10 @@ int NewsAggrInit(WPARAM wParam, LPARAM lParam)
else
lstrcpyn(tszRoot, VARST( _T("%miranda_userdata%\\Avatars\\"_T(DEFAULT_AVATARS_FOLDER))), SIZEOF(tszRoot));
- for (HANDLE hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
- if(IsMyContact(hContact)) {
- if (!db_get_b(NULL, MODULE, "StartupRetrieve", 1))
- db_set_dw(hContact, MODULE, "LastCheck", time(NULL));
- SetContactStatus(hContact, ID_STATUS_ONLINE);
- }
+ for (HANDLE hContact = db_find_first(MODULE); hContact; hContact = db_find_next(hContact, MODULE)) {
+ if (!db_get_b(NULL, MODULE, "StartupRetrieve", 1))
+ db_set_dw(hContact, MODULE, "LastCheck", time(NULL));
+ SetContactStatus(hContact, ID_STATUS_ONLINE);
}
NetlibInit();
@@ -154,10 +151,10 @@ INT_PTR NewsAggrGetInfo(WPARAM wParam,LPARAM lParam)
INT_PTR CheckAllFeeds(WPARAM wParam,LPARAM lParam)
{
- for (HANDLE hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
- if (IsMyContact(hContact) && lParam && db_get_dw(hContact, MODULE, "UpdateTime", DEFAULT_UPDATE_TIME))
+ for (HANDLE hContact = db_find_first(MODULE); hContact; hContact = db_find_next(hContact, MODULE)) {
+ if (lParam && db_get_dw(hContact, MODULE, "UpdateTime", DEFAULT_UPDATE_TIME))
UpdateListAdd(hContact);
- else if (IsMyContact(hContact) && !lParam)
+ else if (!lParam)
UpdateListAdd(hContact);
}
if (!ThreadRunning)