mirror of
https://github.com/kotatogram/kotatogram-desktop
synced 2025-08-31 14:45:14 +00:00
Added utility to correctly cut text with commands.
This commit is contained in:
@@ -1029,7 +1029,11 @@ QString HistoryItem::notificationText() const {
|
|||||||
}();
|
}();
|
||||||
return (result.size() <= kNotificationTextLimit)
|
return (result.size() <= kNotificationTextLimit)
|
||||||
? result
|
? result
|
||||||
: result.mid(0, kNotificationTextLimit) + qsl("...");
|
: TextUtilities::CutTextWithCommands(
|
||||||
|
result,
|
||||||
|
kNotificationTextLimit,
|
||||||
|
textcmdStartSpoiler(),
|
||||||
|
textcmdStopSpoiler());
|
||||||
}
|
}
|
||||||
|
|
||||||
ItemPreview HistoryItem::toPreview(ToPreviewOptions options) const {
|
ItemPreview HistoryItem::toPreview(ToPreviewOptions options) const {
|
||||||
|
@@ -711,7 +711,11 @@ HistoryService::PreparedText HistoryService::preparePinnedText() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!limit && cutAt + 5 < size) {
|
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));
|
result.text = tr::lng_action_pinned_message(tr::now, lt_from, fromLinkText(), lt_text, textcmdLink(2, original));
|
||||||
} else {
|
} else {
|
||||||
|
Submodule Telegram/lib_ui updated: 44853e9334...774da18a38
Reference in New Issue
Block a user