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:
@@ -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));
|
||||
|
Reference in New Issue
Block a user