mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-08-31 06:26:18 +00:00
Add return from bot switch_pm to Scheduled/Replies.
This commit is contained in:
@@ -1814,24 +1814,17 @@ void InnerWidget::contextMenuEvent(QContextMenuEvent *e) {
|
||||
} else {
|
||||
fillArchiveSearchMenu(_menu.get());
|
||||
}
|
||||
} else if (const auto history = row.key.history()) {
|
||||
Window::FillPeerMenu(
|
||||
} else {
|
||||
Window::FillDialogsEntryMenu(
|
||||
_controller,
|
||||
Window::PeerMenuRequest{
|
||||
.peer = history->peer,
|
||||
.source = Window::PeerMenuRequest::Source::ChatsList,
|
||||
Dialogs::EntryState{
|
||||
.key = row.key,
|
||||
.section = Dialogs::EntryState::Section::ChatsList,
|
||||
.filterId = _filterId,
|
||||
},
|
||||
[&](const QString &text, Fn<void()> callback) {
|
||||
return _menu->addAction(text, std::move(callback));
|
||||
});
|
||||
} else if (const auto folder = row.key.folder()) {
|
||||
Window::FillFolderMenu(
|
||||
_controller,
|
||||
Window::FolderMenuRequest{ folder },
|
||||
[&](const QString &text, Fn<void()> callback) {
|
||||
return _menu->addAction(text, std::move(callback));
|
||||
});
|
||||
}
|
||||
connect(_menu.get(), &QObject::destroyed, [=] {
|
||||
if (_menuRow.key) {
|
||||
|
@@ -109,4 +109,21 @@ inline bool operator>=(const RowDescriptor &a, const RowDescriptor &b) {
|
||||
return !(a < b);
|
||||
}
|
||||
|
||||
struct EntryState {
|
||||
enum class Section {
|
||||
History,
|
||||
Profile,
|
||||
ChatsList,
|
||||
Scheduled,
|
||||
Pinned,
|
||||
Replies,
|
||||
};
|
||||
|
||||
Key key;
|
||||
Section section = Section::History;
|
||||
FilterId filterId = 0;
|
||||
MsgId rootId = 0;
|
||||
MsgId currentReplyToId = 0;
|
||||
};
|
||||
|
||||
} // namespace Dialogs
|
||||
|
@@ -525,7 +525,7 @@ void Widget::refreshFolderTopBar() {
|
||||
_folderTopBar->setActiveChat(
|
||||
HistoryView::TopBarWidget::ActiveChat{
|
||||
.key = _openedFolder,
|
||||
.section = HistoryView::TopBarWidget::Section::Dialogs,
|
||||
.section = Dialogs::EntryState::Section::ChatsList,
|
||||
},
|
||||
nullptr);
|
||||
} else {
|
||||
|
Reference in New Issue
Block a user