mirror of
https://git.jami.net/savoirfairelinux/jami-client-qt.git
synced 2025-08-21 07:05:59 +02:00
callview: fix peer recording status
Change-Id: Id98c0d890d694c61da2fbcbd7fe3c0fcf85458a2 GitLab: #430
This commit is contained in:
parent
580f0f2d4c
commit
946e4482fe
4 changed files with 41 additions and 16 deletions
|
@ -307,6 +307,7 @@ CallAdapter::updateCall(const QString& convUid, const QString& accountId, bool f
|
||||||
}
|
}
|
||||||
|
|
||||||
updateCallOverlay(convInfo);
|
updateCallOverlay(convInfo);
|
||||||
|
updateRecordingPeers(true);
|
||||||
Q_EMIT previewVisibilityNeedToChange(shouldShowPreview(forceCallOnly));
|
Q_EMIT previewVisibilityNeedToChange(shouldShowPreview(forceCallOnly));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -541,27 +542,39 @@ CallAdapter::connectCallModel(const QString& accountId)
|
||||||
accInfo.callModel.get(),
|
accInfo.callModel.get(),
|
||||||
&lrc::api::NewCallModel::remoteRecordingChanged,
|
&lrc::api::NewCallModel::remoteRecordingChanged,
|
||||||
this,
|
this,
|
||||||
[this](const QString& callId, const QSet<QString>& peerRec, bool state) {
|
[this](const QString& callId, const QSet<QString>&, bool) {
|
||||||
const auto currentCallId = lrcInstance_->getCallIdForConversationUid(convUid_,
|
const auto currentCallId = lrcInstance_->getCallIdForConversationUid(convUid_,
|
||||||
accountId_);
|
accountId_);
|
||||||
if (callId == currentCallId) {
|
if (callId == currentCallId)
|
||||||
|
updateRecordingPeers();
|
||||||
|
},
|
||||||
|
Qt::UniqueConnection);
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
CallAdapter::updateRecordingPeers(bool eraseLabelOnEmpty)
|
||||||
|
{
|
||||||
|
const auto& convInfo = lrcInstance_->getConversationFromConvUid(convUid_);
|
||||||
|
auto* call = lrcInstance_->getCallInfoForConversation(convInfo);
|
||||||
|
if (!call) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
const auto& accInfo = lrcInstance_->getCurrentAccountInfo();
|
const auto& accInfo = lrcInstance_->getCurrentAccountInfo();
|
||||||
QStringList peers {};
|
QStringList peers {};
|
||||||
for (const auto& uri : peerRec) {
|
for (const auto& uri : call->peerRec) {
|
||||||
auto bestName = accInfo.contactModel->bestNameForContact(uri);
|
auto bestName = accInfo.contactModel->bestNameForContact(uri);
|
||||||
if (!bestName.isEmpty()) {
|
if (!bestName.isEmpty()) {
|
||||||
peers.append(bestName);
|
peers.append(bestName);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!peers.isEmpty()) {
|
if (!peers.isEmpty())
|
||||||
Q_EMIT remoteRecordingChanged(peers, true);
|
Q_EMIT remoteRecordingChanged(peers, true);
|
||||||
} else if (!state) {
|
else if (eraseLabelOnEmpty)
|
||||||
|
Q_EMIT eraseRemoteRecording();
|
||||||
|
else
|
||||||
Q_EMIT remoteRecordingChanged(peers, false);
|
Q_EMIT remoteRecordingChanged(peers, false);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
},
|
|
||||||
Qt::UniqueConnection);
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
void
|
||||||
CallAdapter::sipInputPanelPlayDTMF(const QString& key)
|
CallAdapter::sipInputPanelPlayDTMF(const QString& key)
|
||||||
|
|
|
@ -97,6 +97,7 @@ Q_SIGNALS:
|
||||||
bool isConferenceCall,
|
bool isConferenceCall,
|
||||||
const QString& bestName);
|
const QString& bestName);
|
||||||
void remoteRecordingChanged(const QStringList& peers, bool state);
|
void remoteRecordingChanged(const QStringList& peers, bool state);
|
||||||
|
void eraseRemoteRecording();
|
||||||
|
|
||||||
public Q_SLOTS:
|
public Q_SLOTS:
|
||||||
void onShowIncomingCallView(const QString& accountId, const QString& convUid);
|
void onShowIncomingCallView(const QString& accountId, const QString& convUid);
|
||||||
|
@ -105,6 +106,7 @@ public Q_SLOTS:
|
||||||
void onCallStatusChanged(const QString& accountId, const QString& callId);
|
void onCallStatusChanged(const QString& accountId, const QString& callId);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
void updateRecordingPeers(bool eraseLabelOnEmpty = false);
|
||||||
bool shouldShowPreview(bool force);
|
bool shouldShowPreview(bool force);
|
||||||
void showNotification(const QString& accountId, const QString& convUid);
|
void showNotification(const QString& accountId, const QString& convUid);
|
||||||
QJsonObject fillParticipantData(QMap<QString, QString> participant);
|
QJsonObject fillParticipantData(QMap<QString, QString> participant);
|
||||||
|
|
|
@ -218,6 +218,12 @@ Rectangle {
|
||||||
callOverlayRectMouseArea.entered()
|
callOverlayRectMouseArea.entered()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function resetRemoteRecording() {
|
||||||
|
remoteRecordingLabel = ""
|
||||||
|
callViewContextMenu.peerIsRecording = false
|
||||||
|
recordingRect.visible = callViewContextMenu.localIsRecording
|
||||||
|
}
|
||||||
|
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
|
|
||||||
SipInputPanel {
|
SipInputPanel {
|
||||||
|
|
|
@ -208,6 +208,10 @@ Rectangle {
|
||||||
function onRemoteRecordingChanged(label, state) {
|
function onRemoteRecordingChanged(label, state) {
|
||||||
callOverlay.showRemoteRecording(label, state)
|
callOverlay.showRemoteRecording(label, state)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function onEraseRemoteRecording() {
|
||||||
|
callOverlay.resetRemoteRecording()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
onOverlayChatButtonClicked: {
|
onOverlayChatButtonClicked: {
|
||||||
|
|
Loading…
Add table
Reference in a new issue