2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-09-03 16:15:13 +00:00

Implement drag-n-drop to forum topics.

This commit is contained in:
John Preston
2022-11-01 11:18:56 +04:00
parent 6d215d3729
commit d5ea0149e8
23 changed files with 232 additions and 133 deletions

View File

@@ -1670,26 +1670,19 @@ void SessionController::showPeerHistory(
}
void SessionController::showMessage(
not_null<const HistoryItem*> item) {
not_null<const HistoryItem*> item,
const SectionShow &params) {
_window->invokeForSessionController(
&item->history()->peer->session().account(),
&item->history()->session().account(),
item->history()->peer,
[&](not_null<SessionController*> controller) {
if (item->isScheduled()) {
controller->showSection(
std::make_shared<HistoryView::ScheduledMemento>(
item->history()),
SectionShow::Way::ClearStack);
} else if (const auto topic = item->topic()) {
controller->showTopic(
topic,
item->id,
SectionShow::Way::ClearStack);
params);
} else {
controller->showPeerHistory(
item->history()->peer,
SectionShow::Way::ClearStack,
item->id);
controller->content()->showMessage(item, params);
}
});
}