Commit 53731a91 authored by Ronan Abhamon's avatar Ronan Abhamon

fix(CallModel): emit securtyChanged when call encryption changed in core listener

parent 986f5d99
...@@ -44,9 +44,11 @@ CallModel::CallModel (shared_ptr<linphone::Call> call) { ...@@ -44,9 +44,11 @@ CallModel::CallModel (shared_ptr<linphone::Call> call) {
updateIsInConference(); updateIsInConference();
CoreManager *coreManager = CoreManager::getInstance();
// Deal with auto-answer. // Deal with auto-answer.
if (!isOutgoing()) { if (!isOutgoing()) {
SettingsModel *settings = CoreManager::getInstance()->getSettingsModel(); SettingsModel *settings = coreManager->getSettingsModel();
if (settings->getAutoAnswerStatus()) { if (settings->getAutoAnswerStatus()) {
QTimer *timer = new QTimer(this); QTimer *timer = new QTimer(this);
...@@ -59,10 +61,15 @@ CallModel::CallModel (shared_ptr<linphone::Call> call) { ...@@ -59,10 +61,15 @@ CallModel::CallModel (shared_ptr<linphone::Call> call) {
} }
} }
CoreHandlers *coreHandlers = coreManager->getHandlers().get();
QObject::connect( QObject::connect(
CoreManager::getInstance()->getHandlers().get(), &CoreHandlers::callStateChanged, coreHandlers, &CoreHandlers::callStateChanged,
this, &CallModel::handleCallStateChanged this, &CallModel::handleCallStateChanged
); );
QObject::connect(
coreHandlers, &CoreHandlers::callEncryptionChanged,
this, &CallModel::handleCallEncryptionChanged
);
} }
CallModel::~CallModel () { CallModel::~CallModel () {
...@@ -244,6 +251,11 @@ void CallModel::stopRecording () { ...@@ -244,6 +251,11 @@ void CallModel::stopRecording () {
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
void CallModel::handleCallEncryptionChanged (const std::shared_ptr<linphone::Call> &call) {
if (call == mCall)
emit securityUpdated();
}
void CallModel::handleCallStateChanged (const shared_ptr<linphone::Call> &call, linphone::CallState state) { void CallModel::handleCallStateChanged (const shared_ptr<linphone::Call> &call, linphone::CallState state) {
if (call != mCall) if (call != mCall)
return; return;
...@@ -301,7 +313,6 @@ void CallModel::handleCallStateChanged (const shared_ptr<linphone::Call> &call, ...@@ -301,7 +313,6 @@ void CallModel::handleCallStateChanged (const shared_ptr<linphone::Call> &call,
break; break;
} }
emit securityUpdated();
emit statusChanged(getStatus()); emit statusChanged(getStatus());
} }
......
...@@ -139,6 +139,7 @@ signals: ...@@ -139,6 +139,7 @@ signals:
void cameraFirstFrameReceived (unsigned int width, unsigned int height); void cameraFirstFrameReceived (unsigned int width, unsigned int height);
private: private:
void handleCallEncryptionChanged (const std::shared_ptr<linphone::Call> &call);
void handleCallStateChanged (const std::shared_ptr<linphone::Call> &call, linphone::CallState state); void handleCallStateChanged (const std::shared_ptr<linphone::Call> &call, linphone::CallState state);
void stopAutoAnswerTimer () const; void stopAutoAnswerTimer () const;
...@@ -163,7 +164,7 @@ private: ...@@ -163,7 +164,7 @@ private:
bool getMicroMuted () const; bool getMicroMuted () const;
void setMicroMuted (bool status); void setMicroMuted (bool status);
bool getAudioMuted () const; bool getAudioMuted () const;
void setAudioMuted (bool status); void setAudioMuted (bool status);
......
...@@ -85,6 +85,15 @@ void CoreHandlers::onAuthenticationRequested ( ...@@ -85,6 +85,15 @@ void CoreHandlers::onAuthenticationRequested (
emit authenticationRequested(authInfo); emit authenticationRequested(authInfo);
} }
void CoreHandlers::onCallEncryptionChanged (
const shared_ptr<linphone::Core> &,
const shared_ptr<linphone::Call> &call,
bool,
const string &
) {
emit callEncryptionChanged(call);
}
void CoreHandlers::onCallStateChanged ( void CoreHandlers::onCallStateChanged (
const shared_ptr<linphone::Core> &, const shared_ptr<linphone::Core> &,
const shared_ptr<linphone::Call> &call, const shared_ptr<linphone::Call> &call,
......
...@@ -42,6 +42,7 @@ public: ...@@ -42,6 +42,7 @@ public:
signals: signals:
void authenticationRequested (const std::shared_ptr<linphone::AuthInfo> &authInfo); void authenticationRequested (const std::shared_ptr<linphone::AuthInfo> &authInfo);
void callEncryptionChanged (const std::shared_ptr<linphone::Call> &call);
void callStateChanged (const std::shared_ptr<linphone::Call> &call, linphone::CallState state); void callStateChanged (const std::shared_ptr<linphone::Call> &call, linphone::CallState state);
void callTransferFailed (const std::shared_ptr<linphone::Call> &call); void callTransferFailed (const std::shared_ptr<linphone::Call> &call);
void callTransferSucceeded (const std::shared_ptr<linphone::Call> &call); void callTransferSucceeded (const std::shared_ptr<linphone::Call> &call);
...@@ -66,6 +67,13 @@ private: ...@@ -66,6 +67,13 @@ private:
linphone::AuthMethod method linphone::AuthMethod method
) override; ) override;
void onCallEncryptionChanged (
const std::shared_ptr<linphone::Core> &core,
const std::shared_ptr<linphone::Call> &call,
bool on,
const std::string &authenticationToken
) override;
void onCallStateChanged ( void onCallStateChanged (
const std::shared_ptr<linphone::Core> &core, const std::shared_ptr<linphone::Core> &core,
const std::shared_ptr<linphone::Call> &call, const std::shared_ptr<linphone::Call> &call,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment