diff options
-rw-r--r-- | lib/uri.cpp | 2 | ||||
-rw-r--r-- | tests/quotest.cpp | 5 |
2 files changed, 6 insertions, 1 deletions
diff --git a/lib/uri.cpp b/lib/uri.cpp index f813794c..8370d83a 100644 --- a/lib/uri.cpp +++ b/lib/uri.cpp @@ -134,7 +134,7 @@ QUrl Uri::toUrl(UriForm form) const url.setScheme("https"); url.setHost("matrix.to"); url.setPath("/"); - auto fragment = primaryId(); + auto fragment = '/' + primaryId(); if (const auto& secId = secondaryId(); !secId.isEmpty()) fragment += '/' + secId; if (const auto& q = query(); !q.isEmpty()) diff --git a/tests/quotest.cpp b/tests/quotest.cpp index f14edcc0..faad5a15 100644 --- a/tests/quotest.cpp +++ b/tests/quotest.cpp @@ -652,6 +652,11 @@ TEST_IMPL(visitResources) Uri uri { uriString }; clog << "Checking " << uriString.toStdString() << " -> " << uri.toDisplayString().toStdString() << endl; + if (auto matrixToUrl = uri.toUrl(Uri::MatrixToUri).toDisplayString(); + !matrixToUrl.startsWith("https://matrix.to/#/")) { + clog << "Incorrect matrix.to representation:" + << matrixToUrl.toStdString() << endl; + } ud.visitResource(connection(), uriString); if (spy.count() != 1) { clog << "Wrong number of signal emissions (" << spy.count() |