mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +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 {
|
} else {
|
||||||
refreshReplies();
|
refreshReplies();
|
||||||
refreshTopBarActiveChat();
|
refreshTopBarActiveChat();
|
||||||
|
if (_topic) {
|
||||||
|
subscribeToPinnedMessages();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
_inner->update();
|
_inner->update();
|
||||||
}
|
}
|
||||||
|
@ -533,23 +536,27 @@ void RepliesWidget::subscribeToTopic() {
|
||||||
}, _topicLifetime);
|
}, _topicLifetime);
|
||||||
|
|
||||||
if (!_topic->creating()) {
|
if (!_topic->creating()) {
|
||||||
using EntryUpdateFlag = Data::EntryUpdate::Flag;
|
subscribeToPinnedMessages();
|
||||||
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();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
_cornerButtons.updateUnreadThingsVisibility();
|
_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) {
|
void RepliesWidget::setTopic(Data::ForumTopic *topic) {
|
||||||
if (_topic == topic) {
|
if (_topic == topic) {
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -214,6 +214,7 @@ private:
|
||||||
void setupRootView();
|
void setupRootView();
|
||||||
void setupTopicViewer();
|
void setupTopicViewer();
|
||||||
void subscribeToTopic();
|
void subscribeToTopic();
|
||||||
|
void subscribeToPinnedMessages();
|
||||||
void setTopic(Data::ForumTopic *topic);
|
void setTopic(Data::ForumTopic *topic);
|
||||||
void setupDragArea();
|
void setupDragArea();
|
||||||
void setupShortcuts();
|
void setupShortcuts();
|
||||||
|
|
Loading…
Add table
Reference in a new issue