Add /knock command
This commit is contained in:
parent
cb76777fce
commit
c91f91d5d3
4 changed files with 25 additions and 2 deletions
|
|
@ -658,6 +658,25 @@ ChatPage::trySync()
|
|||
});
|
||||
}
|
||||
|
||||
void
|
||||
ChatPage::knockRoom(const QString &room)
|
||||
{
|
||||
const auto room_id = room.toStdString();
|
||||
if (QMessageBox::Yes !=
|
||||
QMessageBox::question(
|
||||
nullptr, tr("Confirm knock"), tr("Do you really want to ask to join %1?").arg(room)))
|
||||
return;
|
||||
|
||||
http::client()->knock_room(
|
||||
room_id, {}, [this, room_id](const mtx::responses::RoomId &, mtx::http::RequestErr err) {
|
||||
if (err) {
|
||||
emit showNotification(tr("Failed to knock room: %1")
|
||||
.arg(QString::fromStdString(err->matrix_error.error)));
|
||||
return;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
void
|
||||
ChatPage::joinRoom(const QString &room)
|
||||
{
|
||||
|
|
@ -686,8 +705,6 @@ ChatPage::joinRoomVia(const std::string &room_id,
|
|||
return;
|
||||
}
|
||||
|
||||
emit tr("You joined the room");
|
||||
|
||||
// We remove any invites with the same room_id.
|
||||
try {
|
||||
cache::removeInvite(room_id);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue