mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-04-16 06:07:06 +02:00
Show pin confirmation correctly in topics.
This commit is contained in:
parent
b782569faf
commit
05b8b9f22e
3 changed files with 9 additions and 6 deletions
|
@ -11,6 +11,8 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
|||
#include "data/data_chat.h"
|
||||
#include "data/data_user.h"
|
||||
#include "lang/lang_keys.h"
|
||||
#include "history/history.h"
|
||||
#include "history/history_item.h"
|
||||
#include "main/main_session.h"
|
||||
#include "ui/boxes/confirm_box.h"
|
||||
#include "ui/widgets/checkbox.h"
|
||||
|
@ -41,15 +43,17 @@ namespace {
|
|||
|
||||
void PinMessageBox(
|
||||
not_null<Ui::GenericBox*> box,
|
||||
not_null<PeerData*> peer,
|
||||
MsgId msgId) {
|
||||
not_null<HistoryItem*> item) {
|
||||
struct State {
|
||||
QPointer<Ui::Checkbox> pinForPeer;
|
||||
QPointer<Ui::Checkbox> notify;
|
||||
mtpRequestId requestId = 0;
|
||||
};
|
||||
|
||||
const auto pinningOld = IsOldForPin(msgId, peer, MsgId(0));
|
||||
const auto peer = item->history()->peer;
|
||||
const auto msgId = item->id;
|
||||
const auto topicRootId = item->topic() ? item->topicRootId() : MsgId();
|
||||
const auto pinningOld = IsOldForPin(msgId, peer, topicRootId);
|
||||
const auto state = box->lifetime().make_state<State>();
|
||||
const auto api = box->lifetime().make_state<MTP::Sender>(
|
||||
&peer->session().mtp());
|
||||
|
|
|
@ -13,5 +13,4 @@ class GenericBox;
|
|||
|
||||
void PinMessageBox(
|
||||
not_null<Ui::GenericBox*> box,
|
||||
not_null<PeerData*> peer,
|
||||
MsgId msgId);
|
||||
not_null<HistoryItem*> item);
|
||||
|
|
|
@ -2154,7 +2154,7 @@ void ToggleMessagePinned(
|
|||
}
|
||||
if (pin) {
|
||||
navigation->parentController()->show(
|
||||
Box(PinMessageBox, item->history()->peer, item->id),
|
||||
Box(PinMessageBox, item),
|
||||
Ui::LayerOption::CloseOther);
|
||||
} else {
|
||||
const auto peer = item->history()->peer;
|
||||
|
|
Loading…
Add table
Reference in a new issue