mirror of
https://github.com/Nheko-Reborn/nheko.git
synced 2024-11-22 11:00:48 +03:00
Merge pull request #1033 from Apurv404/fix-room-alias-issue
Fix room alias issue (#354)
This commit is contained in:
commit
a100a5b2f0
1 changed files with 7 additions and 0 deletions
|
@ -749,6 +749,13 @@ ChatPage::joinRoomVia(const std::string &room_id,
|
||||||
void
|
void
|
||||||
ChatPage::createRoom(const mtx::requests::CreateRoom &req)
|
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(
|
http::client()->create_room(
|
||||||
req, [this](const mtx::responses::CreateRoom &res, mtx::http::RequestErr err) {
|
req, [this](const mtx::responses::CreateRoom &res, mtx::http::RequestErr err) {
|
||||||
if (err) {
|
if (err) {
|
||||||
|
|
Loading…
Reference in a new issue