mirror of
https://github.com/kotatogram/kotatogram-desktop
synced 2025-08-30 22:25:12 +00:00
Use shared_ptr<Memento> for sections.
This commit is contained in:
@@ -253,12 +253,12 @@ void SessionNavigation::showRepliesForMessage(
|
||||
const auto channelId = history->channelId();
|
||||
//const auto item = _session->data().message(channelId, rootId);
|
||||
//if (!commentId && (!item || !item->repliesAreComments())) {
|
||||
// showSection(std::make_unique<HistoryView::RepliesMemento>(history, rootId));
|
||||
// showSection(std::make_shared<HistoryView::RepliesMemento>(history, rootId));
|
||||
// return;
|
||||
//} else if (const auto id = item ? item->commentsItemId() : FullMsgId()) {
|
||||
// if (const auto commentsItem = _session->data().message(id)) {
|
||||
// showSection(
|
||||
// std::make_unique<HistoryView::RepliesMemento>(commentsItem));
|
||||
// std::make_shared<HistoryView::RepliesMemento>(commentsItem));
|
||||
// return;
|
||||
// }
|
||||
//}
|
||||
@@ -314,7 +314,7 @@ void SessionNavigation::showRepliesForMessage(
|
||||
post->setRepliesOutboxReadTill(readTill->v);
|
||||
}
|
||||
}
|
||||
showSection(std::make_unique<HistoryView::RepliesMemento>(
|
||||
showSection(std::make_shared<HistoryView::RepliesMemento>(
|
||||
item,
|
||||
commentId));
|
||||
}
|
||||
@@ -342,7 +342,7 @@ void SessionNavigation::showPeerInfo(
|
||||
// Core::App().settings().setThirdSectionInfoEnabled(true);
|
||||
// Core::App().saveSettingsDelayed();
|
||||
//}
|
||||
showSection(std::make_unique<Info::Memento>(peer), params);
|
||||
showSection(std::make_shared<Info::Memento>(peer), params);
|
||||
}
|
||||
|
||||
void SessionNavigation::showPeerInfo(
|
||||
@@ -375,7 +375,7 @@ void SessionNavigation::showSettings(
|
||||
Settings::Type type,
|
||||
const SectionShow ¶ms) {
|
||||
showSection(
|
||||
std::make_unique<Info::Memento>(
|
||||
std::make_shared<Info::Memento>(
|
||||
Info::Settings::Tag{ _session->user() },
|
||||
Info::Section(type)),
|
||||
params);
|
||||
@@ -389,7 +389,7 @@ void SessionNavigation::showPollResults(
|
||||
not_null<PollData*> poll,
|
||||
FullMsgId contextId,
|
||||
const SectionShow ¶ms) {
|
||||
showSection(std::make_unique<Info::Memento>(poll, contextId), params);
|
||||
showSection(std::make_shared<Info::Memento>(poll, contextId), params);
|
||||
}
|
||||
|
||||
SessionController::SessionController(
|
||||
@@ -640,9 +640,9 @@ bool SessionController::jumpToChatListEntry(Dialogs::RowDescriptor row) {
|
||||
return true;
|
||||
//} else if (const auto feed = row.key.feed()) { // #feed
|
||||
// if (const auto item = session().data().message(row.fullId)) {
|
||||
// showSection(std::make_unique<HistoryFeed::Memento>(feed, item->position()));
|
||||
// showSection(std::make_shared<HistoryFeed::Memento>(feed, item->position()));
|
||||
// } else {
|
||||
// showSection(std::make_unique<HistoryFeed::Memento>(feed));
|
||||
// showSection(std::make_shared<HistoryFeed::Memento>(feed));
|
||||
// }
|
||||
}
|
||||
return false;
|
||||
@@ -1087,7 +1087,7 @@ void SessionController::showPeerHistory(
|
||||
}
|
||||
|
||||
void SessionController::showSection(
|
||||
std::unique_ptr<SectionMemento> &&memento,
|
||||
std::shared_ptr<SectionMemento> memento,
|
||||
const SectionShow ¶ms) {
|
||||
if (!params.thirdColumn && widget()->showSectionInExistingLayer(
|
||||
memento.get(),
|
||||
|
Reference in New Issue
Block a user