Skip to content

Commit

Permalink
Removed reactions list for anonymous non-owner admins.
Browse files Browse the repository at this point in the history
  • Loading branch information
23rd committed Feb 10, 2025
1 parent 4b43f4c commit 0483333
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions Telegram/SourceFiles/data/data_message_reactions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ For license and copyright information please follow this link:
#include "main/main_app_config.h"
#include "main/session/send_as_peers.h"
#include "data/components/credits.h"
#include "data/data_channel.h"
#include "data/data_user.h"
#include "data/data_session.h"
#include "data/data_histories.h"
Expand Down Expand Up @@ -175,6 +176,13 @@ PossibleItemReactionsRef LookupPossibleReactions(
}
}
const auto session = &peer->session();
if (const auto channel = peer->asChannel()) {
if ((!channel->amCreator())
&& (channel->adminRights() & ChatAdminRight::Anonymous)
&& (session->sendAsPeers().resolveChosen(channel) == channel)) {
return {};
}
}
const auto reactions = &session->data().reactions();
const auto &full = reactions->list(Reactions::Type::Active);
const auto &top = reactions->list(Reactions::Type::Top);
Expand Down

0 comments on commit 0483333

Please sign in to comment.