mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-08-31 06:26:18 +00:00
Copy text with expanded links only to external.
Paste valid custom links in message field if copied from messages.
This commit is contained in:
@@ -486,8 +486,7 @@ DeleteMessagesBox::DeleteMessagesBox(
|
||||
void DeleteMessagesBox::prepare() {
|
||||
auto details = TextWithEntities();
|
||||
const auto appendDetails = [&](TextWithEntities &&text) {
|
||||
TextUtilities::Append(details, { "\n\n" });
|
||||
TextUtilities::Append(details, std::move(text));
|
||||
details.append(qstr("\n\n")).append(std::move(text));
|
||||
};
|
||||
auto deleteKey = lng_box_delete;
|
||||
auto deleteStyle = &st::defaultBoxButton;
|
||||
@@ -648,7 +647,7 @@ auto DeleteMessagesBox::revokeText(not_null<PeerData*> peer) const
|
||||
if (const auto user = peer->asUser()) {
|
||||
auto boldName = TextWithEntities{ user->firstName };
|
||||
boldName.entities.push_back(
|
||||
EntityInText(EntityInTextBold, 0, boldName.text.size()));
|
||||
{ EntityType::Bold, 0, boldName.text.size() });
|
||||
if (canRevokeOutgoingCount == 1) {
|
||||
result.description = lng_selected_unsend_about_user_one__generic<TextWithEntities>(
|
||||
lt_user,
|
||||
|
@@ -229,7 +229,7 @@ void ConfirmPhoneBox::prepare() {
|
||||
aboutText.text = lng_confirm_phone_about(lt_phone, formattedPhone);
|
||||
auto phonePosition = aboutText.text.indexOf(formattedPhone);
|
||||
if (phonePosition >= 0) {
|
||||
aboutText.entities.push_back(EntityInText(EntityInTextBold, phonePosition, formattedPhone.size()));
|
||||
aboutText.entities.push_back({ EntityType::Bold, phonePosition, formattedPhone.size() });
|
||||
}
|
||||
_about->setMarkedText(aboutText);
|
||||
|
||||
|
@@ -627,11 +627,11 @@ void Controller::refreshEditInviteLink() {
|
||||
if (text.text.startsWith(remove)) {
|
||||
text.text.remove(0, remove.size());
|
||||
}
|
||||
text.entities.push_back(EntityInText(
|
||||
EntityInTextCustomUrl,
|
||||
text.entities.push_back({
|
||||
EntityType::CustomUrl,
|
||||
0,
|
||||
text.text.size(),
|
||||
link));
|
||||
link });
|
||||
}
|
||||
_controls.inviteLink->setMarkedText(text);
|
||||
|
||||
|
Reference in New Issue
Block a user