diff options
author | George Hazan <ghazan@miranda.im> | 2019-02-20 22:57:35 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2019-02-20 22:57:35 +0300 |
commit | a144aedf745f07beed2257b77839ad7c979b9eec (patch) | |
tree | e712d8c6a0c7617fb9c1c08a373fa71837b711c9 /plugins/CurrencyRates/src/CurrencyRatesProviderCurrencyConverter.cpp | |
parent | 713d02facf10fb187f7f74c32942d18e817a7934 (diff) |
CurrencyRates:
- fixes #1857 (rate limit error);
- code cleaning;
- version bump
Diffstat (limited to 'plugins/CurrencyRates/src/CurrencyRatesProviderCurrencyConverter.cpp')
-rw-r--r-- | plugins/CurrencyRates/src/CurrencyRatesProviderCurrencyConverter.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/plugins/CurrencyRates/src/CurrencyRatesProviderCurrencyConverter.cpp b/plugins/CurrencyRates/src/CurrencyRatesProviderCurrencyConverter.cpp index 6b4e845b73..050006fb7c 100644 --- a/plugins/CurrencyRates/src/CurrencyRatesProviderCurrencyConverter.cpp +++ b/plugins/CurrencyRates/src/CurrencyRatesProviderCurrencyConverter.cpp @@ -6,7 +6,10 @@ tstring build_url(const tstring &rsURL, const tstring &from, const tstring &to) { tostringstream o; - o << rsURL << L"?q=" << from << L"_" << to << "&compact=ultra&apiKey=" << API_KEY; + o << rsURL << L"?q=" << from << L"_" << to << "&compact=ultra"; + ptrA szApiKey(g_plugin.getStringA(DB_KEY_ApiKey)); + if (szApiKey != nullptr) + o << "&apiKey=" << szApiKey.get(); return o.str(); } @@ -50,9 +53,8 @@ INT_PTR CALLBACK OptDlgProc(HWND hdlg, UINT message, WPARAM wParam, LPARAM lPara const auto& rapCurrencyRatesProviders = pProviders->GetProviders(); for (auto i = rapCurrencyRatesProviders.begin(); i != rapCurrencyRatesProviders.end(); ++i) { const auto& pProvider = *i; - if (auto p = dynamic_cast<CCurrencyRatesProviderCurrencyConverter*>(pProvider.get())) { + if (auto p = dynamic_cast<CCurrencyRatesProviderCurrencyConverter*>(pProvider.get())) return p; - } } assert(!"We should never get here!"); |