summary refs log tree commit diff
path: root/src/timeline
diff options
context:
space:
mode:
authortrilene <trilene@runbox.com>2020-09-25 10:26:36 -0400
committertrilene <trilene@runbox.com>2020-09-25 10:26:36 -0400
commit3f73853e4b71b67ab6c8ced2dd4eb1e7f473025e (patch)
tree634c964effe292a5f1e093e5179a341e5f10df09 /src/timeline
parentclang-format (diff)
downloadnheko-3f73853e4b71b67ab6c8ced2dd4eb1e7f473025e.tar.xz
Move ActiveCallBar Qml to separate file
Diffstat (limited to 'src/timeline')
-rw-r--r--src/timeline/TimelineViewManager.cpp10
-rw-r--r--src/timeline/TimelineViewManager.h15
2 files changed, 19 insertions, 6 deletions
diff --git a/src/timeline/TimelineViewManager.cpp b/src/timeline/TimelineViewManager.cpp

index 09ab8cf8..2b453e56 100644 --- a/src/timeline/TimelineViewManager.cpp +++ b/src/timeline/TimelineViewManager.cpp
@@ -7,7 +7,6 @@ #include <QString> #include "BlurhashProvider.h" -#include "CallManager.h" #include "ChatPage.h" #include "ColorImageProvider.h" #include "DelegateChooser.h" @@ -145,6 +144,8 @@ TimelineViewManager::TimelineViewManager(QSharedPointer<UserSettings> userSettin &WebRTCSession::stateChanged, this, &TimelineViewManager::callStateChanged); + connect( + callManager_, &CallManager::newCallParty, this, &TimelineViewManager::callPartyChanged); } void @@ -217,6 +218,13 @@ TimelineViewManager::escapeEmoji(QString str) const } void +TimelineViewManager::toggleMicMute() +{ + WebRTCSession::instance().toggleMicMute(); + emit micMuteChanged(); +} + +void TimelineViewManager::openImageOverlay(QString mxcUrl, QString eventId) const { QQuickImageResponse *imgResponse = diff --git a/src/timeline/TimelineViewManager.h b/src/timeline/TimelineViewManager.h
index 243927ef..9ff9adac 100644 --- a/src/timeline/TimelineViewManager.h +++ b/src/timeline/TimelineViewManager.h
@@ -10,6 +10,7 @@ #include <mtx/responses.hpp> #include "Cache.h" +#include "CallManager.h" #include "Logging.h" #include "TimelineModel.h" #include "Utils.h" @@ -19,7 +20,6 @@ class MxcImageProvider; class BlurhashProvider; -class CallManager; class ColorImageProvider; class UserSettings; class ChatPage; @@ -35,6 +35,9 @@ class TimelineViewManager : public QObject Q_PROPERTY( bool isNarrowView MEMBER isNarrowView_ READ isNarrowView NOTIFY narrowViewChanged) Q_PROPERTY(webrtc::State callState READ callState NOTIFY callStateChanged) + Q_PROPERTY(QString callPartyName READ callPartyName NOTIFY callPartyChanged) + Q_PROPERTY(QString callPartyAvatarUrl READ callPartyAvatarUrl NOTIFY callPartyChanged) + Q_PROPERTY(bool isMicMuted READ isMicMuted NOTIFY micMuteChanged) public: TimelineViewManager(QSharedPointer<UserSettings> userSettings, @@ -51,10 +54,10 @@ public: Q_INVOKABLE bool isInitialSync() const { return isInitialSync_; } bool isNarrowView() const { return isNarrowView_; } webrtc::State callState() const { return WebRTCSession::instance().state(); } - Q_INVOKABLE bool toggleMuteAudioSource() - { - return WebRTCSession::instance().toggleMuteAudioSource(); - } + QString callPartyName() const { return callManager_->callPartyName(); } + QString callPartyAvatarUrl() const { return callManager_->callPartyAvatarUrl(); } + bool isMicMuted() const { return WebRTCSession::instance().isMicMuted(); } + Q_INVOKABLE void toggleMicMute(); Q_INVOKABLE void openImageOverlay(QString mxcUrl, QString eventId) const; Q_INVOKABLE QColor userColor(QString id, QColor background); Q_INVOKABLE QString escapeEmoji(QString str) const; @@ -80,6 +83,8 @@ signals: void showRoomList(); void narrowViewChanged(); void callStateChanged(webrtc::State); + void callPartyChanged(); + void micMuteChanged(); public slots: void updateReadReceipts(const QString &room_id, const std::vector<QString> &event_ids);