2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 06:26:18 +00:00

Display active feed state in dialogs list.

This commit is contained in:
John Preston
2018-01-22 19:42:25 +03:00
parent 840b42934b
commit 47ad5ea98a
29 changed files with 381 additions and 250 deletions

View File

@@ -104,17 +104,25 @@ void WrapWidget::startInjectingActivePeerProfiles() {
using namespace rpl::mappers;
rpl::combine(
_wrap.value(),
_controller->parentController()->activePeer.value()
_controller->parentController()->activeChatValue()
) | rpl::filter(
(_1 == Wrap::Side) && (_2 != nullptr)
(_1 == Wrap::Side) && _2
) | rpl::map(
_2
) | rpl::start_with_next([this](not_null<PeerData*> peer) {
injectActivePeerProfile(peer);
) | rpl::start_with_next([this](Dialogs::Key key) {
injectActiveProfile(key);
}, lifetime());
}
void WrapWidget::injectActiveProfile(Dialogs::Key key) {
if (const auto peer = key.peer()) {
injectActivePeerProfile(peer);
} else if (const auto feed = key.feed()) {
// #TODO feed profile
}
}
void WrapWidget::injectActivePeerProfile(not_null<PeerData*> peer) {
const auto firstPeerId = hasStackHistory()
? _historyStack.front().section->peerId()
@@ -169,6 +177,10 @@ not_null<PeerData*> WrapWidget::peer() const {
return _controller->peer();
}
Dialogs::RowDescriptor WrapWidget::activeChat() const {
return Dialogs::RowDescriptor(App::history(peer()), MsgId(0));
}
// This was done for tabs support.
//
//void WrapWidget::createTabs() {