Skip to content
Snippets Groups Projects
Commit b16c4ce8 authored by Pierre Lespagnol's avatar Pierre Lespagnol
Browse files

recorder: add remote recording indicator

Change-Id: Ia66613f93da247c5318f9468d09c6c470dc9f366
parent a0fafe5c
No related branches found
No related tags found
No related merge requests found
...@@ -144,6 +144,7 @@ struct Info ...@@ -144,6 +144,7 @@ struct Info
bool isAudioOnly = false; bool isAudioOnly = false;
Layout layout = Layout::GRID; Layout layout = Layout::GRID;
VectorMapStringString participantsInfos = {}; VectorMapStringString participantsInfos = {};
QSet<QString> peerRec {};
}; };
static inline bool static inline bool
......
...@@ -295,6 +295,15 @@ Q_SIGNALS: ...@@ -295,6 +295,15 @@ Q_SIGNALS:
int oldCount, int oldCount,
int urgentCount) const; int urgentCount) const;
/**
* Listen from CallbacksHandler when the peer start recording
* @param callId
* @param contactId
* @param peerName
* @param state the new state
*/
void remoteRecordingChanged(const QString& callId, const QSet<QString>& peerRec, bool state) const;
private: private:
std::unique_ptr<NewCallModelPimpl> pimpl_; std::unique_ptr<NewCallModelPimpl> pimpl_;
}; };
......
...@@ -162,6 +162,12 @@ CallbacksHandler::CallbacksHandler(const Lrc& parent) ...@@ -162,6 +162,12 @@ CallbacksHandler::CallbacksHandler(const Lrc& parent)
&CallbacksHandler::slotVoiceMailNotify, &CallbacksHandler::slotVoiceMailNotify,
Qt::QueuedConnection); Qt::QueuedConnection);
connect(&CallManager::instance(),
&CallManagerInterface::remoteRecordingChanged,
this,
&CallbacksHandler::slotRemoteRecordingChanged,
Qt::QueuedConnection);
connect(&ConfigurationManager::instance(), connect(&ConfigurationManager::instance(),
&ConfigurationManagerInterface::dataTransferEvent, &ConfigurationManagerInterface::dataTransferEvent,
this, this,
...@@ -563,4 +569,10 @@ CallbacksHandler::slotAudioMeterReceived(const QString& id, float level) ...@@ -563,4 +569,10 @@ CallbacksHandler::slotAudioMeterReceived(const QString& id, float level)
emit audioMeter(id, level); emit audioMeter(id, level);
} }
void
CallbacksHandler::slotRemoteRecordingChanged(const QString& callId, const QString& peerNumber, bool state)
{
emit remoteRecordingChanged(callId, peerNumber, state);
}
} // namespace lrc } // namespace lrc
...@@ -299,6 +299,15 @@ Q_SIGNALS: ...@@ -299,6 +299,15 @@ Q_SIGNALS:
*/ */
void voiceMailNotify(const QString& accountId, int newCount, int oldCount, int urgentCount); void voiceMailNotify(const QString& accountId, int newCount, int oldCount, int urgentCount);
/**
* Connect this signal to know when a call is updated
* @param callId the call id
* @param callId the contact id
* @param state the new state
* @param code
*/
void remoteRecordingChanged(const QString& callId, const QString& peerNumber, bool state);
private Q_SLOTS: private Q_SLOTS:
/** /**
* Emit newAccountMessage * Emit newAccountMessage
...@@ -551,6 +560,13 @@ private Q_SLOTS: ...@@ -551,6 +560,13 @@ private Q_SLOTS:
*/ */
void slotRecordPlaybackStopped(const QString& filePath); void slotRecordPlaybackStopped(const QString& filePath);
/**
* Call slotCallStateChanged
* @param callId of the conference
* @param state, new state
*/
void slotRemoteRecordingChanged(const QString& callId, const QString& contactId, bool state);
private: private:
const api::Lrc& parent; const api::Lrc& parent;
}; };
......
...@@ -197,6 +197,12 @@ public Q_SLOTS: ...@@ -197,6 +197,12 @@ public Q_SLOTS:
* @param infos * @param infos
*/ */
void slotOnConferenceInfosUpdated(const QString& confId, const VectorMapStringString& infos); void slotOnConferenceInfosUpdated(const QString& confId, const VectorMapStringString& infos);
/**
* Listen from CallbacksHandler when the peer start recording
* @param callId
* @param state the new state
*/
void remoteRecordingChanged(const QString& callId, const QString& peerNumber, bool state);
}; };
NewCallModel::NewCallModel(const account::Info& owner, const CallbacksHandler& callbacksHandler) NewCallModel::NewCallModel(const account::Info& owner, const CallbacksHandler& callbacksHandler)
...@@ -559,6 +565,10 @@ NewCallModelPimpl::NewCallModelPimpl(const NewCallModel& linked, ...@@ -559,6 +565,10 @@ NewCallModelPimpl::NewCallModelPimpl(const NewCallModel& linked,
&CallManagerInterface::onConferenceInfosUpdated, &CallManagerInterface::onConferenceInfosUpdated,
this, this,
&NewCallModelPimpl::slotOnConferenceInfosUpdated); &NewCallModelPimpl::slotOnConferenceInfosUpdated);
connect(&callbacksHandler,
&CallbacksHandler::remoteRecordingChanged,
this,
&NewCallModelPimpl::remoteRecordingChanged);
#ifndef ENABLE_LIBWRAP #ifndef ENABLE_LIBWRAP
// Only necessary with dbus since the daemon runs separately // Only necessary with dbus since the daemon runs separately
...@@ -1017,6 +1027,33 @@ NewCallModelPimpl::sendProfile(const QString& callId) ...@@ -1017,6 +1027,33 @@ NewCallModelPimpl::sendProfile(const QString& callId)
} }
} }
void
NewCallModelPimpl::remoteRecordingChanged(const QString& callId, const QString& peerNumber, bool state)
{
auto it = calls.find(callId);
if (it == calls.end() or not it->second)
return;
auto uri = peerNumber;
if (uri.contains("ring:"))
uri.remove("ring:");
if (uri.contains("jami:"))
uri.remove("jami:");
if (uri.contains("@ring.dht"))
uri.remove("@ring.dht");
// Add peer to peerRec set
if (state && not it->second->peerRec.contains(uri))
it->second->peerRec.insert(uri);
// remove peer from peerRec set
if (!state && it->second->peerRec.contains(uri))
it->second->peerRec.remove(uri);
emit linked.remoteRecordingChanged(callId, it->second->peerRec, state);
}
} // namespace lrc } // namespace lrc
#include "api/moc_newcallmodel.cpp" #include "api/moc_newcallmodel.cpp"
...@@ -170,6 +170,18 @@ public: ...@@ -170,6 +170,18 @@ public:
[this](const std::map<std::string, std::string>& info) { [this](const std::map<std::string, std::string>& info) {
LOG_DRING_SIGNAL("smartInfo", ""); LOG_DRING_SIGNAL("smartInfo", "");
Q_EMIT smartInfo(convertMap(info)); Q_EMIT smartInfo(convertMap(info));
}),
exportable_callback<CallSignal::RemoteRecordingChanged>(
[this](const std::string &callID,
const std::string &contactId,
bool state) {
LOG_DRING_SIGNAL3("remoteRecordingChanged",
QString(callID.c_str()),
QString(contactId.c_str()),
state);
Q_EMIT remoteRecordingChanged(QString(callID.c_str()),
QString(contactId.c_str()),
state);
})}; })};
} }
...@@ -394,6 +406,7 @@ Q_SIGNALS: // SIGNALS ...@@ -394,6 +406,7 @@ Q_SIGNALS: // SIGNALS
void videoMuted(const QString& callID, bool state); void videoMuted(const QString& callID, bool state);
void peerHold(const QString& callID, bool state); void peerHold(const QString& callID, bool state);
void smartInfo(const MapStringString& info); void smartInfo(const MapStringString& info);
void remoteRecordingChanged(const QString &callID, const QString &peerNumber, bool remoteRecordingState);
}; };
namespace org { namespace org {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment