2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 14:38:15 +00:00
This commit is contained in:
John Preston
2015-12-25 16:09:23 +03:00

View File

@@ -1120,7 +1120,8 @@ LayoutOverviewLink::LayoutOverviewLink(HistoryMedia *media, HistoryItem *parent)
if (_page) {
_title = _page->title;
}
QVector<QStringRef> parts = (_page ? _page->url : (_links.isEmpty() ? QString() : _links.at(0).lnk->text())).splitRef('/');
QString url(_page ? _page->url : (_links.isEmpty() ? QString() : _links.at(0).lnk->text()));
QVector<QStringRef> parts = url.splitRef('/');
if (!parts.isEmpty()) {
QStringRef domain = parts.at(0);
if (parts.size() > 2 && domain.endsWith(':') && parts.at(1).isEmpty()) { // http:// and others
@@ -1278,4 +1279,4 @@ LayoutOverviewLink::Link::Link(const QString &url, const QString &text)
: text(text)
, width(st::normalFont->width(text))
, lnk(linkFromUrl(url)) {
}
}