Warn before kicking,banning,inviting,etc
This commit is contained in:
parent
7650e6ced6
commit
aa34576dfd
3 changed files with 56 additions and 12 deletions
|
|
@ -1,6 +1,7 @@
|
|||
#include <QHBoxLayout>
|
||||
#include <QLabel>
|
||||
#include <QListWidget>
|
||||
#include <QMessageBox>
|
||||
#include <QShortcut>
|
||||
#include <QVBoxLayout>
|
||||
|
||||
|
|
@ -97,6 +98,14 @@ UserProfile::UserProfile(QWidget *parent)
|
|||
if (utils::localUser() != user_id)
|
||||
req.invite = {user_id.toStdString()};
|
||||
|
||||
if (QMessageBox::question(
|
||||
this,
|
||||
tr("Confirm DM"),
|
||||
tr("Do you really want to invite %1 (%2) to a direct chat?")
|
||||
.arg(cache::displayName(roomId_, user_id))
|
||||
.arg(user_id)) != QMessageBox::Yes)
|
||||
return;
|
||||
|
||||
emit ChatPage::instance()->createRoom(req);
|
||||
});
|
||||
|
||||
|
|
@ -199,6 +208,8 @@ UserProfile::init(const QString &userId, const QString &roomId)
|
|||
{
|
||||
resetToDefaults();
|
||||
|
||||
this->roomId_ = roomId;
|
||||
|
||||
auto displayName = cache::displayName(roomId, userId);
|
||||
|
||||
userIdLabel_->setText(userId);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue