2019-05-23 21:38:49 +00:00
|
|
|
/*
|
|
|
|
This file is part of Telegram Desktop,
|
|
|
|
the official desktop application for the Telegram messaging service.
|
|
|
|
|
|
|
|
For license and copyright information please follow this link:
|
|
|
|
https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
|
|
|
*/
|
|
|
|
#include "boxes/peers/edit_linked_chat_box.h"
|
|
|
|
|
|
|
|
#include "lang/lang_keys.h"
|
|
|
|
#include "data/data_channel.h"
|
2019-05-30 13:12:10 +00:00
|
|
|
#include "data/data_chat.h"
|
2023-11-14 19:12:53 +00:00
|
|
|
#include "settings/settings_common.h" // AddButton.
|
2021-10-12 12:50:18 +00:00
|
|
|
#include "data/data_changes.h"
|
2019-05-23 21:38:49 +00:00
|
|
|
#include "ui/widgets/labels.h"
|
2023-11-14 19:12:53 +00:00
|
|
|
#include "ui/vertical_list.h"
|
2019-11-02 17:06:47 +00:00
|
|
|
#include "ui/widgets/buttons.h"
|
2019-05-23 21:38:49 +00:00
|
|
|
#include "ui/wrap/vertical_layout.h"
|
2023-08-14 23:10:26 +00:00
|
|
|
#include "ui/text/text_utilities.h" // Ui::Text::RichLangValue
|
2019-05-23 21:38:49 +00:00
|
|
|
#include "boxes/peer_list_box.h"
|
2021-10-18 21:36:55 +00:00
|
|
|
#include "ui/boxes/confirm_box.h"
|
2019-05-24 11:14:02 +00:00
|
|
|
#include "boxes/add_contact_box.h"
|
2019-05-30 12:25:19 +00:00
|
|
|
#include "apiwrap.h"
|
2019-07-24 11:45:24 +00:00
|
|
|
#include "main/main_session.h"
|
2022-03-03 07:42:49 +00:00
|
|
|
#include "window/window_session_controller.h"
|
2019-09-18 11:19:05 +00:00
|
|
|
#include "styles/style_layers.h"
|
2023-08-14 12:04:33 +00:00
|
|
|
#include "styles/style_menu_icons.h"
|
2019-05-23 21:38:49 +00:00
|
|
|
#include "styles/style_boxes.h"
|
2019-05-24 10:32:43 +00:00
|
|
|
#include "styles/style_info.h"
|
2023-01-07 05:16:35 +00:00
|
|
|
#include "styles/style_settings.h"
|
2019-05-23 21:38:49 +00:00
|
|
|
|
|
|
|
namespace {
|
|
|
|
|
2019-05-30 10:54:10 +00:00
|
|
|
constexpr auto kEnableSearchRowsCount = 10;
|
|
|
|
|
2019-05-30 13:12:10 +00:00
|
|
|
class Controller : public PeerListController, public base::has_weak_ptr {
|
2019-05-24 10:32:43 +00:00
|
|
|
public:
|
2019-05-30 10:54:10 +00:00
|
|
|
Controller(
|
2022-10-25 14:07:05 +00:00
|
|
|
not_null<Window::SessionNavigation*> navigation,
|
2019-05-30 10:54:10 +00:00
|
|
|
not_null<ChannelData*> channel,
|
|
|
|
ChannelData *chat,
|
2019-05-30 13:12:10 +00:00
|
|
|
const std::vector<not_null<PeerData*>> &chats,
|
2022-03-03 07:42:49 +00:00
|
|
|
Fn<void(ChannelData*)> callback,
|
|
|
|
Fn<void(not_null<PeerData*>)> showHistoryCallback);
|
2019-05-30 10:54:10 +00:00
|
|
|
|
2019-07-25 18:55:11 +00:00
|
|
|
Main::Session &session() const override;
|
2019-05-30 10:54:10 +00:00
|
|
|
void prepare() override;
|
|
|
|
void rowClicked(not_null<PeerListRow*> row) override;
|
|
|
|
int contentWidth() const override;
|
2019-05-24 10:32:43 +00:00
|
|
|
|
|
|
|
private:
|
2019-05-30 12:25:19 +00:00
|
|
|
void choose(not_null<ChannelData*> chat);
|
2019-05-30 13:12:10 +00:00
|
|
|
void choose(not_null<ChatData*> chat);
|
2019-05-30 12:25:19 +00:00
|
|
|
|
2022-10-25 14:07:05 +00:00
|
|
|
not_null<Window::SessionNavigation*> _navigation;
|
2019-05-30 10:54:10 +00:00
|
|
|
not_null<ChannelData*> _channel;
|
|
|
|
ChannelData *_chat = nullptr;
|
2019-05-30 13:12:10 +00:00
|
|
|
std::vector<not_null<PeerData*>> _chats;
|
2019-05-30 10:54:10 +00:00
|
|
|
Fn<void(ChannelData*)> _callback;
|
2022-03-03 07:42:49 +00:00
|
|
|
Fn<void(not_null<PeerData*>)> _showHistoryCallback;
|
2019-05-24 10:32:43 +00:00
|
|
|
|
2019-05-30 12:25:19 +00:00
|
|
|
ChannelData *_waitForFull = nullptr;
|
|
|
|
|
2022-03-03 07:42:49 +00:00
|
|
|
rpl::event_stream<not_null<PeerData*>> _showHistoryRequest;
|
2019-05-24 10:32:43 +00:00
|
|
|
};
|
|
|
|
|
2019-05-30 10:54:10 +00:00
|
|
|
Controller::Controller(
|
2022-10-25 14:07:05 +00:00
|
|
|
not_null<Window::SessionNavigation*> navigation,
|
2019-05-30 10:54:10 +00:00
|
|
|
not_null<ChannelData*> channel,
|
|
|
|
ChannelData *chat,
|
2019-05-30 13:12:10 +00:00
|
|
|
const std::vector<not_null<PeerData*>> &chats,
|
2022-03-03 07:42:49 +00:00
|
|
|
Fn<void(ChannelData*)> callback,
|
|
|
|
Fn<void(not_null<PeerData*>)> showHistoryCallback)
|
2022-10-25 14:07:05 +00:00
|
|
|
: _navigation(navigation)
|
|
|
|
, _channel(channel)
|
2019-05-30 10:54:10 +00:00
|
|
|
, _chat(chat)
|
|
|
|
, _chats(std::move(chats))
|
2022-03-03 07:42:49 +00:00
|
|
|
, _callback(std::move(callback))
|
|
|
|
, _showHistoryCallback(std::move(showHistoryCallback)) {
|
2021-10-12 12:50:18 +00:00
|
|
|
channel->session().changes().peerUpdates(
|
|
|
|
Data::PeerUpdate::Flag::FullInfo
|
|
|
|
) | rpl::filter([=](const Data::PeerUpdate &update) {
|
|
|
|
return (update.peer == _waitForFull);
|
|
|
|
}) | rpl::start_with_next([=](const Data::PeerUpdate &update) {
|
|
|
|
choose(std::exchange(_waitForFull, nullptr));
|
2019-05-30 12:25:19 +00:00
|
|
|
}, lifetime());
|
2019-05-30 10:54:10 +00:00
|
|
|
}
|
|
|
|
|
2019-07-25 18:55:11 +00:00
|
|
|
Main::Session &Controller::session() const {
|
|
|
|
return _channel->session();
|
|
|
|
}
|
|
|
|
|
2019-05-30 10:54:10 +00:00
|
|
|
int Controller::contentWidth() const {
|
|
|
|
return st::boxWidth;
|
|
|
|
}
|
|
|
|
|
|
|
|
void Controller::prepare() {
|
2019-05-30 13:12:10 +00:00
|
|
|
const auto appendRow = [&](not_null<PeerData*> chat) {
|
2021-04-01 21:04:10 +00:00
|
|
|
if (delegate()->peerListFindRow(chat->id.value)) {
|
2019-05-30 10:54:10 +00:00
|
|
|
return;
|
2019-05-24 10:32:43 +00:00
|
|
|
}
|
2019-05-30 10:54:10 +00:00
|
|
|
auto row = std::make_unique<PeerListRow>(chat);
|
2019-05-30 13:12:10 +00:00
|
|
|
const auto username = chat->userName();
|
2019-06-23 12:34:48 +00:00
|
|
|
row->setCustomStatus(!username.isEmpty()
|
|
|
|
? ('@' + username)
|
|
|
|
: (chat->isChannel() && !chat->isMegagroup())
|
|
|
|
? tr::lng_manage_linked_channel_private_status(tr::now)
|
|
|
|
: tr::lng_manage_discussion_group_private_status(tr::now));
|
2019-05-30 10:54:10 +00:00
|
|
|
delegate()->peerListAppendRow(std::move(row));
|
2019-05-24 10:32:43 +00:00
|
|
|
};
|
2019-05-30 10:54:10 +00:00
|
|
|
if (_chat) {
|
|
|
|
appendRow(_chat);
|
2019-05-24 10:32:43 +00:00
|
|
|
} else {
|
2019-05-30 10:54:10 +00:00
|
|
|
for (const auto chat : _chats) {
|
|
|
|
appendRow(chat);
|
|
|
|
}
|
|
|
|
if (_chats.size() >= kEnableSearchRowsCount) {
|
|
|
|
delegate()->peerListSetSearchMode(PeerListSearchMode::Enabled);
|
2019-05-24 10:32:43 +00:00
|
|
|
}
|
|
|
|
}
|
2019-05-30 10:54:10 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void Controller::rowClicked(not_null<PeerListRow*> row) {
|
|
|
|
if (_chat != nullptr) {
|
2022-03-03 07:42:49 +00:00
|
|
|
_showHistoryCallback(_chat);
|
2019-05-30 10:54:10 +00:00
|
|
|
return;
|
|
|
|
}
|
2019-05-30 13:12:10 +00:00
|
|
|
const auto peer = row->peer();
|
|
|
|
if (const auto channel = peer->asChannel()) {
|
|
|
|
if (channel->wasFullUpdated()) {
|
|
|
|
choose(channel);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
_waitForFull = channel;
|
|
|
|
channel->updateFull();
|
|
|
|
} else if (const auto chat = peer->asChat()) {
|
2019-05-30 12:25:19 +00:00
|
|
|
choose(chat);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void Controller::choose(not_null<ChannelData*> chat) {
|
2022-10-25 14:07:05 +00:00
|
|
|
if (chat->isForum()) {
|
|
|
|
ShowForumForDiscussionError(_navigation);
|
|
|
|
return;
|
|
|
|
}
|
2019-06-18 16:53:27 +00:00
|
|
|
auto text = tr::lng_manage_discussion_group_sure(
|
|
|
|
tr::now,
|
2019-05-30 10:54:10 +00:00
|
|
|
lt_group,
|
2022-08-09 11:12:19 +00:00
|
|
|
Ui::Text::Bold(chat->name()),
|
2019-05-30 10:54:10 +00:00
|
|
|
lt_channel,
|
2022-08-09 11:12:19 +00:00
|
|
|
Ui::Text::Bold(_channel->name()),
|
2019-06-18 16:53:27 +00:00
|
|
|
Ui::Text::WithEntities);
|
2019-05-30 10:54:10 +00:00
|
|
|
if (!_channel->isPublic()) {
|
|
|
|
text.append(
|
2019-06-18 16:53:27 +00:00
|
|
|
"\n\n" + tr::lng_manage_linked_channel_private(tr::now));
|
2019-05-30 10:54:10 +00:00
|
|
|
}
|
2019-05-31 16:47:31 +00:00
|
|
|
if (!chat->isPublic()) {
|
2019-06-18 16:53:27 +00:00
|
|
|
text.append(
|
|
|
|
"\n\n" + tr::lng_manage_discussion_group_private(tr::now));
|
2019-05-31 16:47:31 +00:00
|
|
|
if (chat->hiddenPreHistory()) {
|
|
|
|
text.append("\n\n");
|
2019-06-18 16:53:27 +00:00
|
|
|
text.append(tr::lng_manage_discussion_group_warning(
|
|
|
|
tr::now,
|
|
|
|
Ui::Text::RichLangValue));
|
2019-05-31 16:47:31 +00:00
|
|
|
}
|
2019-05-30 12:25:19 +00:00
|
|
|
}
|
2020-09-24 12:48:02 +00:00
|
|
|
const auto sure = [=](Fn<void()> &&close) {
|
|
|
|
close();
|
2019-05-30 10:54:10 +00:00
|
|
|
const auto onstack = _callback;
|
|
|
|
onstack(chat);
|
|
|
|
};
|
2023-11-08 20:43:42 +00:00
|
|
|
delegate()->peerListUiShow()->showBox(Ui::MakeConfirmBox({
|
2023-05-02 09:33:19 +00:00
|
|
|
.text = text,
|
|
|
|
.confirmed = sure,
|
|
|
|
.confirmText = tr::lng_manage_discussion_group_link(tr::now),
|
|
|
|
}));
|
2019-05-24 10:32:43 +00:00
|
|
|
}
|
|
|
|
|
2019-05-30 13:12:10 +00:00
|
|
|
void Controller::choose(not_null<ChatData*> chat) {
|
2019-06-18 16:53:27 +00:00
|
|
|
auto text = tr::lng_manage_discussion_group_sure(
|
|
|
|
tr::now,
|
2019-05-30 13:12:10 +00:00
|
|
|
lt_group,
|
2022-08-09 11:12:19 +00:00
|
|
|
Ui::Text::Bold(chat->name()),
|
2019-05-30 13:12:10 +00:00
|
|
|
lt_channel,
|
2022-08-09 11:12:19 +00:00
|
|
|
Ui::Text::Bold(_channel->name()),
|
2019-06-18 16:53:27 +00:00
|
|
|
Ui::Text::WithEntities);
|
2019-05-30 13:12:10 +00:00
|
|
|
if (!_channel->isPublic()) {
|
2019-06-18 16:53:27 +00:00
|
|
|
text.append("\n\n" + tr::lng_manage_linked_channel_private(tr::now));
|
2019-05-30 13:12:10 +00:00
|
|
|
}
|
2019-06-18 16:53:27 +00:00
|
|
|
text.append("\n\n" + tr::lng_manage_discussion_group_private(tr::now));
|
2019-05-30 13:12:10 +00:00
|
|
|
text.append("\n\n");
|
2019-06-18 16:53:27 +00:00
|
|
|
text.append(tr::lng_manage_discussion_group_warning(
|
|
|
|
tr::now,
|
|
|
|
Ui::Text::RichLangValue));
|
2020-09-24 12:48:02 +00:00
|
|
|
const auto sure = [=](Fn<void()> &&close) {
|
|
|
|
close();
|
2019-05-30 13:12:10 +00:00
|
|
|
const auto done = [=](not_null<ChannelData*> chat) {
|
|
|
|
const auto onstack = _callback;
|
|
|
|
onstack(chat);
|
|
|
|
};
|
|
|
|
chat->session().api().migrateChat(chat, crl::guard(this, done));
|
|
|
|
};
|
2023-11-08 20:43:42 +00:00
|
|
|
delegate()->peerListUiShow()->showBox(Ui::MakeConfirmBox({
|
2023-05-02 09:33:19 +00:00
|
|
|
.text = text,
|
|
|
|
.confirmed = sure,
|
|
|
|
.confirmText = tr::lng_manage_discussion_group_link(tr::now),
|
|
|
|
}));
|
2019-05-30 13:12:10 +00:00
|
|
|
}
|
|
|
|
|
2023-01-07 05:16:35 +00:00
|
|
|
[[nodiscard]] rpl::producer<TextWithEntities> About(
|
2019-05-24 10:32:43 +00:00
|
|
|
not_null<ChannelData*> channel,
|
|
|
|
ChannelData *chat) {
|
2023-01-07 05:16:35 +00:00
|
|
|
if (!channel->isBroadcast()) {
|
|
|
|
return tr::lng_manage_linked_channel_about(
|
|
|
|
lt_channel,
|
|
|
|
rpl::single(Ui::Text::Bold(chat->name())),
|
2019-06-18 16:53:27 +00:00
|
|
|
Ui::Text::WithEntities);
|
2023-01-07 05:16:35 +00:00
|
|
|
} else if (chat != nullptr) {
|
|
|
|
return tr::lng_manage_discussion_group_about_chosen(
|
|
|
|
lt_group,
|
|
|
|
rpl::single(Ui::Text::Bold(chat->name())),
|
|
|
|
Ui::Text::WithEntities);
|
|
|
|
}
|
|
|
|
return tr::lng_manage_discussion_group_about(Ui::Text::WithEntities);
|
2019-05-24 11:48:50 +00:00
|
|
|
}
|
|
|
|
|
2023-01-07 05:16:35 +00:00
|
|
|
[[nodiscard]] object_ptr<Ui::BoxContent> EditLinkedChatBox(
|
2019-07-25 18:55:11 +00:00
|
|
|
not_null<Window::SessionNavigation*> navigation,
|
2019-05-23 21:38:49 +00:00
|
|
|
not_null<ChannelData*> channel,
|
|
|
|
ChannelData *chat,
|
2019-05-30 13:12:10 +00:00
|
|
|
std::vector<not_null<PeerData*>> &&chats,
|
2019-06-01 08:27:05 +00:00
|
|
|
bool canEdit,
|
2019-05-23 21:38:49 +00:00
|
|
|
Fn<void(ChannelData*)> callback) {
|
2019-06-01 08:27:05 +00:00
|
|
|
Expects((channel->isBroadcast() && canEdit) || (chat != nullptr));
|
2019-05-23 21:38:49 +00:00
|
|
|
|
2023-01-07 05:16:35 +00:00
|
|
|
class ListBox final : public PeerListBox {
|
|
|
|
public:
|
|
|
|
ListBox(
|
|
|
|
QWidget *parent,
|
|
|
|
std::unique_ptr<PeerListController> controller,
|
|
|
|
Fn<void(not_null<ListBox*>)> init)
|
|
|
|
: PeerListBox(
|
|
|
|
parent,
|
|
|
|
std::move(controller),
|
|
|
|
[=](not_null<PeerListBox*>) { init(this); }) {
|
|
|
|
}
|
|
|
|
|
|
|
|
void showFinished() override {
|
|
|
|
_showFinished.fire({});
|
|
|
|
}
|
|
|
|
|
|
|
|
rpl::producer<> showFinishes() const {
|
|
|
|
return _showFinished.events();
|
|
|
|
}
|
|
|
|
|
|
|
|
private:
|
|
|
|
rpl::event_stream<> _showFinished;
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
const auto init = [=](not_null<ListBox*> box) {
|
2019-05-30 10:54:10 +00:00
|
|
|
auto above = object_ptr<Ui::VerticalLayout>(box);
|
2024-02-20 10:33:46 +00:00
|
|
|
Settings::AddDividerTextWithLottie(above, {
|
|
|
|
.lottie = u"discussion"_q,
|
|
|
|
.showFinished = box->showFinishes(),
|
|
|
|
.about = About(channel, chat),
|
|
|
|
});
|
2019-05-30 10:54:10 +00:00
|
|
|
if (!chat) {
|
2023-01-09 08:46:40 +00:00
|
|
|
Assert(channel->isBroadcast());
|
|
|
|
|
2023-11-14 19:12:53 +00:00
|
|
|
Ui::AddSkip(above);
|
2023-11-14 20:59:21 +00:00
|
|
|
Settings::AddButtonWithIcon(
|
2023-01-09 08:46:40 +00:00
|
|
|
above,
|
|
|
|
tr::lng_manage_discussion_group_create(),
|
|
|
|
st::infoCreateLinkedChatButton,
|
2023-08-14 12:04:33 +00:00
|
|
|
{ &st::menuIconGroupCreate }
|
2023-01-09 08:46:40 +00:00
|
|
|
)->addClickHandler([=, parent = above.data()] {
|
|
|
|
const auto guarded = crl::guard(parent, callback);
|
2023-05-02 09:33:19 +00:00
|
|
|
navigation->uiShow()->showBox(Box<GroupInfoBox>(
|
|
|
|
navigation,
|
|
|
|
GroupInfoBox::Type::Megagroup,
|
|
|
|
channel->name() + " Chat",
|
|
|
|
guarded));
|
2023-01-09 08:46:40 +00:00
|
|
|
});
|
2019-05-30 10:54:10 +00:00
|
|
|
}
|
|
|
|
box->peerListSetAboveWidget(std::move(above));
|
|
|
|
|
|
|
|
auto below = object_ptr<Ui::VerticalLayout>(box);
|
2019-06-01 08:27:05 +00:00
|
|
|
if (chat && canEdit) {
|
2023-11-14 20:59:21 +00:00
|
|
|
Settings::AddButtonWithIcon(
|
2023-01-07 05:16:35 +00:00
|
|
|
below,
|
|
|
|
(channel->isBroadcast()
|
|
|
|
? tr::lng_manage_discussion_group_unlink
|
|
|
|
: tr::lng_manage_linked_channel_unlink)(),
|
|
|
|
st::infoUnlinkChatButton,
|
2023-08-14 12:04:33 +00:00
|
|
|
{ &st::menuIconRemove }
|
2023-01-07 05:16:35 +00:00
|
|
|
)->addClickHandler([=] { callback(nullptr); });
|
2023-11-14 19:12:53 +00:00
|
|
|
Ui::AddSkip(below);
|
2019-05-30 10:54:10 +00:00
|
|
|
}
|
2023-11-14 19:12:53 +00:00
|
|
|
Ui::AddDividerText(
|
2023-01-07 05:16:35 +00:00
|
|
|
below,
|
|
|
|
(channel->isBroadcast()
|
|
|
|
? tr::lng_manage_discussion_group_posted
|
|
|
|
: tr::lng_manage_linked_channel_posted)());
|
2019-05-30 10:54:10 +00:00
|
|
|
box->peerListSetBelowWidget(std::move(below));
|
|
|
|
|
2019-06-18 15:00:55 +00:00
|
|
|
box->setTitle(channel->isBroadcast()
|
|
|
|
? tr::lng_manage_discussion_group()
|
|
|
|
: tr::lng_manage_linked_channel());
|
2019-06-18 16:53:27 +00:00
|
|
|
box->addButton(tr::lng_close(), [=] { box->closeBox(); });
|
2019-05-30 10:54:10 +00:00
|
|
|
};
|
2022-03-03 07:42:49 +00:00
|
|
|
auto showHistoryCallback = [=](not_null<PeerData*> peer) {
|
|
|
|
navigation->showPeerHistory(
|
|
|
|
peer,
|
|
|
|
Window::SectionShow::Way::ClearStack,
|
|
|
|
ShowAtUnreadMsgId);
|
|
|
|
};
|
2019-05-30 10:54:10 +00:00
|
|
|
auto controller = std::make_unique<Controller>(
|
2022-10-25 14:07:05 +00:00
|
|
|
navigation,
|
2019-05-30 10:54:10 +00:00
|
|
|
channel,
|
|
|
|
chat,
|
|
|
|
std::move(chats),
|
2022-03-03 07:42:49 +00:00
|
|
|
std::move(callback),
|
|
|
|
std::move(showHistoryCallback));
|
2023-01-07 05:16:35 +00:00
|
|
|
return Box<ListBox>(std::move(controller), init);
|
2019-05-23 21:38:49 +00:00
|
|
|
}
|
|
|
|
|
2019-05-30 10:54:10 +00:00
|
|
|
} // namespace
|
2019-05-23 21:38:49 +00:00
|
|
|
|
2019-09-18 11:19:05 +00:00
|
|
|
object_ptr<Ui::BoxContent> EditLinkedChatBox(
|
2019-07-25 18:55:11 +00:00
|
|
|
not_null<Window::SessionNavigation*> navigation,
|
2019-05-30 10:54:10 +00:00
|
|
|
not_null<ChannelData*> channel,
|
2019-05-30 13:12:10 +00:00
|
|
|
std::vector<not_null<PeerData*>> &&chats,
|
2019-05-30 10:54:10 +00:00
|
|
|
Fn<void(ChannelData*)> callback) {
|
2019-06-01 08:27:05 +00:00
|
|
|
return EditLinkedChatBox(
|
2019-07-25 18:55:11 +00:00
|
|
|
navigation,
|
2019-06-01 08:27:05 +00:00
|
|
|
channel,
|
|
|
|
nullptr,
|
|
|
|
std::move(chats),
|
|
|
|
true,
|
|
|
|
callback);
|
2019-05-30 10:54:10 +00:00
|
|
|
}
|
2019-05-23 21:38:49 +00:00
|
|
|
|
2019-09-18 11:19:05 +00:00
|
|
|
object_ptr<Ui::BoxContent> EditLinkedChatBox(
|
2019-07-25 18:55:11 +00:00
|
|
|
not_null<Window::SessionNavigation*> navigation,
|
2019-05-30 10:54:10 +00:00
|
|
|
not_null<ChannelData*> channel,
|
|
|
|
not_null<ChannelData*> chat,
|
2019-06-01 08:27:05 +00:00
|
|
|
bool canEdit,
|
2019-05-30 10:54:10 +00:00
|
|
|
Fn<void(ChannelData*)> callback) {
|
2019-07-25 18:55:11 +00:00
|
|
|
return EditLinkedChatBox(
|
|
|
|
navigation,
|
|
|
|
channel,
|
|
|
|
chat,
|
|
|
|
{},
|
|
|
|
canEdit,
|
|
|
|
callback);
|
2019-05-23 21:38:49 +00:00
|
|
|
}
|
2022-10-25 14:07:05 +00:00
|
|
|
|
|
|
|
void ShowForumForDiscussionError(
|
|
|
|
not_null<Window::SessionNavigation*> navigation) {
|
2023-05-02 09:33:19 +00:00
|
|
|
navigation->showToast(
|
|
|
|
tr::lng_forum_topics_no_discussion(
|
2022-10-25 14:07:05 +00:00
|
|
|
tr::now,
|
2023-05-02 09:33:19 +00:00
|
|
|
Ui::Text::RichLangValue));
|
2022-10-25 14:07:05 +00:00
|
|
|
}
|