2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-08-31 14:45:14 +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:
John Preston
2019-04-08 19:10:06 +04:00
parent 0f0c3b7461
commit b5be6df5e2
64 changed files with 772 additions and 647 deletions

View File

@@ -1009,9 +1009,9 @@ Storage::SharedMediaTypesMask HistoryMessage::sharedMediaTypes() const {
void HistoryMessage::setText(const TextWithEntities &textWithEntities) {
for_const (auto &entity, textWithEntities.entities) {
auto type = entity.type();
if (type == EntityInTextUrl
|| type == EntityInTextCustomUrl
|| type == EntityInTextEmail) {
if (type == EntityType::Url
|| type == EntityType::CustomUrl
|| type == EntityType::Email) {
_flags |= MTPDmessage_ClientFlag::f_has_text_links;
break;
}
@@ -1096,11 +1096,11 @@ TextWithEntities HistoryMessage::originalText() const {
return _text.toTextWithEntities();
}
TextWithEntities HistoryMessage::clipboardText() const {
TextForMimeData HistoryMessage::clipboardText() const {
if (emptyText()) {
return { QString(), EntitiesInText() };
return TextForMimeData();
}
return _text.toTextWithEntities(AllTextSelection, ExpandLinksAll);
return _text.toTextForMimeData();
}
bool HistoryMessage::textHasLinks() const {