mirror of
https://github.com/kotatogram/kotatogram-desktop
synced 2025-08-30 14:17:45 +00:00
Fix first my reaction userpic in groups.
This commit is contained in:
@@ -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 {
|
||||||
|
Reference in New Issue
Block a user