diff --git a/resources/langs/nheko_si.ts b/resources/langs/nheko_si.ts
new file mode 100644
index 00000000..2f405ca2
--- /dev/null
+++ b/resources/langs/nheko_si.ts
@@ -0,0 +1,1604 @@
+
+
+
+
+ Cache
+
+
+
+
+
+
+
+ ChatPage
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ CommunitiesListItem
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ EditModal
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ EncryptionIndicator
+
+
+
+
+
+
+
+
+
+
+
+
+ InviteeItem
+
+
+
+
+
+
+
+ LoginPage
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ MemberList
+
+
+
+
+
+
+
+
+
+
+
+
+ MessageDelegate
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Placeholder
+
+
+
+
+
+
+
+ QuickSwitcher
+
+
+
+
+
+
+
+ RegisterPage
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ RoomInfo
+
+
+
+
+
+
+
+ RoomInfoListItem
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Standard matrix tag for favourites
+
+
+
+
+
+ Standard matrix tag for low priority rooms
+
+
+
+
+
+ Standard matrix tag for server notices
+
+
+
+
+
+ WhatsThis hint for tag menu actions
+
+
+
+
+
+ Add a new tag to the room
+
+
+
+
+
+ Tag name prompt title
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ SideBarActions
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ StatusIndicator
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ TextInputWidget
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ TimelineModel
+
+
+
+ Placeholder, when the message can't be decrypted, because the DB access failed when trying to lookup the session.
+
+
+
+
+
+ Placeholder, when the message can't be decrypted, because the DB access failed.
+
+
+
+
+
+ Placeholder, when the message can't be decrypted. In this case, the Olm decrytion returned an error, which is passed ad %1.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Placeholder, when the message was not decrypted yet or can't be decrypted.
+
+
+
+
+
+ Placeholder, when the message was decrypted, but we couldn't parse it, because Nheko/mtxclient don't support that event type yet.
+
+
+
+
+
+ Multiple users are typing. First argument is a comma separated list of potentially multiple users. Second argument is the last user of that list. (If only one user is typing, %1 is empty. You should still use it in your string though to silence Qt warnings.)
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ This is a leave event after the user already left and shouldn't happen apart from state resets
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ TimelineRow
+
+
+
+
+
+
+
+
+
+
+
+
+ TimelineView
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ TopRoomBar
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ TrayIcon
+
+
+
+
+
+
+
+
+
+
+
+
+ UserInfoWidget
+
+
+
+
+
+
+
+ UserSettingsPage
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ WelcomePage
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ descriptiveTime
+
+
+
+
+
+
+
+ dialogs::CreateRoom
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ dialogs::FallbackAuth
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ dialogs::InviteUsers
+
+
+
+
+
+
+
+
+
+
+
+
+ dialogs::JoinRoom
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ dialogs::LeaveRoom
+
+
+
+
+
+
+
+
+
+
+
+
+ dialogs::Logout
+
+
+
+
+
+
+
+
+
+
+
+
+ dialogs::PreviewUploadOverlay
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ dialogs::ReCaptcha
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ dialogs::ReadReceipts
+
+
+
+
+
+
+
+
+
+
+
+
+ dialogs::ReceiptItem
+
+
+
+
+
+
+
+
+
+
+
+
+ dialogs::RoomSettings
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ dialogs::UserProfile
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ emoji::Panel
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ message-description sent:
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ popups::UserMentions
+
+
+
+
+
+
+
+
+
+
+
+
+ utils
+
+
+
+
+
+
+
diff --git a/resources/qml/TimelineView.qml b/resources/qml/TimelineView.qml
index 5494c1ba..6af0372b 100644
--- a/resources/qml/TimelineView.qml
+++ b/resources/qml/TimelineView.qml
@@ -245,6 +245,7 @@ Page {
width: contentWidth * 1.2
horizontalAlignment: Text.AlignHCenter
+ verticalAlignment: Text.AlignVCenter
background: Rectangle {
radius: parent.height / 2
color: colors.base
diff --git a/src/ChatPage.cpp b/src/ChatPage.cpp
index 09153154..589aa3c7 100644
--- a/src/ChatPage.cpp
+++ b/src/ChatPage.cpp
@@ -1197,11 +1197,19 @@ ChatPage::leaveRoom(const QString &room_id)
void
ChatPage::inviteUser(QString userid, QString reason)
{
+ auto room = current_room_;
+
+ if (QMessageBox::question(this,
+ tr("Confirm invite"),
+ tr("Do you really want to invite %1 (%2)?")
+ .arg(cache::displayName(current_room_, userid))
+ .arg(userid)) != QMessageBox::Yes)
+ return;
+
http::client()->invite_user(
- current_room_.toStdString(),
+ room.toStdString(),
userid.toStdString(),
- [this, userid, room = current_room_](const mtx::responses::Empty &,
- mtx::http::RequestErr err) {
+ [this, userid, room](const mtx::responses::Empty &, mtx::http::RequestErr err) {
if (err) {
emit showNotification(
tr("Failed to invite %1 to %2: %3")
@@ -1216,11 +1224,19 @@ ChatPage::inviteUser(QString userid, QString reason)
void
ChatPage::kickUser(QString userid, QString reason)
{
+ auto room = current_room_;
+
+ if (QMessageBox::question(this,
+ tr("Confirm kick"),
+ tr("Do you really want to kick %1 (%2)?")
+ .arg(cache::displayName(current_room_, userid))
+ .arg(userid)) != QMessageBox::Yes)
+ return;
+
http::client()->kick_user(
- current_room_.toStdString(),
+ room.toStdString(),
userid.toStdString(),
- [this, userid, room = current_room_](const mtx::responses::Empty &,
- mtx::http::RequestErr err) {
+ [this, userid, room](const mtx::responses::Empty &, mtx::http::RequestErr err) {
if (err) {
emit showNotification(
tr("Failed to kick %1 to %2: %3")
@@ -1235,11 +1251,19 @@ ChatPage::kickUser(QString userid, QString reason)
void
ChatPage::banUser(QString userid, QString reason)
{
+ auto room = current_room_;
+
+ if (QMessageBox::question(this,
+ tr("Confirm ban"),
+ tr("Do you really want to ban %1 (%2)?")
+ .arg(cache::displayName(current_room_, userid))
+ .arg(userid)) != QMessageBox::Yes)
+ return;
+
http::client()->ban_user(
- current_room_.toStdString(),
+ room.toStdString(),
userid.toStdString(),
- [this, userid, room = current_room_](const mtx::responses::Empty &,
- mtx::http::RequestErr err) {
+ [this, userid, room](const mtx::responses::Empty &, mtx::http::RequestErr err) {
if (err) {
emit showNotification(
tr("Failed to ban %1 in %2: %3")
@@ -1254,11 +1278,19 @@ ChatPage::banUser(QString userid, QString reason)
void
ChatPage::unbanUser(QString userid, QString reason)
{
+ auto room = current_room_;
+
+ if (QMessageBox::question(this,
+ tr("Confirm unban"),
+ tr("Do you really want to unban %1 (%2)?")
+ .arg(cache::displayName(current_room_, userid))
+ .arg(userid)) != QMessageBox::Yes)
+ return;
+
http::client()->unban_user(
- current_room_.toStdString(),
+ room.toStdString(),
userid.toStdString(),
- [this, userid, room = current_room_](const mtx::responses::Empty &,
- mtx::http::RequestErr err) {
+ [this, userid, room](const mtx::responses::Empty &, mtx::http::RequestErr err) {
if (err) {
emit showNotification(
tr("Failed to unban %1 in %2: %3")
diff --git a/src/dialogs/UserProfile.cpp b/src/dialogs/UserProfile.cpp
index 3415b127..086dbb40 100644
--- a/src/dialogs/UserProfile.cpp
+++ b/src/dialogs/UserProfile.cpp
@@ -1,6 +1,7 @@
#include
#include
#include
+#include
#include
#include
@@ -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);
diff --git a/src/dialogs/UserProfile.h b/src/dialogs/UserProfile.h
index 81276d2a..8129fdcf 100644
--- a/src/dialogs/UserProfile.h
+++ b/src/dialogs/UserProfile.h
@@ -53,6 +53,7 @@ private:
void resetToDefaults();
Avatar *avatar_;
+ QString roomId_;
QLabel *userIdLabel_;
QLabel *displayNameLabel_;