summaryrefslogtreecommitdiff
path: root/plugins/Clist_modern/src/modern_contact.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2018-04-03 16:30:25 +0300
committerGeorge Hazan <ghazan@miranda.im>2018-04-03 16:30:25 +0300
commit9613f96e6a6f96ad02a0fc926054132811ae2bb1 (patch)
treef8fe94a3efe7598a2af926f264d354f7a08fb943 /plugins/Clist_modern/src/modern_contact.cpp
parent2f880bda3aa2d8817ce43481df9d99b12ed82a58 (diff)
Accounts() : iterator for accounts
Diffstat (limited to 'plugins/Clist_modern/src/modern_contact.cpp')
-rw-r--r--plugins/Clist_modern/src/modern_contact.cpp13
1 files changed, 4 insertions, 9 deletions
diff --git a/plugins/Clist_modern/src/modern_contact.cpp b/plugins/Clist_modern/src/modern_contact.cpp
index 3e15378cf1..c56b9622f9 100644
--- a/plugins/Clist_modern/src/modern_contact.cpp
+++ b/plugins/Clist_modern/src/modern_contact.cpp
@@ -76,15 +76,10 @@ DWORD CompareContacts2_getLMTime(MCONTACT hContact)
int GetProtoIndex(char * szName)
{
- if (szName) {
- PROTOACCOUNT **accs = nullptr;
- int accCount = 0;
- Proto_EnumAccounts(&accCount, &accs);
-
- for (int i = 0; i < accCount; i++)
- if (!mir_strcmpi(szName, accs[i]->szModuleName))
- return accs[i]->iOrder;
- }
+ if (szName)
+ for (auto &pa : Accounts())
+ if (!mir_strcmpi(szName, pa->szModuleName))
+ return pa->iOrder;
return -1;
}