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) {
updateIsInConference();
CoreManager *coreManager = CoreManager::getInstance();
// Deal with auto-answer.
if (!isOutgoing()) {
SettingsModel *settings = CoreManager::getInstance()->getSettingsModel();
SettingsModel *settings = coreManager->getSettingsModel();
if (settings->getAutoAnswerStatus()) {
QTimer *timer = new QTimer(this);
......@@ -59,10 +61,15 @@ CallModel::CallModel (shared_ptr<linphone::Call> call) {
}
}
CoreHandlers *coreHandlers = coreManager->getHandlers().get();
QObject::connect(
CoreManager::getInstance()->getHandlers().get(), &CoreHandlers::callStateChanged,
coreHandlers, &CoreHandlers::callStateChanged,
this, &CallModel::handleCallStateChanged
);
QObject::connect(
coreHandlers, &CoreHandlers::callEncryptionChanged,
this, &CallModel::handleCallEncryptionChanged
);
}
CallModel::~CallModel () {
......@@ -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) {
if (call != mCall)
return;
......@@ -301,7 +313,6 @@ void CallModel::handleCallStateChanged (const shared_ptr<linphone::Call> &call,
break;
}
emit securityUpdated();
emit statusChanged(getStatus());
}
......
......@@ -139,6 +139,7 @@ signals:
void cameraFirstFrameReceived (unsigned int width, unsigned int height);
private:
void handleCallEncryptionChanged (const std::shared_ptr<linphone::Call> &call);
void handleCallStateChanged (const std::shared_ptr<linphone::Call> &call, linphone::CallState state);
void stopAutoAnswerTimer () const;
......@@ -163,7 +164,7 @@ private:
bool getMicroMuted () const;
void setMicroMuted (bool status);
bool getAudioMuted () const;
void setAudioMuted (bool status);
......
......@@ -85,6 +85,15 @@ void CoreHandlers::onAuthenticationRequested (
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 (
const shared_ptr<linphone::Core> &,
const shared_ptr<linphone::Call> &call,
......
......@@ -42,6 +42,7 @@ public:
signals:
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 callTransferFailed (const std::shared_ptr<linphone::Call> &call);
void callTransferSucceeded (const std::shared_ptr<linphone::Call> &call);
......@@ -66,6 +67,13 @@ private:
linphone::AuthMethod method
) 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 (
const std::shared_ptr<linphone::Core> &core,
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