1
0
Fork 0
mirror of https://git.jami.net/savoirfairelinux/jami-client-qt.git synced 2025-07-14 04:25:22 +02:00

callview: fix peer recording status

Change-Id: Id98c0d890d694c61da2fbcbd7fe3c0fcf85458a2
GitLab: #430
This commit is contained in:
Sébastien Blin 2021-05-21 14:14:56 -04:00
parent 580f0f2d4c
commit 946e4482fe
4 changed files with 41 additions and 16 deletions

View file

@ -307,6 +307,7 @@ CallAdapter::updateCall(const QString& convUid, const QString& accountId, bool f
}
updateCallOverlay(convInfo);
updateRecordingPeers(true);
Q_EMIT previewVisibilityNeedToChange(shouldShowPreview(forceCallOnly));
}
@ -541,28 +542,40 @@ CallAdapter::connectCallModel(const QString& accountId)
accInfo.callModel.get(),
&lrc::api::NewCallModel::remoteRecordingChanged,
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_,
accountId_);
if (callId == currentCallId) {
const auto& accInfo = lrcInstance_->getCurrentAccountInfo();
QStringList peers {};
for (const auto& uri : peerRec) {
auto bestName = accInfo.contactModel->bestNameForContact(uri);
if (!bestName.isEmpty()) {
peers.append(bestName);
}
}
if (!peers.isEmpty()) {
Q_EMIT remoteRecordingChanged(peers, true);
} else if (!state) {
Q_EMIT remoteRecordingChanged(peers, false);
}
}
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();
QStringList peers {};
for (const auto& uri : call->peerRec) {
auto bestName = accInfo.contactModel->bestNameForContact(uri);
if (!bestName.isEmpty()) {
peers.append(bestName);
}
}
if (!peers.isEmpty())
Q_EMIT remoteRecordingChanged(peers, true);
else if (eraseLabelOnEmpty)
Q_EMIT eraseRemoteRecording();
else
Q_EMIT remoteRecordingChanged(peers, false);
}
void
CallAdapter::sipInputPanelPlayDTMF(const QString& key)
{

View file

@ -97,6 +97,7 @@ Q_SIGNALS:
bool isConferenceCall,
const QString& bestName);
void remoteRecordingChanged(const QStringList& peers, bool state);
void eraseRemoteRecording();
public Q_SLOTS:
void onShowIncomingCallView(const QString& accountId, const QString& convUid);
@ -105,6 +106,7 @@ public Q_SLOTS:
void onCallStatusChanged(const QString& accountId, const QString& callId);
private:
void updateRecordingPeers(bool eraseLabelOnEmpty = false);
bool shouldShowPreview(bool force);
void showNotification(const QString& accountId, const QString& convUid);
QJsonObject fillParticipantData(QMap<QString, QString> participant);

View file

@ -218,6 +218,12 @@ Rectangle {
callOverlayRectMouseArea.entered()
}
function resetRemoteRecording() {
remoteRecordingLabel = ""
callViewContextMenu.peerIsRecording = false
recordingRect.visible = callViewContextMenu.localIsRecording
}
anchors.fill: parent
SipInputPanel {

View file

@ -208,6 +208,10 @@ Rectangle {
function onRemoteRecordingChanged(label, state) {
callOverlay.showRemoteRecording(label, state)
}
function onEraseRemoteRecording() {
callOverlay.resetRemoteRecording()
}
}
onOverlayChatButtonClicked: {