mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2026-07-25 06:54:43 +00:00
Replaced unread voice dot indicator with svg.
Related commit: f4cbbb251f.
This commit is contained in:
@@ -644,20 +644,27 @@ TextWithEntities DropDisallowedCustomEmoji(
|
||||
if (to->session().premium() || to->isSelf()) {
|
||||
return text;
|
||||
}
|
||||
const auto isLocalIconEmoji = [](const EntityInText &entity) {
|
||||
return entity.data().startsWith(u"icon-emoji-"_q);
|
||||
};
|
||||
const auto channel = to->asMegagroup();
|
||||
const auto allowSetId = channel ? channel->mgInfo->emojiSet.id : 0;
|
||||
if (!allowSetId) {
|
||||
const auto predicate = [&](const EntityInText &entity) {
|
||||
return (entity.type() == EntityType::CustomEmoji)
|
||||
&& !isLocalIconEmoji(entity);
|
||||
};
|
||||
text.entities.erase(
|
||||
ranges::remove(
|
||||
text.entities,
|
||||
EntityType::CustomEmoji,
|
||||
&EntityInText::type),
|
||||
ranges::remove_if(text.entities, predicate),
|
||||
text.entities.end());
|
||||
} else {
|
||||
const auto predicate = [&](const EntityInText &entity) {
|
||||
if (entity.type() != EntityType::CustomEmoji) {
|
||||
return false;
|
||||
}
|
||||
if (isLocalIconEmoji(entity)) {
|
||||
return false;
|
||||
}
|
||||
if (const auto id = Data::ParseCustomEmojiData(entity.data())) {
|
||||
const auto document = to->owner().document(id);
|
||||
if (const auto sticker = document->sticker()) {
|
||||
|
||||
Reference in New Issue
Block a user