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

Disallow hashtags of digits only.

This commit is contained in:
John Preston
2018-03-06 18:29:45 +03:00
parent 0f901b3728
commit 7940ef24ab
4 changed files with 27 additions and 2 deletions

View File

@@ -1365,12 +1365,16 @@ void MainWidget::saveRecentHashtags(const QString &text) {
--next;
}
}
const auto tag = text.mid(i + 1, next - i - 1);
if (TextUtilities::RegExpHashtagExclude().match(tag).hasMatch()) {
continue;
}
if (!found && cRecentWriteHashtags().isEmpty() && cRecentSearchHashtags().isEmpty()) {
Local::readRecentHashtagsAndBots();
recent = cRecentWriteHashtags();
}
found = true;
Stickers::IncrementRecentHashtag(recent, text.mid(i + 1, next - i - 1));
Stickers::IncrementRecentHashtag(recent, tag);
}
if (found) {
cSetRecentWriteHashtags(recent);