2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-30 22:16:14 +00:00
This commit is contained in:
John Preston
2015-09-29 16:38:19 +03:00
12 changed files with 65 additions and 22 deletions

View File

@@ -4131,20 +4131,19 @@ void MainWidget::feedUpdates(const MTPUpdates &updates, uint64 randomId) {
feedUpdate(MTP_updateMessageID(d.vid, MTP_long(randomId))); // ignore real date
if (peerId) {
HistoryItem *item = App::histItemById(peerToChannel(peerId), d.vid.v);
if (!text.isEmpty()) {
bool hasLinks = d.has_entities() && !d.ventities.c_vector().v.isEmpty();
if (item && ((hasLinks && !item->hasTextLinks()) || (!hasLinks && item->textHasLinks()))) {
bool was = item->hasTextLinks();
item->setText(text, d.has_entities() ? linksFromMTP(d.ventities.c_vector().v) : LinksInText());
item->initDimensions();
itemResized(item);
if (!was && item->hasTextLinks() && (!item->history()->isChannel() || item->fromChannel())) {
item->history()->addToOverview(item, OverviewLinks);
if (HistoryItem *item = App::histItemById(peerToChannel(peerId), d.vid.v)) {
if (!text.isEmpty()) {
bool hasLinks = d.has_entities() && !d.ventities.c_vector().v.isEmpty();
if ((hasLinks && !item->hasTextLinks()) || (!hasLinks && item->textHasLinks())) {
item->setText(text, d.has_entities() ? linksFromMTP(d.ventities.c_vector().v) : LinksInText());
item->initDimensions();
itemResized(item);
if (item->hasTextLinks() && (!item->history()->isChannel() || item->fromChannel())) {
item->history()->addToOverview(item, OverviewLinks);
}
}
}
}
if (item) {
item->setMedia(d.has_media() ? (&d.vmedia) : 0);
}
}