feat: filter zalgo

This commit is contained in:
AlexeyZavar
2026-01-26 20:35:23 +03:00
parent f0599a34c7
commit 5f4335d560
9 changed files with 119 additions and 8 deletions
+11 -1
View File
@@ -20,6 +20,11 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "apiwrap.h"
#include "api/api_invite_links.h"
// AyuGram includes
#include "ayu/ayu_settings.h"
#include "ayu/utils/telegram_helpers.h"
namespace {
using UpdateFlag = Data::PeerUpdate::Flag;
@@ -112,7 +117,12 @@ bool ChatData::anyoneCanAddMembers() const {
}
void ChatData::setName(const QString &newName) {
updateNameDelayed(newName.isEmpty() ? name() : newName, {}, {});
auto filteredName = newName;
const auto &settings = AyuSettings::getInstance();
if (settings.filterZalgo) {
filteredName = filterZalgo(filteredName);
}
updateNameDelayed(filteredName.isEmpty() ? name() : filteredName, {}, {});
}
void ChatData::applyEditAdmin(not_null<UserData*> user, bool isAdmin) {