mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +02:00
Fix first my reaction userpic in groups.
This commit is contained in:
parent
9a451a1423
commit
4996d90782
1 changed files with 6 additions and 0 deletions
|
@ -794,11 +794,17 @@ void HistoryItem::addReaction(const QString &reaction) {
|
||||||
void HistoryItem::toggleReaction(const QString &reaction) {
|
void HistoryItem::toggleReaction(const QString &reaction) {
|
||||||
if (!_reactions) {
|
if (!_reactions) {
|
||||||
_reactions = std::make_unique<Data::MessageReactions>(this);
|
_reactions = std::make_unique<Data::MessageReactions>(this);
|
||||||
|
const auto canViewReactions = !isDiscussionPost()
|
||||||
|
&& (history()->peer->isChat() || history()->peer->isMegagroup());
|
||||||
|
if (canViewReactions) {
|
||||||
|
_flags |= MessageFlag::CanViewReactions;
|
||||||
|
}
|
||||||
_reactions->add(reaction);
|
_reactions->add(reaction);
|
||||||
} else if (_reactions->chosen() == reaction) {
|
} else if (_reactions->chosen() == reaction) {
|
||||||
_reactions->remove();
|
_reactions->remove();
|
||||||
if (_reactions->empty()) {
|
if (_reactions->empty()) {
|
||||||
_reactions = nullptr;
|
_reactions = nullptr;
|
||||||
|
_flags &= ~MessageFlag::CanViewReactions;
|
||||||
history()->owner().notifyItemDataChange(this);
|
history()->owner().notifyItemDataChange(this);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Add table
Reference in a new issue