diff --git a/Telegram/SourceFiles/dialogs/ui/dialogs_suggestions.cpp b/Telegram/SourceFiles/dialogs/ui/dialogs_suggestions.cpp index 0951bf756..849a0c85c 100644 --- a/Telegram/SourceFiles/dialogs/ui/dialogs_suggestions.cpp +++ b/Telegram/SourceFiles/dialogs/ui/dialogs_suggestions.cpp @@ -1402,7 +1402,8 @@ void Suggestions::setupChats() { .removeOneText = tr::lng_recent_remove(tr::now), .removeOne = removeOne, .removeAllText = tr::lng_recent_hide_top( - tr::now).replace('&', u"&&"_q), + tr::now, + Ui::Text::FixAmpersandInAction), .removeAllConfirm = tr::lng_recent_hide_sure(tr::now), .removeAll = removeAll, }); diff --git a/Telegram/SourceFiles/history/history_inner_widget.cpp b/Telegram/SourceFiles/history/history_inner_widget.cpp index a6b9f2669..f239ff276 100644 --- a/Telegram/SourceFiles/history/history_inner_widget.cpp +++ b/Telegram/SourceFiles/history/history_inner_widget.cpp @@ -38,6 +38,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include "ui/effects/message_sending_animation_controller.h" #include "ui/effects/reaction_fly_animation.h" #include "ui/text/text_isolated_emoji.h" +#include "ui/text/text_utilities.h" #include "ui/boxes/edit_factcheck_box.h" #include "ui/boxes/report_box_graphics.h" #include "ui/controls/delete_message_context_action.h" @@ -2549,15 +2550,16 @@ void HistoryInner::showContextMenu(QContextMenuEvent *e, bool showFromTouch) { const auto canReply = canSendReply || item->allowsForward(); if (canReply) { const auto selected = selectedQuote(item); - auto text = selected - ? tr::lng_context_quote_and_reply(tr::now) - : tr::lng_context_reply_msg(tr::now); + auto text = (selected + ? tr::lng_context_quote_and_reply + : tr::lng_context_reply_msg)( + tr::now, + Ui::Text::FixAmpersandInAction); const auto replyToItem = selected.item ? selected.item : item; const auto itemId = replyToItem->fullId(); const auto quote = selected.text; const auto quoteOffset = selected.offset; - text.replace('&', u"&&"_q); - _menu->addAction(text, [=] { + _menu->addAction(std::move(text), [=] { _widget->replyToMessage({ .messageId = itemId, .quote = quote, diff --git a/Telegram/SourceFiles/history/view/history_view_context_menu.cpp b/Telegram/SourceFiles/history/view/history_view_context_menu.cpp index 0fb338a88..50ffc31b3 100644 --- a/Telegram/SourceFiles/history/view/history_view_context_menu.cpp +++ b/Telegram/SourceFiles/history/view/history_view_context_menu.cpp @@ -635,12 +635,12 @@ bool AddReplyToMessageAction( } const auto "e = request.quote; - auto text = quote.text.empty() - ? tr::lng_context_reply_msg(tr::now) - : tr::lng_context_quote_and_reply(tr::now); - text.replace('&', u"&&"_q); - const auto itemId = item->fullId(); - menu->addAction(text, [=] { + auto text = (quote.text.empty() + ? tr::lng_context_reply_msg + : tr::lng_context_quote_and_reply)( + tr::now, + Ui::Text::FixAmpersandInAction); + menu->addAction(std::move(text), [=, itemId = item->fullId()] { list->replyToMessageRequestNotify({ .messageId = itemId, .quote = quote.text, diff --git a/Telegram/SourceFiles/platform/mac/main_window_mac.mm b/Telegram/SourceFiles/platform/mac/main_window_mac.mm index 6d3514d34..22ecff8ef 100644 --- a/Telegram/SourceFiles/platform/mac/main_window_mac.mm +++ b/Telegram/SourceFiles/platform/mac/main_window_mac.mm @@ -18,8 +18,9 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include "media/player/media_player_instance.h" #include "media/audio/media_audio.h" #include "storage/localstorage.h" -#include "window/window_session_controller.h" +#include "ui/text/text_utilities.h" #include "window/window_controller.h" +#include "window/window_session_controller.h" #include "platform/mac/touchbar/mac_touchbar_manager.h" #include "platform/platform_specific.h" #include "platform/platform_notifications_manager.h" @@ -519,7 +520,9 @@ void MainWindow::createGlobalMenu() { edit->addSeparator(); edit->addAction( - tr::lng_mac_menu_emoji_and_symbols(tr::now).replace('&', "&&"), + tr::lng_mac_menu_emoji_and_symbols( + tr::now, + Ui::Text::FixAmpersandInAction), this, [] { [NSApp orderFrontCharacterPalette:nil]; }, QKeySequence(Qt::MetaModifier | Qt::ControlModifier | Qt::Key_Space) diff --git a/Telegram/lib_ui b/Telegram/lib_ui index 64f99667a..3254aebf5 160000 --- a/Telegram/lib_ui +++ b/Telegram/lib_ui @@ -1 +1 @@ -Subproject commit 64f99667a6f45e9a896624c2d1c71fa143804aab +Subproject commit 3254aebf55133066e0a8775cabdfcef568b79625