From: Elena Mamontova Date: Mon, 22 Aug 2016 12:40:53 +0000 (+0300) Subject: Merge remote-tracking branch 'origin/stg-2.409' into ticket37 X-Git-Tag: 2.409~111 X-Git-Url: https://git.stg.codes/stg.git/commitdiff_plain/5c0444f61fac031c47cac726e0b0bb9188f6eb18?hp=f002c1b7709097d5405d672e7b07c5f00c9b3e36 Merge remote-tracking branch 'origin/stg-2.409' into ticket37 --- diff --git a/projects/stargazer/user_impl.cpp b/projects/stargazer/user_impl.cpp index f8335525..92528a6f 100644 --- a/projects/stargazer/user_impl.cpp +++ b/projects/stargazer/user_impl.cpp @@ -1508,13 +1508,18 @@ else if (!oldValue && newValue && user->IsInetable()) //----------------------------------------------------------------------------- void CHG_TARIFF_NOTIFIER::Notify(const std::string &, const std::string & newTariff) { +STG_LOCKER lock(&user->mutex); if (user->settings->GetReconnectOnTariffChange() && user->connected) user->Disconnect(false, "Change tariff"); user->tariff = user->tariffs->FindByName(newTariff); if (user->settings->GetReconnectOnTariffChange() && !user->authorizedBy.empty() && user->IsInetable()) + { + // This notifier gets called *before* changing the tariff, and in Connect we want to see new tariff name. + user->property.Conf().tariffName = newTariff; user->Connect(false); + } } //----------------------------------------------------------------------------- void CHG_CASH_NOTIFIER::Notify(const double & oldCash, const double & newCash)