diff options
author | George Hazan <george.hazan@gmail.com> | 2013-04-09 21:40:22 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2013-04-09 21:40:22 +0000 |
commit | 3dc0d9b0b7c30ea2f77d74c4ce5b6ccd67bd525c (patch) | |
tree | efee912ee654baafeb98efcd117921db6b7489bc /plugins/NewsAggregator/Src/Update.cpp | |
parent | bcb27264ba737778e5d3edad36088bacf74f0236 (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/Update.cpp')
-rw-r--r-- | plugins/NewsAggregator/Src/Update.cpp | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/plugins/NewsAggregator/Src/Update.cpp b/plugins/NewsAggregator/Src/Update.cpp index 7acc0373cc..c104a7d949 100644 --- a/plugins/NewsAggregator/Src/Update.cpp +++ b/plugins/NewsAggregator/Src/Update.cpp @@ -30,14 +30,12 @@ VOID CALLBACK timerProc(HWND hwnd, UINT uMsg, UINT_PTR idEvent, DWORD dwTime) // only run if it is not current updating and the auto update option is enabled
if (!ThreadRunning && !Miranda_Terminated()) {
BOOL HaveUpdates = FALSE;
- for (HANDLE hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
- if(IsMyContact(hContact)) {
- if (db_get_dw(hContact, MODULE, "UpdateTime", DEFAULT_UPDATE_TIME)) {
- double diff = difftime(time(NULL), db_get_dw(hContact, MODULE, "LastCheck", 0));
- if (db_get_b(NULL, MODULE, "AutoUpdate", 1) != 0 && diff >= db_get_dw(hContact, MODULE, "UpdateTime", DEFAULT_UPDATE_TIME) * 60) {
- UpdateListAdd(hContact);
- HaveUpdates = TRUE;
- }
+ for (HANDLE hContact = db_find_first(MODULE); hContact; hContact = db_find_next(hContact, MODULE)) {
+ if (db_get_dw(hContact, MODULE, "UpdateTime", DEFAULT_UPDATE_TIME)) {
+ double diff = difftime(time(NULL), db_get_dw(hContact, MODULE, "LastCheck", 0));
+ if (db_get_b(NULL, MODULE, "AutoUpdate", 1) != 0 && diff >= db_get_dw(hContact, MODULE, "UpdateTime", DEFAULT_UPDATE_TIME) * 60) {
+ UpdateListAdd(hContact);
+ HaveUpdates = TRUE;
}
}
}
|