2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-09-01 06:55:58 +00:00

Support basic feed display in chats list.

This commit is contained in:
John Preston
2018-01-05 18:57:18 +03:00
parent 9d2239291d
commit 782e70b171
28 changed files with 1092 additions and 527 deletions

View File

@@ -182,11 +182,13 @@ void DialogsWidget::activate() {
_inner->activate();
}
void DialogsWidget::createDialog(not_null<History*> history) {
auto creating = !history->inChatList(Dialogs::Mode::All);
_inner->createDialog(history);
if (creating && history->peer->migrateFrom()) {
if (const auto migrated = App::historyLoaded(history->peer->migrateFrom())) {
void DialogsWidget::createDialog(Dialogs::Key key) {
const auto creating = !key.entry()->inChatList(Dialogs::Mode::All);
_inner->createDialog(key);
const auto history = key.history();
if (creating && history && history->peer->migrateFrom()) {
if (const auto migrated = App::historyLoaded(
history->peer->migrateFrom())) {
if (migrated->inChatList(Dialogs::Mode::All)) {
removeDialog(migrated);
}
@@ -747,8 +749,7 @@ void DialogsWidget::dragMoveEvent(QDragMoveEvent *e) {
} else {
_chooseByDragTimer.start(ChoosePeerByDragTimeout);
}
PeerData *p = _inner->updateFromParentDrag(mapToGlobal(e->pos()));
if (p) {
if (_inner->updateFromParentDrag(mapToGlobal(e->pos()))) {
e->setDropAction(Qt::CopyAction);
} else {
e->setDropAction(Qt::IgnoreAction);
@@ -1118,8 +1119,8 @@ void DialogsWidget::scrollToPeer(not_null<History*> history, MsgId msgId) {
_inner->scrollToPeer(history, msgId);
}
void DialogsWidget::removeDialog(not_null<History*> history) {
_inner->removeDialog(history);
void DialogsWidget::removeDialog(Dialogs::Key key) {
_inner->removeDialog(key);
onFilterUpdate();
}