aboutsummaryrefslogtreecommitdiff
path: root/lib/uri.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/uri.cpp')
-rw-r--r--lib/uri.cpp19
1 files changed, 10 insertions, 9 deletions
diff --git a/lib/uri.cpp b/lib/uri.cpp
index 3ce81a21..11c59b69 100644
--- a/lib/uri.cpp
+++ b/lib/uri.cpp
@@ -3,27 +3,28 @@
#include "uri.h"
+#include "util.h"
#include "logging.h"
#include <QtCore/QRegularExpression>
using namespace Quotient;
-struct ReplacePair { QByteArray uriString; char sigil; };
+struct ReplacePair { QLatin1String uriString; char sigil; };
/// \brief Defines bi-directional mapping of path prefixes and sigils
///
/// When there are two prefixes for the same sigil, the first matching
/// entry for a given sigil is used.
-static const auto replacePairs = {
- ReplacePair { "u/", '@' },
- { "user/", '@' },
- { "roomid/", '!' },
- { "r/", '#' },
- { "room/", '#' },
+static const ReplacePair replacePairs[] = {
+ { "u/"_ls, '@' },
+ { "user/"_ls, '@' },
+ { "roomid/"_ls, '!' },
+ { "r/"_ls, '#' },
+ { "room/"_ls, '#' },
// The notation for bare event ids is not proposed in MSC2312 but there's
// https://github.com/matrix-org/matrix-doc/pull/2644
- { "e/", '$' },
- { "event/", '$' }
+ { "e/"_ls, '$' },
+ { "event/"_ls, '$' }
};
Uri::Uri(QByteArray primaryId, QByteArray secondaryId, QString query)