summary refs log tree commit diff
path: root/src/timeline
diff options
context:
space:
mode:
authortrilene <trilene@runbox.com>2020-12-18 12:49:24 -0500
committerNicolas Werner <nicolas.werner@hotmail.de>2021-01-07 14:04:50 +0100
commit07ac7b7e85b504953b0a751a3f56b60ce0a6fb37 (patch)
tree31bbb685ab74f634a34303701f1ed9c7e2a1a8c7 /src/timeline
parentFix one-way video calls (diff)
downloadnheko-07ac7b7e85b504953b0a751a3f56b60ce0a6fb37.tar.xz
Port PlaceCall dialog to Qml
Diffstat (limited to 'src/timeline')
-rw-r--r--src/timeline/InputBar.cpp46
-rw-r--r--src/timeline/InputBar.h1
2 files changed, 0 insertions, 47 deletions
diff --git a/src/timeline/InputBar.cpp b/src/timeline/InputBar.cpp
index 78c8c6a3..3cddd613 100644
--- a/src/timeline/InputBar.cpp
+++ b/src/timeline/InputBar.cpp
@@ -13,7 +13,6 @@
 #include <mtx/responses/media.hpp>
 
 #include "Cache.h"
-#include "CallManager.h"
 #include "ChatPage.h"
 #include "CompletionProxyModel.h"
 #include "Logging.h"
@@ -25,7 +24,6 @@
 #include "UserSettingsPage.h"
 #include "UsersModel.h"
 #include "Utils.h"
-#include "dialogs/PlaceCall.h"
 #include "dialogs/PreviewUploadOverlay.h"
 #include "emoji/EmojiModel.h"
 
@@ -594,50 +592,6 @@ InputBar::showPreview(const QMimeData &source, QString path, const QStringList &
 }
 
 void
-InputBar::callButton()
-{
-        auto callManager_ = ChatPage::instance()->callManager();
-        if (callManager_->haveCallInvite()) {
-                return;
-        } else if (callManager_->isOnCall()) {
-                callManager_->hangUp();
-        } else {
-                auto current_room_ = room->roomId();
-                if (auto roomInfo = cache::singleRoomInfo(current_room_.toStdString());
-                    roomInfo.member_count != 2) {
-                        ChatPage::instance()->showNotification("Calls are limited to 1:1 rooms.");
-                } else {
-                        std::vector<RoomMember> members(
-                          cache::getMembers(current_room_.toStdString()));
-                        const RoomMember &callee = members.front().user_id == utils::localUser()
-                                                     ? members.back()
-                                                     : members.front();
-                        auto dialog =
-                          new dialogs::PlaceCall(callee.user_id,
-                                                 callee.display_name,
-                                                 QString::fromStdString(roomInfo.name),
-                                                 QString::fromStdString(roomInfo.avatar_url),
-                                                 ChatPage::instance()->userSettings(),
-                                                 MainWindow::instance());
-                        connect(dialog,
-                                &dialogs::PlaceCall::voice,
-                                callManager_,
-                                [callManager_, current_room_]() {
-                                        callManager_->sendInvite(current_room_, false);
-                                });
-                        connect(dialog,
-                                &dialogs::PlaceCall::video,
-                                callManager_,
-                                [callManager_, current_room_]() {
-                                        callManager_->sendInvite(current_room_, true);
-                                });
-                        utils::centerWidget(dialog, MainWindow::instance());
-                        dialog->show();
-                }
-        }
-}
-
-void
 InputBar::startTyping()
 {
         if (!typingRefresh_.isActive()) {
diff --git a/src/timeline/InputBar.h b/src/timeline/InputBar.h
index 89ca34fe..c729a6fc 100644
--- a/src/timeline/InputBar.h
+++ b/src/timeline/InputBar.h
@@ -41,7 +41,6 @@ public slots:
         void updateState(int selectionStart, int selectionEnd, int cursorPosition, QString text);
         void openFileSelection();
         bool uploading() const { return uploading_; }
-        void callButton();
         void message(QString body);
 
         QObject *completerFor(QString completerName);