2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-08-30 22:25:12 +00:00

fixed webpage handling

This commit is contained in:
John Preston
2015-09-28 17:19:37 +03:00
parent d8b421993d
commit 297b2f3dcf
5 changed files with 25 additions and 20 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);
}
}