mirror of https://github.com/procxx/kepka.git
Ignoring accents when autocompleting mentions in field_autocomplete.
Do nothing instead of showing in folder a media file with bad extension. Showing descriptive error message when we hit the limit of stickerpacks.
This commit is contained in:
parent
562c5621f5
commit
352b0f2079
|
@ -680,6 +680,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
|
|||
"lng_stickers_add_pack" = "Add stickers";
|
||||
"lng_stickers_share_pack" = "Share Stickers";
|
||||
"lng_stickers_not_found" = "Sticker pack not found.";
|
||||
"lng_stickers_too_many_packs" = "You have too many sticker packs. Please remove some first.";
|
||||
"lng_stickers_copied" = "Sticker pack link copied to clipboard.";
|
||||
"lng_stickers_default_set" = "Great Minds";
|
||||
"lng_stickers_you_have" = "Manage and reorder sticker packs";
|
||||
|
|
|
@ -154,7 +154,11 @@ void StickerSetInner::installDone(const MTPBool &result) {
|
|||
bool StickerSetInner::installFailed(const RPCError &error) {
|
||||
if (MTP::isDefaultHandledError(error)) return false;
|
||||
|
||||
Ui::showLayer(new InformBox(lang(lng_stickers_not_found)));
|
||||
if (error.type() == qstr("STICKERSETS_TOO_MUCH")) {
|
||||
Ui::showLayer(new InformBox(lang(lng_stickers_too_many_packs)));
|
||||
} else {
|
||||
Ui::showLayer(new InformBox(lang(lng_stickers_not_found)));
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -104,7 +104,7 @@ void FieldAutocomplete::showFiltered(PeerData *peer, QString query, bool addInli
|
|||
bool resetScroll = (_type != type || _filter != plainQuery);
|
||||
if (resetScroll) {
|
||||
_type = type;
|
||||
_filter = plainQuery.toString();
|
||||
_filter = textAccentFold(plainQuery.toString());
|
||||
}
|
||||
_addInlineBots = addInlineBots;
|
||||
|
||||
|
@ -259,7 +259,9 @@ void FieldAutocomplete::updateFiltered(bool resetScroll) {
|
|||
auto &recent(cRecentWriteHashtags());
|
||||
hrows.reserve(recent.size());
|
||||
for (auto i = recent.cbegin(), e = recent.cend(); i != e; ++i) {
|
||||
if (!listAllSuggestions && (!i->first.startsWith(_filter, Qt::CaseInsensitive) || i->first.size() == _filter.size())) continue;
|
||||
if (!listAllSuggestions && (!i->first.startsWith(_filter, Qt::CaseInsensitive) || i->first.size() == _filter.size())) {
|
||||
continue;
|
||||
}
|
||||
hrows.push_back(i->first);
|
||||
}
|
||||
} else if (_type == Type::BotCommands) {
|
||||
|
|
|
@ -1543,8 +1543,6 @@ void MainWidget::audioPlayProgress(const AudioMsgId &audioId) {
|
|||
if (!filepath.isEmpty()) {
|
||||
if (documentIsValidMediaFile(filepath)) {
|
||||
psOpenFile(filepath);
|
||||
} else {
|
||||
psShowInFolder(filepath);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1574,8 +1572,6 @@ void MainWidget::documentPlayProgress(const SongMsgId &songId) {
|
|||
if (!filepath.isEmpty()) {
|
||||
if (documentIsValidMediaFile(filepath)) {
|
||||
psOpenFile(filepath);
|
||||
} else {
|
||||
psShowInFolder(filepath);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -979,8 +979,6 @@ void DocumentOpenClickHandler::doOpen(DocumentData *data, ActionOnLoad action) {
|
|||
auto filepath = location.name();
|
||||
if (documentIsValidMediaFile(filepath)) {
|
||||
psOpenFile(filepath);
|
||||
} else {
|
||||
psShowInFolder(filepath);
|
||||
}
|
||||
if (App::main()) App::main()->mediaMarkRead(data);
|
||||
} else if (data->size < MediaViewImageSizeLimit) {
|
||||
|
@ -1278,8 +1276,6 @@ void DocumentData::performActionOnLoad() {
|
|||
if (voice() || song() || isVideo()) {
|
||||
if (documentIsValidMediaFile(already)) {
|
||||
psOpenFile(already);
|
||||
} else {
|
||||
psShowInFolder(already);
|
||||
}
|
||||
if (App::main()) App::main()->mediaMarkRead(this);
|
||||
} else if (loc.accessEnable()) {
|
||||
|
|
Loading…
Reference in New Issue