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

Everywhere TextWithTags and TextWithEntities are used.

Copy tags from messages to clipboard, to drag mime data.
Sorting entities while processing (links, monospace, mentions).
This commit is contained in:
John Preston
2016-05-06 20:33:48 +03:00
parent 463450e607
commit 3e5f51f45a
19 changed files with 542 additions and 369 deletions

View File

@@ -414,7 +414,7 @@ EditCaptionBox::EditCaptionBox(HistoryItem *msg) : AbstractBox(st::boxWideWidth)
image = doc->thumb;
} break;
}
caption = media->getCaption();
caption = media->getCaption().text;
}
if ((!_animated && (dimensions.isEmpty() || doc)) || image->isNull()) {
_animated = false;
@@ -492,7 +492,8 @@ EditCaptionBox::EditCaptionBox(HistoryItem *msg) : AbstractBox(st::boxWideWidth)
_field->setMaxLength(MaxPhotoCaption);
_field->setCtrlEnterSubmit(CtrlEnterSubmitBoth);
} else {
QString text = textApplyEntities(msg->originalText(), msg->originalEntities());
auto original = msg->originalText();
QString text = textApplyEntities(original.text, original.entities);
_field = new InputArea(this, st::editTextArea, lang(lng_photo_caption), text);
// _field->setMaxLength(MaxMessageSize); // entities can make text in input field larger but still valid
_field->setCtrlEnterSubmit(cCtrlEnter() ? CtrlEnterSubmitCtrlEnter : CtrlEnterSubmitEnter);