diff --git a/Telegram/Resources/langs/lang.strings b/Telegram/Resources/langs/lang.strings index b53f00e9b..5c00d081d 100644 --- a/Telegram/Resources/langs/lang.strings +++ b/Telegram/Resources/langs/lang.strings @@ -855,6 +855,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL "lng_manage_discussion_group_posted" = "Everything you post in the channel is forwarded to this group."; "lng_manage_discussion_group_sure" = "Do you want to make {group} the discussion board for {channel}?"; "lng_manage_linked_channel_private" = "Any member in this group will be able to see the messages in the channel."; +"lng_manage_discussion_group_link" = "Link group"; "lng_manage_discussion_group_private" = "private group"; "lng_manage_linked_channel_about" = "{channel} is linking the group as its discussion board."; "lng_manage_linked_channel_unlink" = "Unlink channel"; diff --git a/Telegram/SourceFiles/boxes/confirm_box.cpp b/Telegram/SourceFiles/boxes/confirm_box.cpp index 8a3ae1b24..18874569a 100644 --- a/Telegram/SourceFiles/boxes/confirm_box.cpp +++ b/Telegram/SourceFiles/boxes/confirm_box.cpp @@ -33,7 +33,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include "observer_peer.h" TextParseOptions _confirmBoxTextOptions = { - TextParseLinks | TextParseMultiline | TextParseRichText, // flags + TextParseLinks | TextParseMultiline | TextParseMarkdown | TextParseRichText, // flags 0, // maxw 0, // maxh Qt::LayoutDirectionAuto, // dir diff --git a/Telegram/SourceFiles/boxes/peers/edit_linked_chat_box.cpp b/Telegram/SourceFiles/boxes/peers/edit_linked_chat_box.cpp index bd42a4b3a..d9b911e76 100644 --- a/Telegram/SourceFiles/boxes/peers/edit_linked_chat_box.cpp +++ b/Telegram/SourceFiles/boxes/peers/edit_linked_chat_box.cpp @@ -14,6 +14,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include "info/profile/info_profile_button.h" #include "info/profile/info_profile_values.h" #include "boxes/peer_list_box.h" +#include "boxes/confirm_box.h" #include "boxes/add_contact_box.h" #include "styles/style_boxes.h" #include "styles/style_info.h" @@ -81,7 +82,30 @@ object_ptr<Ui::RpWidget> SetupList( if (already) { Ui::showPeerHistory(chat, ShowAtUnreadMsgId); } else { - callback(chat); + auto text = lng_manage_discussion_group_sure__generic< + TextWithEntities + >( + lt_group, + BoldText(chat->name), + lt_channel, + BoldText(channel->name)); + if (!channel->isPublic()) { + text.append( + "\n\n" + lang(lng_manage_linked_channel_private)); + } + const auto box = std::make_shared<QPointer<BoxContent>>(); + const auto sure = [=] { + if (*box) { + (*box)->closeBox(); + } + callback(chat); + }; + *box = Ui::show( + Box<ConfirmBox>( + text, + lang(lng_manage_discussion_group_link), + sure), + LayerOption::KeepOther); } }; const auto controller = Ui::CreateChild<ListController>(