mirror of
https://github.com/kotatogram/kotatogram-desktop
synced 2025-09-04 00:25:17 +00:00
Start HistoryView::Message class for item view.
This commit is contained in:
@@ -9,6 +9,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||
|
||||
#include "window/main_window.h"
|
||||
#include "info/info_memento.h"
|
||||
#include "history/view/history_view_message.h"
|
||||
#include "mainwidget.h"
|
||||
#include "mainwindow.h"
|
||||
#include "styles/style_window.h"
|
||||
@@ -252,13 +253,13 @@ void Controller::showJumpToDate(not_null<PeerData*> peer, QDate requestedDate) {
|
||||
auto currentPeerDate = [peer] {
|
||||
if (auto history = App::historyLoaded(peer)) {
|
||||
if (history->scrollTopItem) {
|
||||
return history->scrollTopItem->date.date();
|
||||
return history->scrollTopItem->data()->date.date();
|
||||
} else if (history->loadedAtTop() && !history->isEmpty() && history->peer->migrateFrom()) {
|
||||
if (auto migrated = App::historyLoaded(history->peer->migrateFrom())) {
|
||||
if (migrated->scrollTopItem) {
|
||||
// We're up in the migrated history.
|
||||
// So current date is the date of first message here.
|
||||
return history->blocks.front()->items.front()->date.date();
|
||||
return history->blocks.front()->messages.front()->data()->date.date();
|
||||
}
|
||||
}
|
||||
} else if (!history->chatsListDate().isNull()) {
|
||||
@@ -287,7 +288,7 @@ void Controller::showJumpToDate(not_null<PeerData*> peer, QDate requestedDate) {
|
||||
if (auto history = App::historyLoaded(chat)) {
|
||||
if (history->loadedAtTop()) {
|
||||
if (!history->isEmpty()) {
|
||||
return history->blocks.front()->items.front()->date.date();
|
||||
return history->blocks.front()->messages.front()->data()->date.date();
|
||||
}
|
||||
} else {
|
||||
return startDate();
|
||||
@@ -297,7 +298,7 @@ void Controller::showJumpToDate(not_null<PeerData*> peer, QDate requestedDate) {
|
||||
if (auto history = App::historyLoaded(peer)) {
|
||||
if (history->loadedAtTop()) {
|
||||
if (!history->isEmpty()) {
|
||||
return history->blocks.front()->items.front()->date.date();
|
||||
return history->blocks.front()->messages.front()->data()->date.date();
|
||||
}
|
||||
return QDate::currentDate();
|
||||
}
|
||||
|
Reference in New Issue
Block a user