diff --git a/src/timeline/TimelineViewManager.cpp b/src/timeline/TimelineViewManager.cpp
index f10c2c0d..97af0065 100644
--- a/src/timeline/TimelineViewManager.cpp
+++ b/src/timeline/TimelineViewManager.cpp
@@ -136,6 +136,10 @@ TimelineViewManager::TimelineViewManager(CallManager *callManager, ChatPage *par
"im.nheko", 1, 0, "Settings", [](QQmlEngine *, QJSEngine *) -> QObject * {
return ChatPage::instance()->userSettings().data();
});
+ qmlRegisterSingletonType<CallManager>(
+ "im.nheko", 1, 0, "CallManager", [](QQmlEngine *, QJSEngine *) -> QObject * {
+ return ChatPage::instance()->callManager();
+ });
qRegisterMetaType<mtx::events::collections::TimelineEvents>();
qRegisterMetaType<std::vector<DeviceInfo>>();
@@ -237,36 +241,6 @@ TimelineViewManager::TimelineViewManager(CallManager *callManager, ChatPage *par
isInitialSync_ = true;
emit initialSyncChanged(true);
});
- connect(&WebRTCSession::instance(),
- &WebRTCSession::stateChanged,
- this,
- &TimelineViewManager::callStateChanged);
- connect(
- callManager_, &CallManager::newCallParty, this, &TimelineViewManager::callPartyChanged);
- connect(callManager_,
- &CallManager::newVideoCallState,
- this,
- &TimelineViewManager::videoCallChanged);
-
- connect(&WebRTCSession::instance(),
- &WebRTCSession::stateChanged,
- this,
- &TimelineViewManager::onCallChanged);
-}
-
-bool
-TimelineViewManager::isOnCall() const
-{
- return callManager_->onActiveCall();
-}
-bool
-TimelineViewManager::callsSupported() const
-{
-#ifdef GSTREAMER_AVAILABLE
- return true;
-#else
- return false;
-#endif
}
void
@@ -355,19 +329,6 @@ TimelineViewManager::escapeEmoji(QString str) const
}
void
-TimelineViewManager::toggleMicMute()
-{
- WebRTCSession::instance().toggleMicMute();
- emit micMuteChanged();
-}
-
-void
-TimelineViewManager::toggleCameraView()
-{
- WebRTCSession::instance().toggleCameraView();
-}
-
-void
TimelineViewManager::openImageOverlay(QString mxcUrl, QString eventId) const
{
if (mxcUrl.isEmpty()) {
|