diff options
Diffstat (limited to 'plugins/CloudFile/src/services.cpp')
-rw-r--r-- | plugins/CloudFile/src/services.cpp | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/plugins/CloudFile/src/services.cpp b/plugins/CloudFile/src/services.cpp index 0b9e062b09..28cda47967 100644 --- a/plugins/CloudFile/src/services.cpp +++ b/plugins/CloudFile/src/services.cpp @@ -7,6 +7,15 @@ static int CompareServices(const CCloudService *p1, const CCloudService *p2) LIST<CCloudService> Services(10, CompareServices); +CCloudService* FindService(const char *szProto) +{ + for (auto &it : Services) + if (!mir_strcmp(it->GetAccountName(), szProto)) + return it; + + return nullptr; +} + static INT_PTR GetService(WPARAM wParam, LPARAM lParam) { ptrA accountName(mir_strdup((char*)wParam)); @@ -15,8 +24,7 @@ static INT_PTR GetService(WPARAM wParam, LPARAM lParam) if (accountName == nullptr) return 2; - CCloudServiceSearch search(accountName); - CCloudService *service = Services.find(&search); + CCloudService *service = FindService(accountName); if (service == nullptr) return 3; @@ -58,8 +66,7 @@ INT_PTR Upload(WPARAM wParam, LPARAM lParam) if (accountName == nullptr) return 2; - CCloudServiceSearch search(uploadData->accountName); - CCloudService *service = Services.find(&search); + CCloudService *service = FindService(uploadData->accountName); if (service == nullptr) return 3; |