2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-09-02 23:45:44 +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

@@ -36,6 +36,46 @@ Controller::Controller(not_null<MainWindow*> window)
}, lifetime());
}
void Controller::setActiveChatEntry(Dialogs::RowDescriptor row) {
_activeChatEntry = row;
}
void Controller::setActiveChatEntry(Dialogs::Key key) {
setActiveChatEntry({ key, MsgId(0) });
}
Dialogs::RowDescriptor Controller::activeChatEntryCurrent() const {
return _activeChatEntry.current();
}
Dialogs::Key Controller::activeChatCurrent() const {
return activeChatEntryCurrent().key;
}
auto Controller::activeChatEntryChanges() const
-> rpl::producer<Dialogs::RowDescriptor> {
return _activeChatEntry.changes();
}
rpl::producer<Dialogs::Key> Controller::activeChatChanges() const {
return activeChatEntryChanges(
) | rpl::map([](const Dialogs::RowDescriptor &value) {
return value.key;
}) | rpl::distinct_until_changed();
}
auto Controller::activeChatEntryValue() const
-> rpl::producer<Dialogs::RowDescriptor> {
return _activeChatEntry.value();
}
rpl::producer<Dialogs::Key> Controller::activeChatValue() const {
return activeChatEntryValue(
) | rpl::map([](const Dialogs::RowDescriptor &value) {
return value.key;
}) | rpl::distinct_until_changed();
}
void Controller::enableGifPauseReason(GifPauseReason reason) {
if (!(_gifPauseReasons & reason)) {
auto notify = (static_cast<int>(_gifPauseReasons) < static_cast<int>(reason));