summary refs log tree commit diff
path: root/src/ChatPage.cpp
diff options
context:
space:
mode:
authorDeepBlueV7.X <nicolas.werner@hotmail.de>2022-04-02 02:49:18 +0200
committerGitHub <noreply@github.com>2022-04-02 02:49:18 +0200
commita100a5b2f074828ade5cb8efd3671d77183a761b (patch)
tree6e85c80e3df36f197ce19367dc4dceca759a5a30 /src/ChatPage.cpp
parentlint (diff)
parentFix room alias issue (#354) (diff)
downloadnheko-a100a5b2f074828ade5cb8efd3671d77183a761b.tar.xz
Merge pull request #1033 from Apurv404/fix-room-alias-issue
Fix room alias issue (#354)
Diffstat (limited to 'src/ChatPage.cpp')
-rw-r--r--src/ChatPage.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/ChatPage.cpp b/src/ChatPage.cpp

index 8dbba488..e6b6235b 100644 --- a/src/ChatPage.cpp +++ b/src/ChatPage.cpp
@@ -749,6 +749,13 @@ ChatPage::joinRoomVia(const std::string &room_id, void ChatPage::createRoom(const mtx::requests::CreateRoom &req) { + if (req.room_alias_name.find(":") != std::string::npos || + req.room_alias_name.find("#") != std::string::npos) { + nhlog::net()->warn("Failed to create room: Some characters are not allowed in alias"); + emit this->showNotification(tr("Room creation failed: Bad Alias")); + return; + } + http::client()->create_room( req, [this](const mtx::responses::CreateRoom &res, mtx::http::RequestErr err) { if (err) {