mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-04-16 14:17:12 +02:00
Display pinned messages bar after topic creation.
This commit is contained in:
parent
3fcb7c90e0
commit
b5a412929e
2 changed files with 20 additions and 12 deletions
|
@ -483,6 +483,9 @@ void RepliesWidget::setupTopicViewer() {
|
|||
} else {
|
||||
refreshReplies();
|
||||
refreshTopBarActiveChat();
|
||||
if (_topic) {
|
||||
subscribeToPinnedMessages();
|
||||
}
|
||||
}
|
||||
_inner->update();
|
||||
}
|
||||
|
@ -533,23 +536,27 @@ void RepliesWidget::subscribeToTopic() {
|
|||
}, _topicLifetime);
|
||||
|
||||
if (!_topic->creating()) {
|
||||
using EntryUpdateFlag = Data::EntryUpdate::Flag;
|
||||
session().changes().entryUpdates(
|
||||
EntryUpdateFlag::HasPinnedMessages
|
||||
) | rpl::start_with_next([=](const Data::EntryUpdate &update) {
|
||||
if (_pinnedTracker
|
||||
&& (update.flags & EntryUpdateFlag::HasPinnedMessages)
|
||||
&& (_topic == update.entry.get())) {
|
||||
checkPinnedBarState();
|
||||
}
|
||||
}, lifetime());
|
||||
|
||||
setupPinnedTracker();
|
||||
subscribeToPinnedMessages();
|
||||
}
|
||||
|
||||
_cornerButtons.updateUnreadThingsVisibility();
|
||||
}
|
||||
|
||||
void RepliesWidget::subscribeToPinnedMessages() {
|
||||
using EntryUpdateFlag = Data::EntryUpdate::Flag;
|
||||
session().changes().entryUpdates(
|
||||
EntryUpdateFlag::HasPinnedMessages
|
||||
) | rpl::start_with_next([=](const Data::EntryUpdate &update) {
|
||||
if (_pinnedTracker
|
||||
&& (update.flags & EntryUpdateFlag::HasPinnedMessages)
|
||||
&& (_topic == update.entry.get())) {
|
||||
checkPinnedBarState();
|
||||
}
|
||||
}, lifetime());
|
||||
|
||||
setupPinnedTracker();
|
||||
}
|
||||
|
||||
void RepliesWidget::setTopic(Data::ForumTopic *topic) {
|
||||
if (_topic == topic) {
|
||||
return;
|
||||
|
|
|
@ -214,6 +214,7 @@ private:
|
|||
void setupRootView();
|
||||
void setupTopicViewer();
|
||||
void subscribeToTopic();
|
||||
void subscribeToPinnedMessages();
|
||||
void setTopic(Data::ForumTopic *topic);
|
||||
void setupDragArea();
|
||||
void setupShortcuts();
|
||||
|
|
Loading…
Add table
Reference in a new issue