mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-01-31 12:14:34 +00:00
fixed webpage handling
This commit is contained in:
parent
d8b421993d
commit
297b2f3dcf
@ -15,7 +15,7 @@ set "AppVersionStrFull=%AppVersionStr%.dev"
|
||||
:devprepared
|
||||
|
||||
echo.
|
||||
echo Building version %AppVersionStrFull%..
|
||||
echo Building version %AppVersionStrFull% for Windows..
|
||||
echo.
|
||||
|
||||
if exist ..\Win32\Deploy\deploy\%AppVersionStrMajor%\%AppVersionStr%\ goto error_exist1
|
||||
|
@ -752,6 +752,8 @@ namespace App {
|
||||
}
|
||||
}
|
||||
|
||||
existing->setMedia(m.has_media() ? (&m.vmedia) : 0);
|
||||
|
||||
existing->setViewsCount(m.has_views() ? m.vviews.v : -1);
|
||||
}
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
@ -134,6 +134,10 @@ _saveMsgStarted(0), _saveMsgOpacity(0)
|
||||
}
|
||||
|
||||
void MediaView::moveToScreen() {
|
||||
if (App::wnd() && windowHandle() && App::wnd()->windowHandle() && windowHandle()->screen() != App::wnd()->windowHandle()->screen()) {
|
||||
windowHandle()->setScreen(App::wnd()->windowHandle()->screen());
|
||||
}
|
||||
|
||||
QPoint wndCenter(App::wnd()->x() + App::wnd()->width() / 2, App::wnd()->y() + App::wnd()->height() / 2);
|
||||
QRect avail = App::app() ? App::app()->desktop()->screenGeometry(wndCenter) : QDesktopWidget().screenGeometry(wndCenter);
|
||||
if (avail != geometry()) {
|
||||
|
@ -468,30 +468,30 @@ void PtsWaiter::clearSkippedUpdates() {
|
||||
bool PtsWaiter::updated(ChannelData *channel, int32 pts, int32 count) {
|
||||
if (_requesting || _applySkippedLevel) {
|
||||
return true;
|
||||
} else if (pts <= _good) {
|
||||
} else if (pts <= _good && count > 0) {
|
||||
return false;
|
||||
}
|
||||
return check(channel, pts, count);
|
||||
}
|
||||
|
||||
bool PtsWaiter::updated(ChannelData *channel, int32 pts, int32 ptsCount, const MTPUpdates &updates) {
|
||||
bool PtsWaiter::updated(ChannelData *channel, int32 pts, int32 count, const MTPUpdates &updates) {
|
||||
if (_requesting || _applySkippedLevel) {
|
||||
return true;
|
||||
} else if (pts <= _good) {
|
||||
} else if (pts <= _good && count > 0) {
|
||||
return false;
|
||||
} else if (check(channel, pts, ptsCount)) {
|
||||
} else if (check(channel, pts, count)) {
|
||||
return true;
|
||||
}
|
||||
_updatesQueue.insert(ptsKey(SkippedUpdates), updates);
|
||||
return false;
|
||||
}
|
||||
|
||||
bool PtsWaiter::updated(ChannelData *channel, int32 pts, int32 ptsCount, const MTPUpdate &update) {
|
||||
bool PtsWaiter::updated(ChannelData *channel, int32 pts, int32 count, const MTPUpdate &update) {
|
||||
if (_requesting || _applySkippedLevel) {
|
||||
return true;
|
||||
} else if (pts <= _good) {
|
||||
} else if (pts <= _good && count > 0) {
|
||||
return false;
|
||||
} else if (check(channel, pts, ptsCount)) {
|
||||
} else if (check(channel, pts, count)) {
|
||||
return true;
|
||||
}
|
||||
_updateQueue.insert(ptsKey(SkippedUpdate), update);
|
||||
|
Loading…
Reference in New Issue
Block a user