diff options
author | George Hazan <george.hazan@gmail.com> | 2025-04-11 13:40:09 +0300 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2025-04-11 13:40:09 +0300 |
commit | c0ff932b9b6ba685160204fee0af84930f7aa922 (patch) | |
tree | 6b922da9dd5705c168d40f2eb691e453ddbf0713 /protocols/CloudFile/src/services.cpp | |
parent | 99584f314758d7ee3ef5faead704546ad0fdc10a (diff) |
fixes #4975 (CloudFile: нужно убирать учётку из подменю в меню контакта при её отключении) + some code cleaning
Diffstat (limited to 'protocols/CloudFile/src/services.cpp')
-rw-r--r-- | protocols/CloudFile/src/services.cpp | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/protocols/CloudFile/src/services.cpp b/protocols/CloudFile/src/services.cpp index f568f2f68c..386fdd26cc 100644 --- a/protocols/CloudFile/src/services.cpp +++ b/protocols/CloudFile/src/services.cpp @@ -2,15 +2,15 @@ static int CompareServices(const CCloudService *p1, const CCloudService *p2) { - return mir_strcmp(p1->GetAccountName(), p2->GetAccountName()); + return mir_strcmp(p1->m_szModuleName, p2->m_szModuleName); } -LIST<CCloudService> Services(10, CompareServices); +LIST<CCloudService> g_arServices(10, CompareServices); CCloudService* FindService(const char *szProto) { - for (auto &it : Services) - if (!mir_strcmp(it->GetAccountName(), szProto)) + for (auto &it : g_arServices) + if (!mir_strcmp(it->m_szModuleName, szProto)) return it; return nullptr; @@ -32,9 +32,8 @@ static INT_PTR GetService(WPARAM wParam, LPARAM lParam) if (service == nullptr) return 3; - info->accountName = service->GetAccountName(); - info->userName = service->GetUserName(); - + info->accountName = service->m_szModuleName; + info->userName = service->m_tszUserName; return 0; } @@ -44,9 +43,9 @@ static INT_PTR EnumServices(WPARAM wParam, LPARAM lParam) enumCFServiceFunc enumFunc = (enumCFServiceFunc)wParam; void *param = (void*)lParam; - for (auto &service : Services) { - info.accountName = service->GetAccountName(); - info.userName = service->GetUserName(); + for (auto &service : g_arServices) { + info.accountName = service->m_szModuleName; + info.userName = service->m_tszUserName; int res = enumFunc(&info, param); if (res != 0) return res; |