2
0
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:
John Preston
2020-11-12 18:46:17 +03:00
parent 4a8b59b788
commit f04b3da76a
25 changed files with 1158 additions and 1139 deletions

View File

@@ -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) {

View File

@@ -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

View File

@@ -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 {