2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 06:26:18 +00:00

Remove emoji from custom admin ranks.

This commit is contained in:
John Preston
2019-07-28 15:39:06 +02:00
parent 3bf709d459
commit 27d84befa8
6 changed files with 43 additions and 7 deletions

View File

@@ -427,14 +427,17 @@ not_null<Ui::InputField*> EditAdminBox::addRankInput() {
this,
st::customBadgeField,
(isOwner ? tr::lng_owner_badge : tr::lng_admin_badge)(),
_oldRank),
TextUtilities::RemoveEmoji(_oldRank)),
st::rightsAboutMargin);
result->setMaxLength(kAdminRoleLimit);
result->setInstantReplaces(Ui::InstantReplaces::Default());
result->setInstantReplacesEnabled(Global::ReplaceEmojiValue());
Ui::Emoji::SuggestionsController::Init(
getDelegate()->outerContainer(),
result);
result->setInstantReplaces(Ui::InstantReplaces::TextOnly());
connect(result, &Ui::InputField::changed, [=] {
const auto text = result->getLastText();
const auto removed = TextUtilities::RemoveEmoji(text);
if (removed != text) {
result->setText(removed);
}
});
addControl(
object_ptr<Ui::FlatLabel>(