diff options
author | Jacob Keeler <jacob.keeler@livioradio.com> | 2019-09-23 15:18:16 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-09-23 15:18:16 -0400 |
commit | a2484ebd100ba1e3021193755bccf5c2d9afb02a (patch) | |
tree | 549c84a3c0723ef7fd73359a1ac9fb46a80d8769 /src/components/policy/policy_regular/src | |
parent | 40d1eb07e8e89f5626a69c2722253c6bf7cb2055 (diff) | |
parent | 649dfcc7eff429f290c14f3264447a0fe8f77a6e (diff) | |
download | sdl_core-a2484ebd100ba1e3021193755bccf5c2d9afb02a.tar.gz |
Merge pull request #3025 from smartdevicelink/fix/gather_consumer_messages
Fix reading of Consumer Friendly Messages in PROPRIETARY mode
Diffstat (limited to 'src/components/policy/policy_regular/src')
-rw-r--r-- | src/components/policy/policy_regular/src/sql_pt_representation.cc | 27 |
1 files changed, 25 insertions, 2 deletions
diff --git a/src/components/policy/policy_regular/src/sql_pt_representation.cc b/src/components/policy/policy_regular/src/sql_pt_representation.cc index 60a4ef6021..7b2d01ef53 100644 --- a/src/components/policy/policy_regular/src/sql_pt_representation.cc +++ b/src/components/policy/policy_regular/src/sql_pt_representation.cc @@ -680,10 +680,33 @@ bool SQLPTRepresentation::GatherConsumerFriendlyMessages( if (query.Prepare(sql_pt::kCollectFriendlyMsg)) { while (query.Next()) { UserFriendlyMessage msg; + + msg.tts = query.GetString(1); + msg.label = query.GetString(2); + msg.line1 = query.GetString(3); + msg.line2 = query.GetString(4); + msg.text_body = query.GetString(5); msg.message_code = query.GetString(7); - std::string language = query.GetString(6); - (*messages->messages)[msg.message_code].languages[language]; + std::string language = query.GetString(6); + policy_table::Languages& languages = + (*messages->messages)[msg.message_code].languages; + policy_table::MessageString& specific_message = languages[language]; + if (!msg.tts.empty()) { + *(specific_message).tts = msg.tts; + } + if (!msg.label.empty()) { + *(specific_message).label = msg.label; + } + if (!msg.line1.empty()) { + *(specific_message).line1 = msg.line1; + } + if (!msg.line2.empty()) { + *(specific_message).line2 = msg.line2; + } + if (!msg.text_body.empty()) { + *(specific_message).textBody = msg.text_body; + } } } else { LOG4CXX_WARN(logger_, "Incorrect statement for select friendly messages."); |