2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 14:38:15 +00:00

Support cloud-saved paid reaction privacy.

This commit is contained in:
John Preston
2024-08-30 10:31:57 +04:00
parent 2b185d491b
commit d81547f091
11 changed files with 102 additions and 29 deletions

View File

@@ -7,6 +7,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
*/
#include "data/data_channel.h"
#include "api/api_global_privacy.h"
#include "data/data_changes.h"
#include "data/data_channel_admins.h"
#include "data/data_user.h"
@@ -971,6 +972,9 @@ PeerId ChannelData::groupCallDefaultJoinAs() const {
void ChannelData::setAllowedReactions(Data::AllowedReactions value) {
if (_allowedReactions != value) {
if (value.paidEnabled) {
session().api().globalPrivacy().loadPaidReactionAnonymous();
}
const auto enabled = [](const Data::AllowedReactions &allowed) {
return (allowed.type != Data::AllowedReactionsType::Some)
|| !allowed.some.empty()