summary refs log tree commit diff
path: root/src/ChatPage.cpp
diff options
context:
space:
mode:
authorNicolas Werner <nicolas.werner@hotmail.de>2021-12-17 05:53:34 +0100
committerNicolas Werner <nicolas.werner@hotmail.de>2021-12-17 05:58:09 +0100
commit09aded2bc8b447915511b26ebe71eab6ec98585a (patch)
tree5e99c631f9c6f5b7d37a8fec1fb61f58b4b141b6 /src/ChatPage.cpp
parentTranslated using Weblate (French) (diff)
downloadnheko-09aded2bc8b447915511b26ebe71eab6ec98585a.tar.xz
Fix crash when receiving matrix uri
It seems like handling the message in a blocking manner is a no-go. I
have no idea how to fix that, so just use a queued connection for now...
(ASAN does not cooperate and just hides the crash D:)

fixes #842
Diffstat (limited to '')
-rw-r--r--src/ChatPage.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/ChatPage.cpp b/src/ChatPage.cpp

index 7c6dde96..86e2141f 100644 --- a/src/ChatPage.cpp +++ b/src/ChatPage.cpp
@@ -1252,10 +1252,10 @@ mxidFromSegments(QStringRef sigil, QStringRef mxid) } bool -ChatPage::handleMatrixUri(const QByteArray &uri) +ChatPage::handleMatrixUri(QString uri) { nhlog::ui()->info("Received uri! {}", uri.toStdString()); - QUrl uri_{QString::fromUtf8(uri)}; + QUrl uri_{uri}; // Convert matrix.to URIs to proper format if (uri_.scheme() == "https" && uri_.host() == "matrix.to") { @@ -1324,7 +1324,8 @@ ChatPage::handleMatrixUri(const QByteArray &uri) std::vector<std::string> vias; QString action; - for (QString item : uri_.query(QUrl::ComponentFormattingOption::FullyEncoded).split('&')) { + for (QString item : + uri_.query(QUrl::ComponentFormattingOption::FullyEncoded).split('&', Qt::SkipEmptyParts)) { nhlog::ui()->info("item: {}", item.toStdString()); if (item.startsWith("action=")) {