summary refs log tree commit diff
path: root/src/timeline
diff options
context:
space:
mode:
authorLoren Burkholder <computersemiexpert@outlook.com>2021-09-23 21:18:48 -0400
committerLoren Burkholder <computersemiexpert@outlook.com>2021-10-11 19:00:40 -0400
commit14488a8fe78f829dadf3899a1c50ab389d05dbe9 (patch)
treec18e36ccbd831a51fd85288d6a92a15ea494f130 /src/timeline
parentRemove unimplemented function declaration (diff)
downloadnheko-14488a8fe78f829dadf3899a1c50ab389d05dbe9.tar.xz
Use the same leave room dialog everywhere
This ports the leave room dialog to QML, everywhere. There are now no differences between the various leave dialogs.
Diffstat (limited to 'src/timeline')
-rw-r--r--src/timeline/InputBar.cpp2
-rw-r--r--src/timeline/TimelineViewManager.cpp6
-rw-r--r--src/timeline/TimelineViewManager.h2
3 files changed, 2 insertions, 8 deletions
diff --git a/src/timeline/InputBar.cpp b/src/timeline/InputBar.cpp
index f518248b..f33d1dfd 100644
--- a/src/timeline/InputBar.cpp
+++ b/src/timeline/InputBar.cpp
@@ -577,7 +577,7 @@ InputBar::command(QString command, QString args)
     } else if (command == "join") {
         ChatPage::instance()->joinRoom(args);
     } else if (command == "part" || command == "leave") {
-        MainWindow::instance()->openLeaveRoomDialog(room->roomId());
+        ChatPage::instance()->timelineManager()->openLeaveRoomDialog(room->roomId());
     } else if (command == "invite") {
         ChatPage::instance()->inviteUser(args.section(' ', 0, 0), args.section(' ', 1, -1));
     } else if (command == "kick") {
diff --git a/src/timeline/TimelineViewManager.cpp b/src/timeline/TimelineViewManager.cpp
index df8210d3..a30a145d 100644
--- a/src/timeline/TimelineViewManager.cpp
+++ b/src/timeline/TimelineViewManager.cpp
@@ -476,12 +476,6 @@ TimelineViewManager::openImageOverlayInternal(QString eventId, QImage img)
 }
 
 void
-TimelineViewManager::openLeaveRoomDialog(QString roomid) const
-{
-    MainWindow::instance()->openLeaveRoomDialog(roomid);
-}
-
-void
 TimelineViewManager::verifyUser(QString userid)
 {
     auto joined_rooms = cache::joinedRooms();
diff --git a/src/timeline/TimelineViewManager.h b/src/timeline/TimelineViewManager.h
index f7b01315..ab078aa7 100644
--- a/src/timeline/TimelineViewManager.h
+++ b/src/timeline/TimelineViewManager.h
@@ -73,7 +73,6 @@ public:
     Q_INVOKABLE void openGlobalUserProfile(QString userId);
 
     Q_INVOKABLE void focusMessageInput();
-    Q_INVOKABLE void openLeaveRoomDialog(QString roomid) const;
     Q_INVOKABLE void removeVerificationFlow(DeviceVerificationFlow *flow);
 
     Q_INVOKABLE void fixImageRendering(QQuickTextDocument *t, QQuickItem *i);
@@ -98,6 +97,7 @@ signals:
     void openInviteUsersDialog(InviteesModel *invitees);
     void openProfile(UserProfile *profile);
     void showImagePackSettings(ImagePackListModel *packlist);
+    void openLeaveRoomDialog(QString roomid);
 
 public slots:
     void updateReadReceipts(const QString &room_id, const std::vector<QString> &event_ids);