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/YAMN/src/proto | |
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/YAMN/src/proto')
-rw-r--r-- | plugins/YAMN/src/proto/pop3/pop3comm.cpp | 28 |
1 files changed, 12 insertions, 16 deletions
diff --git a/plugins/YAMN/src/proto/pop3/pop3comm.cpp b/plugins/YAMN/src/proto/pop3/pop3comm.cpp index dcb2d55b59..da50c74b56 100644 --- a/plugins/YAMN/src/proto/pop3/pop3comm.cpp +++ b/plugins/YAMN/src/proto/pop3/pop3comm.cpp @@ -278,23 +278,19 @@ int RegisterPOP3Plugin(WPARAM,LPARAM) for (Finder=POP3Plugin->FirstAccount;Finder != NULL;Finder=Finder->Next)
{
Finder->hContact = NULL;
- for (HANDLE hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
- szProto = GetContactProto(hContact);
- if (szProto != NULL && strcmp(szProto, YAMN_DBMODULE)==0)
- {
- if (!db_get_s(hContact,YAMN_DBMODULE,"Id",&dbv)) {
- if ( strcmp( dbv.pszVal, Finder->Name) == 0) {
- Finder->hContact = hContact;
- db_set_w(Finder->hContact, YAMN_DBMODULE, "Status", ID_STATUS_ONLINE);
- db_set_s(Finder->hContact, "CList", "StatusMsg", Translate("No new mail message"));
- if ((Finder->Flags & YAMN_ACC_ENA) && (Finder->NewMailN.Flags & YAMN_ACC_CONT))
- db_unset(Finder->hContact, "CList", "Hidden");
-
- if (!(Finder->Flags & YAMN_ACC_ENA) || !(Finder->NewMailN.Flags & YAMN_ACC_CONT))
- db_set_b(Finder->hContact, "CList", "Hidden", 1);
- }
- db_free(&dbv);
+ for (HANDLE hContact = db_find_first(YAMN_DBMODULE); hContact; hContact = db_find_next(hContact, YAMN_DBMODULE)) {
+ if (!db_get_s(hContact,YAMN_DBMODULE,"Id",&dbv)) {
+ if ( strcmp( dbv.pszVal, Finder->Name) == 0) {
+ Finder->hContact = hContact;
+ db_set_w(Finder->hContact, YAMN_DBMODULE, "Status", ID_STATUS_ONLINE);
+ db_set_s(Finder->hContact, "CList", "StatusMsg", Translate("No new mail message"));
+ if ((Finder->Flags & YAMN_ACC_ENA) && (Finder->NewMailN.Flags & YAMN_ACC_CONT))
+ db_unset(Finder->hContact, "CList", "Hidden");
+
+ if (!(Finder->Flags & YAMN_ACC_ENA) || !(Finder->NewMailN.Flags & YAMN_ACC_CONT))
+ db_set_b(Finder->hContact, "CList", "Hidden", 1);
}
+ db_free(&dbv);
}
}
|