From 7336134ff34161b9940b203b6b003466606aad6c Mon Sep 17 00:00:00 2001 From: levlam Date: Tue, 21 Apr 2020 15:45:33 +0300 Subject: [PATCH] Implode dice emojis after parsing. GitOrigin-RevId: 6b1616409a240566a634c1e71fb194824e4c97b8 --- td/telegram/ConfigManager.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/td/telegram/ConfigManager.cpp b/td/telegram/ConfigManager.cpp index 4fb827b6..0d8d7344 100644 --- a/td/telegram/ConfigManager.cpp +++ b/td/telegram/ConfigManager.cpp @@ -1291,7 +1291,7 @@ void ConfigManager::process_app_config(tl_object_ptr &c string wallet_blockchain_name; string wallet_config; string ignored_restriction_reasons; - string dice_emojis; + vector dice_emojis; string dice_success_values; if (config->get_id() == telegram_api::jsonObject::ID) { for (auto &key_value : static_cast(config.get())->value_) { @@ -1348,10 +1348,7 @@ void ConfigManager::process_app_config(tl_object_ptr &c if (emoji->get_id() == telegram_api::jsonString::ID) { Slice emoji_text = static_cast(emoji.get())->value_; if (!emoji_text.empty()) { - if (!dice_emojis.empty()) { - dice_emojis += '\x01'; - } - dice_emojis.append(emoji_text.begin(), emoji_text.end()); + dice_emojis.push_back(emoji_text.str()); } else { LOG(ERROR) << "Receive empty dice emoji"; } @@ -1416,7 +1413,7 @@ void ConfigManager::process_app_config(tl_object_ptr &c } if (!dice_emojis.empty()) { - shared_config.set_option_string("dice_emojis", dice_emojis); + shared_config.set_option_string("dice_emojis", implode(dice_emojis, '\x01')); } if (!dice_success_values.empty()) { shared_config.set_option_string("dice_success_values", dice_success_values);