mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +02:00
Show correct outbox ticks in replies section.
This commit is contained in:
parent
13ad590a51
commit
247b1f64ca
12 changed files with 48 additions and 1 deletions
|
@ -595,6 +595,10 @@ bool InnerWidget::elementHideReply(not_null<const Element*> view) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool InnerWidget::elementShownUnread(not_null<const Element*> view) {
|
||||||
|
return view->data()->unread();
|
||||||
|
}
|
||||||
|
|
||||||
void InnerWidget::saveState(not_null<SectionMemento*> memento) {
|
void InnerWidget::saveState(not_null<SectionMemento*> memento) {
|
||||||
memento->setFilter(std::move(_filter));
|
memento->setFilter(std::move(_filter));
|
||||||
memento->setAdmins(std::move(_admins));
|
memento->setAdmins(std::move(_admins));
|
||||||
|
|
|
@ -114,6 +114,8 @@ public:
|
||||||
bool elementIsGifPaused() override;
|
bool elementIsGifPaused() override;
|
||||||
bool elementHideReply(
|
bool elementHideReply(
|
||||||
not_null<const HistoryView::Element*> view) override;
|
not_null<const HistoryView::Element*> view) override;
|
||||||
|
bool elementShownUnread(
|
||||||
|
not_null<const HistoryView::Element*> view) override;
|
||||||
|
|
||||||
~InnerWidget();
|
~InnerWidget();
|
||||||
|
|
||||||
|
|
|
@ -3411,6 +3411,9 @@ not_null<HistoryView::ElementDelegate*> HistoryInner::ElementDelegate() {
|
||||||
bool elementHideReply(not_null<const Element*> view) override {
|
bool elementHideReply(not_null<const Element*> view) override {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
bool elementShownUnread(not_null<const Element*> view) override {
|
||||||
|
return view->data()->unread();
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
static Result result;
|
static Result result;
|
||||||
|
|
|
@ -116,6 +116,11 @@ bool SimpleElementDelegate::elementHideReply(not_null<const Element*> view) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool SimpleElementDelegate::elementShownUnread(
|
||||||
|
not_null<const Element*> view) {
|
||||||
|
return view->data()->unread();
|
||||||
|
}
|
||||||
|
|
||||||
TextSelection UnshiftItemSelection(
|
TextSelection UnshiftItemSelection(
|
||||||
TextSelection selection,
|
TextSelection selection,
|
||||||
uint16 byLength) {
|
uint16 byLength) {
|
||||||
|
|
|
@ -65,6 +65,7 @@ public:
|
||||||
Fn<void()> hiddenCallback) = 0;
|
Fn<void()> hiddenCallback) = 0;
|
||||||
virtual bool elementIsGifPaused() = 0;
|
virtual bool elementIsGifPaused() = 0;
|
||||||
virtual bool elementHideReply(not_null<const Element*> view) = 0;
|
virtual bool elementHideReply(not_null<const Element*> view) = 0;
|
||||||
|
virtual bool elementShownUnread(not_null<const Element*> view) = 0;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -96,6 +97,7 @@ public:
|
||||||
Fn<void()> hiddenCallback) override;
|
Fn<void()> hiddenCallback) override;
|
||||||
bool elementIsGifPaused() override;
|
bool elementIsGifPaused() override;
|
||||||
bool elementHideReply(not_null<const Element*> view) override;
|
bool elementHideReply(not_null<const Element*> view) override;
|
||||||
|
bool elementShownUnread(not_null<const Element*> view) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
const not_null<Window::SessionController*> _controller;
|
const not_null<Window::SessionController*> _controller;
|
||||||
|
|
|
@ -1279,6 +1279,10 @@ bool ListWidget::elementHideReply(not_null<const Element*> view) {
|
||||||
return _delegate->listElementHideReply(view);
|
return _delegate->listElementHideReply(view);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool ListWidget::elementShownUnread(not_null<const Element*> view) {
|
||||||
|
return _delegate->listElementShownUnread(view);
|
||||||
|
}
|
||||||
|
|
||||||
void ListWidget::saveState(not_null<ListMemento*> memento) {
|
void ListWidget::saveState(not_null<ListMemento*> memento) {
|
||||||
memento->setAroundPosition(_aroundPosition);
|
memento->setAroundPosition(_aroundPosition);
|
||||||
auto state = countScrollState();
|
auto state = countScrollState();
|
||||||
|
|
|
@ -84,6 +84,7 @@ public:
|
||||||
virtual void listContentRefreshed() = 0;
|
virtual void listContentRefreshed() = 0;
|
||||||
virtual ClickHandlerPtr listDateLink(not_null<Element*> view) = 0;
|
virtual ClickHandlerPtr listDateLink(not_null<Element*> view) = 0;
|
||||||
virtual bool listElementHideReply(not_null<const Element*> view) = 0;
|
virtual bool listElementHideReply(not_null<const Element*> view) = 0;
|
||||||
|
virtual bool listElementShownUnread(not_null<const Element*> view) = 0;
|
||||||
virtual bool listIsGoodForAroundPosition(
|
virtual bool listIsGoodForAroundPosition(
|
||||||
not_null<const Element*> view) = 0;
|
not_null<const Element*> view) = 0;
|
||||||
|
|
||||||
|
@ -229,6 +230,7 @@ public:
|
||||||
Fn<void()> hiddenCallback) override;
|
Fn<void()> hiddenCallback) override;
|
||||||
bool elementIsGifPaused() override;
|
bool elementIsGifPaused() override;
|
||||||
bool elementHideReply(not_null<const Element*> view) override;
|
bool elementHideReply(not_null<const Element*> view) override;
|
||||||
|
bool elementShownUnread(not_null<const Element*> view) override;
|
||||||
|
|
||||||
~ListWidget();
|
~ListWidget();
|
||||||
|
|
||||||
|
|
|
@ -1774,7 +1774,7 @@ void Message::drawInfo(
|
||||||
if (outbg) {
|
if (outbg) {
|
||||||
auto icon = [&] {
|
auto icon = [&] {
|
||||||
if (item->id > 0) {
|
if (item->id > 0) {
|
||||||
if (item->unread()) {
|
if (delegate()->elementShownUnread(this)) {
|
||||||
return &(invertedsprites ? st::historySentInvertedIcon : (selected ? st::historySentSelectedIcon : st::historySentIcon));
|
return &(invertedsprites ? st::historySentInvertedIcon : (selected ? st::historySentSelectedIcon : st::historySentIcon));
|
||||||
}
|
}
|
||||||
return &(invertedsprites ? st::historyReceivedInvertedIcon : (selected ? st::historyReceivedSelectedIcon : st::historyReceivedIcon));
|
return &(invertedsprites ? st::historyReceivedInvertedIcon : (selected ? st::historyReceivedSelectedIcon : st::historyReceivedIcon));
|
||||||
|
|
|
@ -211,6 +211,13 @@ RepliesWidget::RepliesWidget(
|
||||||
}
|
}
|
||||||
}, lifetime());
|
}, lifetime());
|
||||||
|
|
||||||
|
_history->session().changes().historyUpdates(
|
||||||
|
_history,
|
||||||
|
Data::HistoryUpdate::Flag::OutboxRead
|
||||||
|
) | rpl::start_with_next([=] {
|
||||||
|
_inner->update();
|
||||||
|
}, lifetime());
|
||||||
|
|
||||||
setupScrollDownButton();
|
setupScrollDownButton();
|
||||||
setupComposeControls();
|
setupComposeControls();
|
||||||
}
|
}
|
||||||
|
@ -252,6 +259,7 @@ void RepliesWidget::setupRoot() {
|
||||||
if (_readRequestPending) {
|
if (_readRequestPending) {
|
||||||
sendReadTillRequest();
|
sendReadTillRequest();
|
||||||
}
|
}
|
||||||
|
_inner->update();
|
||||||
}
|
}
|
||||||
updatePinnedVisibility();
|
updatePinnedVisibility();
|
||||||
refreshRootView();
|
refreshRootView();
|
||||||
|
@ -1580,6 +1588,17 @@ bool RepliesWidget::listElementHideReply(not_null<const Element*> view) {
|
||||||
return (view->data()->replyToId() == _rootId);
|
return (view->data()->replyToId() == _rootId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool RepliesWidget::listElementShownUnread(not_null<const Element*> view) {
|
||||||
|
if (!_root) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
const auto item = view->data();
|
||||||
|
const auto till = item->out()
|
||||||
|
? _root->computeRepliesOutboxReadTillFull()
|
||||||
|
: _root->computeRepliesInboxReadTillFull();
|
||||||
|
return (item->id > till);
|
||||||
|
}
|
||||||
|
|
||||||
bool RepliesWidget::listIsGoodForAroundPosition(
|
bool RepliesWidget::listIsGoodForAroundPosition(
|
||||||
not_null<const Element*> view) {
|
not_null<const Element*> view) {
|
||||||
return IsServerMsgId(view->data()->id);
|
return IsServerMsgId(view->data()->id);
|
||||||
|
|
|
@ -123,6 +123,7 @@ public:
|
||||||
void listContentRefreshed() override;
|
void listContentRefreshed() override;
|
||||||
ClickHandlerPtr listDateLink(not_null<Element*> view) override;
|
ClickHandlerPtr listDateLink(not_null<Element*> view) override;
|
||||||
bool listElementHideReply(not_null<const Element*> view) override;
|
bool listElementHideReply(not_null<const Element*> view) override;
|
||||||
|
bool listElementShownUnread(not_null<const Element*> view) override;
|
||||||
bool listIsGoodForAroundPosition(not_null<const Element*> view) override;
|
bool listIsGoodForAroundPosition(not_null<const Element*> view) override;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
|
@ -1150,6 +1150,10 @@ bool ScheduledWidget::listElementHideReply(not_null<const Element*> view) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool ScheduledWidget::listElementShownUnread(not_null<const Element*> view) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
bool ScheduledWidget::listIsGoodForAroundPosition(
|
bool ScheduledWidget::listIsGoodForAroundPosition(
|
||||||
not_null<const Element*> view) {
|
not_null<const Element*> view) {
|
||||||
return true;
|
return true;
|
||||||
|
|
|
@ -111,6 +111,7 @@ public:
|
||||||
void listContentRefreshed() override;
|
void listContentRefreshed() override;
|
||||||
ClickHandlerPtr listDateLink(not_null<Element*> view) override;
|
ClickHandlerPtr listDateLink(not_null<Element*> view) override;
|
||||||
bool listElementHideReply(not_null<const Element*> view) override;
|
bool listElementHideReply(not_null<const Element*> view) override;
|
||||||
|
bool listElementShownUnread(not_null<const Element*> view) override;
|
||||||
bool listIsGoodForAroundPosition(not_null<const Element *> view) override;
|
bool listIsGoodForAroundPosition(not_null<const Element *> view) override;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
Loading…
Add table
Reference in a new issue