aboutsummaryrefslogtreecommitdiff
path: root/quotest/quotest.cpp
diff options
context:
space:
mode:
authorAlexey Rusakov <Kitsune-Ral@users.sf.net>2021-02-21 20:20:38 +0100
committerAlexey Rusakov <Kitsune-Ral@users.sf.net>2021-02-21 20:48:05 +0100
commit81664eaf5a983dbd326e4d24d21c2108ea4d6353 (patch)
tree6d5022087ff375d7f6ef9f6ff81aa0245d0feb8f /quotest/quotest.cpp
parent48d2ecc4df4d1883326036e55949156cfb37acc6 (diff)
downloadlibquotient-81664eaf5a983dbd326e4d24d21c2108ea4d6353.tar.gz
libquotient-81664eaf5a983dbd326e4d24d21c2108ea4d6353.zip
Uri: support abbreviated types in Matrix URIs
As per the latest iteration of MSC2312, room/, user/ and event/ are only supported for parsing and replication but not for emitting from Matrix identifiers. (cherry picked from commit 86f24d1ecf300b82b3a7253b81a2c392669d2c2b)
Diffstat (limited to 'quotest/quotest.cpp')
-rw-r--r--quotest/quotest.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/quotest/quotest.cpp b/quotest/quotest.cpp
index bf29c434..a0914c72 100644
--- a/quotest/quotest.cpp
+++ b/quotest/quotest.cpp
@@ -733,12 +733,15 @@ TEST_IMPL(visitResources)
roomId, "matrix:roomid/" + roomId.mid(1),
"https://matrix.to/#/%21"/*`!`*/ + roomId.mid(1),
roomAlias, "matrix:room/" + roomAlias.mid(1),
+ "matrix:r/" + roomAlias.mid(1),
"https://matrix.to/#/" + roomAlias,
};
const QStringList userUris { userId, "matrix:user/" + userId.mid(1),
+ "matrix:u/" + userId.mid(1),
"https://matrix.to/#/" + userId };
const QStringList eventUris {
"matrix:room/" + roomAlias.mid(1) + "/event/" + eventId.mid(1),
+ "matrix:r/" + roomAlias.mid(1) + "/e/" + eventId.mid(1),
"https://matrix.to/#/" + roomId + '/' + eventId
};
// Check that reserved characters are correctly processed.
@@ -752,6 +755,7 @@ TEST_IMPL(visitResources)
static const QStringList joinByAliasUris {
Uri(joinRoomAlias.toUtf8(), {}, joinQuery.mid(1)).toDisplayString(),
"matrix:room/" + encodedRoomAliasNoSigil + joinQuery,
+ "matrix:r/" + encodedRoomAliasNoSigil + joinQuery,
"https://matrix.to/#/%23"/*`#`*/ + encodedRoomAliasNoSigil + joinQuery,
"https://matrix.to/#/%23" + joinRoomAlias.mid(1) /* unencoded */ + joinQuery
};