aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorKitsune Ral <Kitsune-Ral@users.sf.net>2019-03-14 07:42:24 +0900
committerKitsune Ral <Kitsune-Ral@users.sf.net>2019-03-14 07:42:24 +0900
commitf13d54bd9931a340af862cc0a03af2ac68fe5e06 (patch)
tree282e66195248741d315b7158fdea6b7416fc219f /lib
parent8c685b4ae5b47e55a55f23e16ccbda0132cb60c5 (diff)
downloadlibquotient-f13d54bd9931a340af862cc0a03af2ac68fe5e06.tar.gz
libquotient-f13d54bd9931a340af862cc0a03af2ac68fe5e06.zip
Fix read receipts and redactions on v3 rooms
Previously slashes in eventIds (that come plenty in v3 due to base64 encoding) were not properly encoded - they are now.
Diffstat (limited to 'lib')
-rw-r--r--lib/jobs/basejob.cpp2
-rw-r--r--lib/room.cpp8
2 files changed, 5 insertions, 5 deletions
diff --git a/lib/jobs/basejob.cpp b/lib/jobs/basejob.cpp
index 8c3381ae..f738ce7a 100644
--- a/lib/jobs/basejob.cpp
+++ b/lib/jobs/basejob.cpp
@@ -186,7 +186,7 @@ QUrl BaseJob::makeRequestUrl(QUrl baseUrl,
if (!pathBase.endsWith('/') && !path.startsWith('/'))
pathBase.push_back('/');
- baseUrl.setPath( pathBase + path );
+ baseUrl.setPath(pathBase + path, QUrl::TolerantMode);
baseUrl.setQuery(query);
return baseUrl;
}
diff --git a/lib/room.cpp b/lib/room.cpp
index f2e03e94..dbddad05 100644
--- a/lib/room.cpp
+++ b/lib/room.cpp
@@ -579,8 +579,8 @@ Room::Changes Room::Private::markMessagesAsRead(rev_iter_t upToMarker)
{
if ((*upToMarker)->senderId() != q->localUser()->id())
{
- connection->callApi<PostReceiptJob>(id, "m.read",
- (*upToMarker)->id());
+ connection->callApi<PostReceiptJob>(id, QStringLiteral("m.read"),
+ QUrl::toPercentEncoding((*upToMarker)->id()));
break;
}
}
@@ -1734,8 +1734,8 @@ void Room::unban(const QString& userId)
void Room::redactEvent(const QString& eventId, const QString& reason)
{
- connection()->callApi<RedactEventJob>(
- id(), eventId, connection()->generateTxnId(), reason);
+ connection()->callApi<RedactEventJob>(id(),
+ QUrl::toPercentEncoding(eventId), connection()->generateTxnId(), reason);
}
void Room::uploadFile(const QString& id, const QUrl& localFilename,