Merge pull request #1033 from Apurv404/fix-room-alias-issue

Fix room alias issue (#354)
pull/1022/head
DeepBlueV7.X 3 years ago committed by GitHub
commit a100a5b2f0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 7
      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) {

Loading…
Cancel
Save