mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-04-16 14:17:12 +02:00
Don't attach outgoing items from a channel to each other.
This commit is contained in:
parent
3c040ab5f9
commit
dee8b1fe6f
1 changed files with 6 additions and 4 deletions
|
@ -535,11 +535,13 @@ void Element::refreshDataId() {
|
|||
}
|
||||
|
||||
bool Element::computeIsAttachToPrevious(not_null<Element*> previous) {
|
||||
const auto mayBeAttached = [](not_null<HistoryItem*> item) {
|
||||
const auto mayBeAttached = [](not_null<Element*> view) {
|
||||
const auto item = view->data();
|
||||
return !item->isService()
|
||||
&& !item->isEmpty()
|
||||
&& !item->isPost()
|
||||
&& (item->from() != item->history()->peer
|
||||
&& (!item->history()->peer->isMegagroup()
|
||||
|| !view->hasOutLayout()
|
||||
|| !item->from()->isChannel());
|
||||
};
|
||||
const auto item = data();
|
||||
|
@ -547,8 +549,8 @@ bool Element::computeIsAttachToPrevious(not_null<Element*> previous) {
|
|||
const auto prev = previous->data();
|
||||
const auto possible = (std::abs(prev->date() - item->date())
|
||||
< kAttachMessageToPreviousSecondsDelta)
|
||||
&& mayBeAttached(item)
|
||||
&& mayBeAttached(prev);
|
||||
&& mayBeAttached(this)
|
||||
&& mayBeAttached(previous);
|
||||
if (possible) {
|
||||
const auto forwarded = item->Get<HistoryMessageForwarded>();
|
||||
const auto prevForwarded = prev->Get<HistoryMessageForwarded>();
|
||||
|
|
Loading…
Add table
Reference in a new issue