diff options
author | George Hazan <ghazan@miranda.im> | 2018-04-03 16:30:25 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2018-04-03 16:30:25 +0300 |
commit | 9613f96e6a6f96ad02a0fc926054132811ae2bb1 (patch) | |
tree | f8fe94a3efe7598a2af926f264d354f7a08fb943 /plugins/Clist_modern/src/modern_contact.cpp | |
parent | 2f880bda3aa2d8817ce43481df9d99b12ed82a58 (diff) |
Accounts() : iterator for accounts
Diffstat (limited to 'plugins/Clist_modern/src/modern_contact.cpp')
-rw-r--r-- | plugins/Clist_modern/src/modern_contact.cpp | 13 |
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;
}
|