mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-04-16 14:17:12 +02:00
Added utility to correctly cut text with commands.
This commit is contained in:
parent
8b74dc2dec
commit
c40bcdc446
3 changed files with 11 additions and 3 deletions
|
@ -1029,7 +1029,11 @@ QString HistoryItem::notificationText() const {
|
|||
}();
|
||||
return (result.size() <= kNotificationTextLimit)
|
||||
? result
|
||||
: result.mid(0, kNotificationTextLimit) + qsl("...");
|
||||
: TextUtilities::CutTextWithCommands(
|
||||
result,
|
||||
kNotificationTextLimit,
|
||||
textcmdStartSpoiler(),
|
||||
textcmdStopSpoiler());
|
||||
}
|
||||
|
||||
ItemPreview HistoryItem::toPreview(ToPreviewOptions options) const {
|
||||
|
|
|
@ -711,7 +711,11 @@ HistoryService::PreparedText HistoryService::preparePinnedText() {
|
|||
}
|
||||
}
|
||||
if (!limit && cutAt + 5 < size) {
|
||||
original = original.mid(0, cutAt) + qstr("...");
|
||||
original = TextUtilities::CutTextWithCommands(
|
||||
std::move(original),
|
||||
cutAt,
|
||||
textcmdStartSpoiler(),
|
||||
textcmdStopSpoiler());
|
||||
}
|
||||
result.text = tr::lng_action_pinned_message(tr::now, lt_from, fromLinkText(), lt_text, textcmdLink(2, original));
|
||||
} else {
|
||||
|
|
|
@ -1 +1 @@
|
|||
Subproject commit 44853e933400a7f1536b9847fd0adc2b7d575bff
|
||||
Subproject commit 774da18a386e9f0eda71331db22bc8e9b24bf44e
|
Loading…
Add table
Reference in a new issue