2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-08-31 22:55:11 +00:00

Allow topic deletion.

This commit is contained in:
John Preston
2022-10-19 14:59:37 +04:00
parent adaa1d0c55
commit 7cdf20a7c5
43 changed files with 144 additions and 64 deletions

View File

@@ -25,7 +25,7 @@ AttachedStickers::AttachedStickers(not_null<ApiWrap*> api)
void AttachedStickers::request(
not_null<Window::SessionController*> controller,
MTPmessages_GetAttachedStickers &&mtpRequest) {
const auto weak = base::make_weak(controller.get());
const auto weak = base::make_weak(controller);
_api.request(_requestId).cancel();
_requestId = _api.request(
std::move(mtpRequest)

View File

@@ -83,7 +83,7 @@ void SendBotCallbackData(
if (withPassword) {
flags |= MTPmessages_GetBotCallbackAnswer::Flag::f_password;
}
const auto weak = base::make_weak(controller.get());
const auto weak = base::make_weak(controller);
const auto show = std::make_shared<Window::Show>(controller);
button->requestId = api->request(MTPmessages_GetBotCallbackAnswer(
MTP_flags(flags),
@@ -202,7 +202,7 @@ void SendBotCallbackDataWithPassword(
return;
}
api->cloudPassword().reload();
const auto weak = base::make_weak(controller.get());
const auto weak = base::make_weak(controller);
const auto show = std::make_shared<Window::Show>(controller);
SendBotCallbackData(controller, item, row, column, std::nullopt, [=](const QString &error) {
auto box = PrePasswordErrorBox(

View File

@@ -107,7 +107,7 @@ void CheckChatInvite(
const QString &hash,
ChannelData *invitePeekChannel) {
const auto session = &controller->session();
const auto weak = base::make_weak(controller.get());
const auto weak = base::make_weak(controller);
session->api().checkChatInvite(hash, [=](const MTPChatInvite &result) {
Core::App().hideMediaView();
result.match([=](const MTPDchatInvite &data) {

View File

@@ -66,7 +66,7 @@ void ToggleFavedSticker(
if (faved && !document->sticker()) {
return;
}
const auto weak = base::make_weak(controller.get());
const auto weak = base::make_weak(controller);
auto done = [=] {
document->owner().stickers().setFaved(weak.get(), document, faved);
};