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

@@ -898,9 +898,11 @@ bool Document::updateStatusText() const {
Link::Link(HistoryMedia *media, HistoryItem *parent) : ItemBase(parent) {
AddComponents(Info::Bit());
QString text = _parent->originalText(), mainUrl;
EntitiesInText entities = _parent->originalEntities();
const auto textWithEntities = _parent->originalText();
QString mainUrl;
auto text = textWithEntities.text;
auto &entities = textWithEntities.entities;
int32 from = 0, till = text.size(), lnk = entities.size();
for_const (const auto &entity, entities) {
auto type = entity.type();