|
|
@ -106,12 +106,8 @@ ImageItem::openUrl() |
|
|
|
if (url_.toString().isEmpty()) |
|
|
|
if (url_.toString().isEmpty()) |
|
|
|
return; |
|
|
|
return; |
|
|
|
|
|
|
|
|
|
|
|
auto mxc_parts = mtx::client::utils::parse_mxc_url(url_.toString().toStdString()); |
|
|
|
auto urlToOpen = utils::mxcToHttp( |
|
|
|
auto urlToOpen = QString("https://%1:%2/_matrix/media/r0/download/%3/%4") |
|
|
|
url_, QString::fromStdString(http::client()->server()), http::client()->port()); |
|
|
|
.arg(QString::fromStdString(http::client()->server())) |
|
|
|
|
|
|
|
.arg(http::client()->port()) |
|
|
|
|
|
|
|
.arg(QString::fromStdString(mxc_parts.server)) |
|
|
|
|
|
|
|
.arg(QString::fromStdString(mxc_parts.media_id)); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!QDesktopServices::openUrl(urlToOpen)) |
|
|
|
if (!QDesktopServices::openUrl(urlToOpen)) |
|
|
|
nhlog::ui()->warn("could not open url: {}", urlToOpen.toStdString()); |
|
|
|
nhlog::ui()->warn("could not open url: {}", urlToOpen.toStdString()); |
|
|
|