Skip to content

Commit

Permalink
update for repeated subscription
Browse files Browse the repository at this point in the history
  • Loading branch information
mked-luxoft committed Oct 12, 2018
1 parent 7719ef2 commit 9ac5865
Showing 1 changed file with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,17 @@ void GetInteriorVehicleDataRequest::ProcessResponseToMobileFromCache(
response_msg_params[message_params::kIsSubscribed] =
request_msg_params[message_params::kSubscribe].asBool();
if (request_msg_params[message_params::kSubscribe].asBool()) {
auto extension = RCHelpers::GetRCExtension(*app);
const auto extension = RCHelpers::GetRCExtension(*app);
DCHECK(extension);
const bool is_app_already_subscribed =
extension->IsSubscibedToInteriorVehicleData(ModuleType());
if (is_app_already_subscribed) {
LOG4CXX_WARN(logger_, "Application is already subscribed");
SendResponse(
true, mobile_apis::Result::WARNINGS, nullptr, &response_msg_params);
return;
}

extension->SubscribeToInteriorVehicleData(ModuleType());
app->UpdateHash();
}
Expand Down

0 comments on commit 9ac5865

Please sign in to comment.