Commit 61ce19b9 authored by François Grisez's avatar François Grisez

Adjusts Linphone Qt's code to fit the new API of Liblinphone

parent 762e3ab8
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
* Author: Ronan Abhamon * Author: Ronan Abhamon
*/ */
#include <bctoolbox/logging.h> #include <linphone++/linphone.hh>
#include <linphone/linphonecore.h> #include <linphone/linphonecore.h>
#include <QDateTime> #include <QDateTime>
#include <QThread> #include <QThread>
......
...@@ -48,15 +48,15 @@ private: ...@@ -48,15 +48,15 @@ private:
void onCreateAccount ( void onCreateAccount (
const shared_ptr<linphone::AccountCreator> &, const shared_ptr<linphone::AccountCreator> &,
linphone::AccountCreatorStatus status, linphone::AccountCreator::Status status,
const string & const string &
) override { ) override {
if (status == linphone::AccountCreatorStatusAccountCreated) if (status == linphone::AccountCreator::Status::AccountCreated)
emit mAssistant->createStatusChanged(QString("")); emit mAssistant->createStatusChanged(QString(""));
else { else {
if (status == linphone::AccountCreatorStatusRequestFailed) if (status == linphone::AccountCreator::Status::RequestFailed)
emit mAssistant->createStatusChanged(tr("requestFailed")); emit mAssistant->createStatusChanged(tr("requestFailed"));
else if (status == linphone::AccountCreatorStatusServerError) else if (status == linphone::AccountCreator::Status::ServerError)
emit mAssistant->createStatusChanged(tr("cannotSendSms")); emit mAssistant->createStatusChanged(tr("cannotSendSms"));
else else
emit mAssistant->createStatusChanged(tr("accountAlreadyExists")); emit mAssistant->createStatusChanged(tr("accountAlreadyExists"));
...@@ -65,14 +65,14 @@ private: ...@@ -65,14 +65,14 @@ private:
void onIsAccountExist ( void onIsAccountExist (
const shared_ptr<linphone::AccountCreator> &creator, const shared_ptr<linphone::AccountCreator> &creator,
linphone::AccountCreatorStatus status, linphone::AccountCreator::Status status,
const string & const string &
) override { ) override {
if (status == linphone::AccountCreatorStatusAccountExist || status == linphone::AccountCreatorStatusAccountExistWithAlias) { if (status == linphone::AccountCreator::Status::AccountExist || status == linphone::AccountCreator::Status::AccountExistWithAlias) {
createProxyConfig(creator); createProxyConfig(creator);
emit mAssistant->loginStatusChanged(QString("")); emit mAssistant->loginStatusChanged(QString(""));
} else { } else {
if (status == linphone::AccountCreatorStatusRequestFailed) if (status == linphone::AccountCreator::Status::RequestFailed)
emit mAssistant->loginStatusChanged(tr("requestFailed")); emit mAssistant->loginStatusChanged(tr("requestFailed"));
else else
emit mAssistant->loginStatusChanged(tr("loginWithUsernameFailed")); emit mAssistant->loginStatusChanged(tr("loginWithUsernameFailed"));
...@@ -81,19 +81,19 @@ private: ...@@ -81,19 +81,19 @@ private:
void onActivateAccount ( void onActivateAccount (
const shared_ptr<linphone::AccountCreator> &creator, const shared_ptr<linphone::AccountCreator> &creator,
linphone::AccountCreatorStatus status, linphone::AccountCreator::Status status,
const string & const string &
) override { ) override {
if ( if (
status == linphone::AccountCreatorStatusAccountActivated || status == linphone::AccountCreator::Status::AccountActivated ||
status == linphone::AccountCreatorStatusAccountAlreadyActivated status == linphone::AccountCreator::Status::AccountAlreadyActivated
) { ) {
if (creator->getEmail().empty()) if (creator->getEmail().empty())
createProxyConfig(creator); createProxyConfig(creator);
emit mAssistant->activateStatusChanged(QString("")); emit mAssistant->activateStatusChanged(QString(""));
} else { } else {
if (status == linphone::AccountCreatorStatusRequestFailed) if (status == linphone::AccountCreator::Status::RequestFailed)
emit mAssistant->activateStatusChanged(tr("requestFailed")); emit mAssistant->activateStatusChanged(tr("requestFailed"));
else else
emit mAssistant->activateStatusChanged(tr("smsActivationFailed")); emit mAssistant->activateStatusChanged(tr("smsActivationFailed"));
...@@ -102,14 +102,14 @@ private: ...@@ -102,14 +102,14 @@ private:
void onIsAccountActivated ( void onIsAccountActivated (
const shared_ptr<linphone::AccountCreator> &creator, const shared_ptr<linphone::AccountCreator> &creator,
linphone::AccountCreatorStatus status, linphone::AccountCreator::Status status,
const string & const string &
) override { ) override {
if (status == linphone::AccountCreatorStatusAccountActivated) { if (status == linphone::AccountCreator::Status::AccountActivated) {
createProxyConfig(creator); createProxyConfig(creator);
emit mAssistant->activateStatusChanged(QString("")); emit mAssistant->activateStatusChanged(QString(""));
} else { } else {
if (status == linphone::AccountCreatorStatusRequestFailed) if (status == linphone::AccountCreator::Status::RequestFailed)
emit mAssistant->activateStatusChanged(tr("requestFailed")); emit mAssistant->activateStatusChanged(tr("requestFailed"));
else else
emit mAssistant->activateStatusChanged(tr("emailActivationFailed")); emit mAssistant->activateStatusChanged(tr("emailActivationFailed"));
...@@ -118,15 +118,15 @@ private: ...@@ -118,15 +118,15 @@ private:
void onRecoverAccount ( void onRecoverAccount (
const shared_ptr<linphone::AccountCreator> &, const shared_ptr<linphone::AccountCreator> &,
linphone::AccountCreatorStatus status, linphone::AccountCreator::Status status,
const string & const string &
) override { ) override {
if (status == linphone::AccountCreatorStatusRequestOk) { if (status == linphone::AccountCreator::Status::RequestOk) {
emit mAssistant->recoverStatusChanged(QString("")); emit mAssistant->recoverStatusChanged(QString(""));
} else { } else {
if (status == linphone::AccountCreatorStatusRequestFailed) if (status == linphone::AccountCreator::Status::RequestFailed)
emit mAssistant->recoverStatusChanged(tr("requestFailed")); emit mAssistant->recoverStatusChanged(tr("requestFailed"));
else if (status == linphone::AccountCreatorStatusServerError) else if (status == linphone::AccountCreator::Status::ServerError)
emit mAssistant->recoverStatusChanged(tr("cannotSendSms")); emit mAssistant->recoverStatusChanged(tr("cannotSendSms"));
else else
emit mAssistant->recoverStatusChanged(tr("loginWithPhoneNumberFailed")); emit mAssistant->recoverStatusChanged(tr("loginWithPhoneNumberFailed"));
...@@ -243,12 +243,12 @@ void AssistantModel::setEmail (const QString &email) { ...@@ -243,12 +243,12 @@ void AssistantModel::setEmail (const QString &email) {
QString error; QString error;
switch (mAccountCreator->setEmail(::Utils::appStringToCoreString(email))) { switch (mAccountCreator->setEmail(::Utils::appStringToCoreString(email))) {
case linphone::AccountCreatorEmailStatusOk: case linphone::AccountCreator::EmailStatus::Ok:
break; break;
case linphone::AccountCreatorEmailStatusMalformed: case linphone::AccountCreator::EmailStatus::Malformed:
error = tr("emailStatusMalformed"); error = tr("emailStatusMalformed");
break; break;
case linphone::AccountCreatorEmailStatusInvalidCharacters: case linphone::AccountCreator::EmailStatus::InvalidCharacters:
error = tr("emailStatusMalformedInvalidCharacters"); error = tr("emailStatusMalformedInvalidCharacters");
break; break;
} }
...@@ -267,19 +267,19 @@ void AssistantModel::setPassword (const QString &password) { ...@@ -267,19 +267,19 @@ void AssistantModel::setPassword (const QString &password) {
QString error; QString error;
switch (mAccountCreator->setPassword(::Utils::appStringToCoreString(password))) { switch (mAccountCreator->setPassword(::Utils::appStringToCoreString(password))) {
case linphone::AccountCreatorPasswordStatusOk: case linphone::AccountCreator::PasswordStatus::Ok:
break; break;
case linphone::AccountCreatorPasswordStatusTooShort: case linphone::AccountCreator::PasswordStatus::TooShort:
error = tr("passwordStatusTooShort").arg(config->getInt("assistant", "password_min_length", 1)); error = tr("passwordStatusTooShort").arg(config->getInt("assistant", "password_min_length", 1));
break; break;
case linphone::AccountCreatorPasswordStatusTooLong: case linphone::AccountCreator::PasswordStatus::TooLong:
error = tr("passwordStatusTooLong").arg(config->getInt("assistant", "password_max_length", -1)); error = tr("passwordStatusTooLong").arg(config->getInt("assistant", "password_max_length", -1));
break; break;
case linphone::AccountCreatorPasswordStatusInvalidCharacters: case linphone::AccountCreator::PasswordStatus::InvalidCharacters:
error = tr("passwordStatusInvalidCharacters") error = tr("passwordStatusInvalidCharacters")
.arg(::Utils::coreStringToAppString(config->getString("assistant", "password_regex", ""))); .arg(::Utils::coreStringToAppString(config->getString("assistant", "password_regex", "")));
break; break;
case linphone::AccountCreatorPasswordStatusMissingCharacters: case linphone::AccountCreator::PasswordStatus::MissingCharacters:
error = tr("passwordStatusMissingCharacters") error = tr("passwordStatusMissingCharacters")
.arg(::Utils::coreStringToAppString(config->getString("assistant", "missing_characters", ""))); .arg(::Utils::coreStringToAppString(config->getString("assistant", "missing_characters", "")));
break; break;
...@@ -310,18 +310,18 @@ void AssistantModel::setPhoneNumber (const QString &phoneNumber) { ...@@ -310,18 +310,18 @@ void AssistantModel::setPhoneNumber (const QString &phoneNumber) {
QString error; QString error;
switch (mAccountCreator->setPhoneNumber(::Utils::appStringToCoreString(phoneNumber), ::Utils::appStringToCoreString(mCountryCode))) { switch (mAccountCreator->setPhoneNumber(::Utils::appStringToCoreString(phoneNumber), ::Utils::appStringToCoreString(mCountryCode))) {
case linphone::AccountCreatorPhoneNumberStatusOk: case int(linphone::AccountCreator::PhoneNumberStatus::Ok):
break; break;
case linphone::AccountCreatorPhoneNumberStatusInvalid: case int(linphone::AccountCreator::PhoneNumberStatus::Invalid):
error = tr("phoneNumberStatusInvalid"); error = tr("phoneNumberStatusInvalid");
break; break;
case linphone::AccountCreatorPhoneNumberStatusTooShort: case int(linphone::AccountCreator::PhoneNumberStatus::TooShort):
error = tr("phoneNumberStatusTooShort"); error = tr("phoneNumberStatusTooShort");
break; break;
case linphone::AccountCreatorPhoneNumberStatusTooLong: case int(linphone::AccountCreator::PhoneNumberStatus::TooLong):
error = tr("phoneNumberStatusTooLong"); error = tr("phoneNumberStatusTooLong");
break; break;
case linphone::AccountCreatorPhoneNumberStatusInvalidCountryCode: case int(linphone::AccountCreator::PhoneNumberStatus::InvalidCountryCode):
error = tr("phoneNumberStatusInvalidCountryCode"); error = tr("phoneNumberStatusInvalidCountryCode");
break; break;
default: default:
...@@ -393,24 +393,24 @@ void AssistantModel::setConfigFilename (const QString &configFilename) { ...@@ -393,24 +393,24 @@ void AssistantModel::setConfigFilename (const QString &configFilename) {
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
QString AssistantModel::mapAccountCreatorUsernameStatusToString (linphone::AccountCreatorUsernameStatus status) const { QString AssistantModel::mapAccountCreatorUsernameStatusToString (linphone::AccountCreator::UsernameStatus status) const {
shared_ptr<linphone::Config> config = CoreManager::getInstance()->getCore()->getConfig(); shared_ptr<linphone::Config> config = CoreManager::getInstance()->getCore()->getConfig();
QString error; QString error;
switch (status) { switch (status) {
case linphone::AccountCreatorUsernameStatusOk: case linphone::AccountCreator::UsernameStatus::Ok:
break; break;
case linphone::AccountCreatorUsernameStatusTooShort: case linphone::AccountCreator::UsernameStatus::TooShort:
error = tr("usernameStatusTooShort").arg(config->getInt("assistant", "username_min_length", 1)); error = tr("usernameStatusTooShort").arg(config->getInt("assistant", "username_min_length", 1));
break; break;
case linphone::AccountCreatorUsernameStatusTooLong: case linphone::AccountCreator::UsernameStatus::TooLong:
error = tr("usernameStatusTooLong").arg(config->getInt("assistant", "username_max_length", -1)); error = tr("usernameStatusTooLong").arg(config->getInt("assistant", "username_max_length", -1));
break; break;
case linphone::AccountCreatorUsernameStatusInvalidCharacters: case linphone::AccountCreator::UsernameStatus::InvalidCharacters:
error = tr("usernameStatusInvalidCharacters") error = tr("usernameStatusInvalidCharacters")
.arg(::Utils::coreStringToAppString(config->getString("assistant", "username_regex", ""))); .arg(::Utils::coreStringToAppString(config->getString("assistant", "username_regex", "")));
break; break;
case linphone::AccountCreatorUsernameStatusInvalid: case linphone::AccountCreator::UsernameStatus::Invalid:
error = tr("usernameStatusInvalid"); error = tr("usernameStatusInvalid");
break; break;
} }
......
...@@ -94,7 +94,7 @@ private: ...@@ -94,7 +94,7 @@ private:
QString getConfigFilename () const; QString getConfigFilename () const;
void setConfigFilename (const QString &configFilename); void setConfigFilename (const QString &configFilename);
QString mapAccountCreatorUsernameStatusToString (linphone::AccountCreatorUsernameStatus status) const; QString mapAccountCreatorUsernameStatusToString (linphone::AccountCreator::UsernameStatus status) const;
QString mCountryCode; QString mCountryCode;
QString mConfigFilename; QString mConfigFilename;
......
...@@ -88,14 +88,14 @@ void CallModel::setRecordFile (shared_ptr<linphone::CallParams> &callParams) { ...@@ -88,14 +88,14 @@ void CallModel::setRecordFile (shared_ptr<linphone::CallParams> &callParams) {
void CallModel::updateStats (const shared_ptr<const linphone::CallStats> &callStats) { void CallModel::updateStats (const shared_ptr<const linphone::CallStats> &callStats) {
switch (callStats->getType()) { switch (callStats->getType()) {
case linphone::StreamTypeText: case linphone::StreamType::Text:
case linphone::StreamTypeUnknown: case linphone::StreamType::Unknown:
break; break;
case linphone::StreamTypeAudio: case linphone::StreamType::Audio:
updateStats(callStats, mAudioStats); updateStats(callStats, mAudioStats);
break; break;
case linphone::StreamTypeVideo: case linphone::StreamType::Video:
updateStats(callStats, mVideoStats); updateStats(callStats, mVideoStats);
break; break;
} }
...@@ -243,42 +243,42 @@ void CallModel::stopRecording () { ...@@ -243,42 +243,42 @@ void CallModel::stopRecording () {
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
void CallModel::handleCallStateChanged (const shared_ptr<linphone::Call> &call, linphone::CallState state) { void CallModel::handleCallStateChanged (const shared_ptr<linphone::Call> &call, linphone::Call::State state) {
if (call != mCall) if (call != mCall)
return; return;
updateIsInConference(); updateIsInConference();
switch (state) { switch (state) {
case linphone::CallStateError: case linphone::Call::State::Error:
case linphone::CallStateEnd: case linphone::Call::State::End:
setCallErrorFromReason(call->getReason()); setCallErrorFromReason(call->getReason());
stopAutoAnswerTimer(); stopAutoAnswerTimer();
mPausedByRemote = false; mPausedByRemote = false;
break; break;
case linphone::CallStateConnected: case linphone::Call::State::Connected:
case linphone::CallStateReferred: case linphone::Call::State::Referred:
case linphone::CallStateReleased: case linphone::Call::State::Released:
case linphone::CallStateStreamsRunning: case linphone::Call::State::StreamsRunning:
mPausedByRemote = false; mPausedByRemote = false;
break; break;
case linphone::CallStatePausedByRemote: case linphone::Call::State::PausedByRemote:
mNotifyCameraFirstFrameReceived = true; mNotifyCameraFirstFrameReceived = true;
mPausedByRemote = true; mPausedByRemote = true;
break; break;
case linphone::CallStatePausing: case linphone::Call::State::Pausing:
mNotifyCameraFirstFrameReceived = true; mNotifyCameraFirstFrameReceived = true;
mPausedByUser = true; mPausedByUser = true;
break; break;
case linphone::CallStateResuming: case linphone::Call::State::Resuming:
mPausedByUser = false; mPausedByUser = false;
break; break;
case linphone::CallStateUpdatedByRemote: case linphone::Call::State::UpdatedByRemote:
if (!mCall->getCurrentParams()->videoEnabled() && mCall->getRemoteParams()->videoEnabled()) { if (!mCall->getCurrentParams()->videoEnabled() && mCall->getRemoteParams()->videoEnabled()) {
mCall->deferUpdate(); mCall->deferUpdate();
emit videoRequested(); emit videoRequested();
...@@ -286,17 +286,17 @@ void CallModel::handleCallStateChanged (const shared_ptr<linphone::Call> &call, ...@@ -286,17 +286,17 @@ void CallModel::handleCallStateChanged (const shared_ptr<linphone::Call> &call,
break; break;
case linphone::CallStateIdle: case linphone::Call::State::Idle:
case linphone::CallStateIncomingReceived: case linphone::Call::State::IncomingReceived:
case linphone::CallStateOutgoingInit: case linphone::Call::State::OutgoingInit:
case linphone::CallStateOutgoingProgress: case linphone::Call::State::OutgoingProgress:
case linphone::CallStateOutgoingRinging: case linphone::Call::State::OutgoingRinging:
case linphone::CallStateOutgoingEarlyMedia: case linphone::Call::State::OutgoingEarlyMedia:
case linphone::CallStatePaused: case linphone::Call::State::Paused:
case linphone::CallStateIncomingEarlyMedia: case linphone::Call::State::IncomingEarlyMedia:
case linphone::CallStateUpdating: case linphone::Call::State::Updating:
case linphone::CallStateEarlyUpdatedByRemote: case linphone::Call::State::EarlyUpdatedByRemote:
case linphone::CallStateEarlyUpdating: case linphone::Call::State::EarlyUpdating:
break; break;
} }
...@@ -327,39 +327,39 @@ void CallModel::stopAutoAnswerTimer () const { ...@@ -327,39 +327,39 @@ void CallModel::stopAutoAnswerTimer () const {
CallModel::CallStatus CallModel::getStatus () const { CallModel::CallStatus CallModel::getStatus () const {
switch (mCall->getState()) { switch (mCall->getState()) {
case linphone::CallStateConnected: case linphone::Call::State::Connected:
case linphone::CallStateStreamsRunning: case linphone::Call::State::StreamsRunning:
return CallStatusConnected; return CallStatusConnected;
case linphone::CallStateEnd: case linphone::Call::State::End:
case linphone::CallStateError: case linphone::Call::State::Error:
case linphone::CallStateReferred: case linphone::Call::State::Referred:
case linphone::CallStateReleased: case linphone::Call::State::Released:
return CallStatusEnded; return CallStatusEnded;
case linphone::CallStatePaused: case linphone::Call::State::Paused:
case linphone::CallStatePausedByRemote: case linphone::Call::State::PausedByRemote:
case linphone::CallStatePausing: case linphone::Call::State::Pausing:
case linphone::CallStateResuming: case linphone::Call::State::Resuming:
return CallStatusPaused; return CallStatusPaused;
case linphone::CallStateUpdating: case linphone::Call::State::Updating:
case linphone::CallStateUpdatedByRemote: case linphone::Call::State::UpdatedByRemote:
return mPausedByRemote ? CallStatusPaused : CallStatusConnected; return mPausedByRemote ? CallStatusPaused : CallStatusConnected;
case linphone::CallStateEarlyUpdatedByRemote: case linphone::Call::State::EarlyUpdatedByRemote:
case linphone::CallStateEarlyUpdating: case linphone::Call::State::EarlyUpdating:
case linphone::CallStateIdle: case linphone::Call::State::Idle:
case linphone::CallStateIncomingEarlyMedia: case linphone::Call::State::IncomingEarlyMedia:
case linphone::CallStateIncomingReceived: case linphone::Call::State::IncomingReceived:
case linphone::CallStateOutgoingEarlyMedia: case linphone::Call::State::OutgoingEarlyMedia:
case linphone::CallStateOutgoingInit: case linphone::Call::State::OutgoingInit:
case linphone::CallStateOutgoingProgress: case linphone::Call::State::OutgoingProgress:
case linphone::CallStateOutgoingRinging: case linphone::Call::State::OutgoingRinging:
break; break;
} }
return mCall->getDir() == linphone::CallDirIncoming ? CallStatusIncoming : CallStatusOutgoing; return mCall->getDir() == linphone::Call::Dir::Incoming ? CallStatusIncoming : CallStatusOutgoing;
} }
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
...@@ -385,16 +385,16 @@ QString CallModel::getCallError () const { ...@@ -385,16 +385,16 @@ QString CallModel::getCallError () const {
void CallModel::setCallErrorFromReason (linphone::Reason reason) { void CallModel::setCallErrorFromReason (linphone::Reason reason) {
switch (reason) { switch (reason) {
case linphone::ReasonDeclined: case linphone::Reason::Declined:
mCallError = tr("callErrorDeclined"); mCallError = tr("callErrorDeclined");
break; break;
case linphone::ReasonNotFound: case linphone::Reason::NotFound:
mCallError = tr("callErrorNotFound"); mCallError = tr("callErrorNotFound");
break; break;
case linphone::ReasonBusy: case linphone::Reason::Busy:
mCallError = tr("callErrorBusy"); mCallError = tr("callErrorBusy");
break; break;
case linphone::ReasonNotAcceptable: case linphone::Reason::NotAcceptable:
mCallError = tr("callErrorNotAcceptable"); mCallError = tr("callErrorNotAcceptable");
break; break;
default: default:
...@@ -462,10 +462,10 @@ bool CallModel::getPausedByUser () const { ...@@ -462,10 +462,10 @@ bool CallModel::getPausedByUser () const {
void CallModel::setPausedByUser (bool status) { void CallModel::setPausedByUser (bool status) {
switch (mCall->getState()) { switch (mCall->getState()) {
case linphone::CallStateConnected: case linphone::Call::State::Connected:
case linphone::CallStateStreamsRunning: case linphone::Call::State::StreamsRunning:
case linphone::CallStatePaused: case linphone::Call::State::Paused:
case linphone::CallStatePausedByRemote: case linphone::Call::State::PausedByRemote:
break; break;
default: return; default: return;
} }
...@@ -496,8 +496,8 @@ void CallModel::setVideoEnabled (bool status) { ...@@ -496,8 +496,8 @@ void CallModel::setVideoEnabled (bool status) {
} }
switch (mCall->getState()) { switch (mCall->getState()) {
case linphone::CallStateConnected: case linphone::Call::State::Connected:
case linphone::CallStateStreamsRunning: case linphone::Call::State::StreamsRunning:
break; break;
default: return; default: return;
} }
...@@ -515,10 +515,10 @@ void CallModel::setVideoEnabled (bool status) { ...@@ -515,10 +515,10 @@ void CallModel::setVideoEnabled (bool status) {
bool CallModel::getUpdating () const { bool CallModel::getUpdating () const {
switch (mCall->getState()) { switch (mCall->getState()) {
case linphone::CallStateConnected: case linphone::Call::State::Connected:
case linphone::CallStateStreamsRunning: case linphone::Call::State::StreamsRunning:
case linphone::CallStatePaused: case linphone::Call::State::Paused:
case linphone::CallStatePausedByRemote: case linphone::Call::State::PausedByRemote:
return false; return false;
default: default:
...@@ -556,33 +556,33 @@ bool CallModel::isSecured () const { ...@@ -556,33 +556,33 @@ bool CallModel::isSecured () const {
shared_ptr<const linphone::CallParams> params = mCall->getCurrentParams(); shared_ptr<const linphone::CallParams> params = mCall->getCurrentParams();
linphone::MediaEncryption encryption = params->getMediaEncryption(); linphone::MediaEncryption encryption = params->getMediaEncryption();
return ( return (
encryption == linphone::MediaEncryptionZRTP && mCall->getAuthenticationTokenVerified() encryption == linphone::MediaEncryption::ZRTP && mCall->getAuthenticationTokenVerified()
) || encryption == linphone::MediaEncryptionSRTP || encryption == linphone::MediaEncryptionDTLS; ) || encryption == linphone::MediaEncryption::SRTP || encryption == linphone::MediaEncryption::DTLS;
} }
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
QString CallModel::getLocalSas () const { QString CallModel::getLocalSas () const {
QString token = ::Utils::coreStringToAppString(mCall->getAuthenticationToken()); QString token = ::Utils::coreStringToAppString(mCall->getAuthenticationToken());
return mCall->getDir() == linphone::CallDirIncoming ? token.left(2).toUpper() : token.right(2).toUpper(); return mCall->getDir() == linphone::Call::Dir::Incoming ? token.left(2).toUpper() : token.right(2).toUpper();
} }
QString CallModel::getRemoteSas () const { QString CallModel::getRemoteSas () const {
QString token = ::Utils::coreStringToAppString(mCall->getAuthenticationToken()); QString token = ::Utils::coreStringToAppString(mCall->getAuthenticationToken());
return mCall->getDir() != linphone::CallDirIncoming ? token.left(2).toUpper() : token.right(2).toUpper(); return mCall->getDir() != linphone::Call::Dir::Incoming ? token.left(2).toUpper() : token.right(2).toUpper();
} }
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
QString CallModel::getSecuredString () const { QString CallModel::getSecuredString () const {
switch (mCall->getCurrentParams()->getMediaEncryption()) { switch (mCall->getCurrentParams()->getMediaEncryption()) {
case linphone::MediaEncryptionSRTP: case linphone::MediaEncryption::SRTP:
return QStringLiteral("SRTP"); return QStringLiteral("SRTP");
case linphone::MediaEncryptionZRTP: case linphone::MediaEncryption::ZRTP:
return QStringLiteral("ZRTP"); return QStringLiteral("ZRTP");
case linphone::MediaEncryptionDTLS: case linphone::MediaEncryption::DTLS:
return QStringLiteral("DTLS"); return QStringLiteral("DTLS");
case linphone::MediaEncryptionNone: case linphone::MediaEncryption::None:
break; break;
} }
...@@ -613,10 +613,10 @@ void CallModel::updateStats (const shared_ptr<const linphone::CallStats> &callSt ...@@ -613,10 +613,10 @@ void CallModel::updateStats (const shared_ptr<const linphone::CallStats> &callSt
shared_ptr<const linphone::PayloadType> payloadType; shared_ptr<const linphone::PayloadType> payloadType;
switch (callStats->getType()) { switch (callStats->getType()) {
case linphone::StreamTypeAudio: case linphone::StreamType::Audio:
payloadType = params->getUsedAudioPayloadType(); payloadType = params->getUsedAudioPayloadType();
break; break;
case linphone::StreamTypeVideo: case linphone::StreamType::Video:
payloadType = params->getUsedVideoPayloadType(); payloadType = params->getUsedVideoPayloadType();
break; break;
default: default:
...@@ -625,10 +625,10 @@ void CallModel::updateStats (const shared_ptr<const linphone::CallStats> &callSt ...@@ -625,10 +625,10 @@ void CallModel::updateStats (const shared_ptr<const linphone::CallStats> &callSt
QString family; QString family;
switch (callStats->getIpFamilyOfRemote()) { switch (callStats->getIpFamilyOfRemote()) {
case linphone::AddressFamilyInet: case linphone::AddressFamily::Inet:
family = QStringLiteral("IPv4"); family = QStringLiteral("IPv4");
break; break;
case linphone::AddressFamilyInet6: case linphone::AddressFamily::Inet6:
family = QStringLiteral("IPv6"); family = QStringLiteral("IPv6");
break; break;
default: default:
...@@ -649,10 +649,10 @@ void CallModel::updateStats (const shared_ptr<const linphone::CallStats> &callSt ...@@ -649,10 +649,10 @@ void CallModel::updateStats (const shared_ptr<const linphone::CallStats> &callSt
statsList << ::createStat(tr("callStatsReceiverLossRate"), QStringLiteral("%1 %").arg(callStats->getReceiverLossRate())); statsList << ::createStat(tr("callStatsReceiverLossRate"), QStringLiteral("%1 %").arg(callStats->getReceiverLossRate()));
switch (callStats->getType()) { switch (callStats->getType()) {
case linphone::StreamTypeAudio: case linphone::StreamType::Audio:
statsList << ::createStat(tr("callStatsJitterBuffer"), QStringLiteral("%1 ms").arg(callStats->getJitterBufferSizeMs())); statsList << ::createStat(tr("callStatsJitterBuffer"), QStringLiteral("%1 ms").arg(callStats->getJitterBufferSizeMs()));
break; break;
case linphone::StreamTypeVideo: { case linphone::StreamType::Video: {
const QString sentVideoDefinitionName = ::Utils::coreStringToAppString(params->getSentVideoDefinition()->getName()); const QString sentVideoDefinitionName = ::Utils::coreStringToAppString(params->getSentVideoDefinition()->getName());
const QString sentVideoDefinition = QStringLiteral("%1x%2") const QString sentVideoDefinition = QStringLiteral("%1x%2")
.arg(params->getSentVideoDefinition()->getWidth()) .arg(params->getSentVideoDefinition()->getWidth())
...@@ -684,17 +684,17 @@ void CallModel::updateStats (const shared_ptr<const linphone::CallStats> &callSt ...@@ -684,17 +684,17 @@ void CallModel::updateStats (const shared_ptr<const linphone::CallStats> &callSt
QString CallModel::iceStateToString (linphone::IceState state) const { QString CallModel::iceStateToString (linphone::IceState state) const {
switch (state) { switch (state) {
case linphone::IceStateNotActivated: case linphone::IceState::NotActivated:
return tr("iceStateNotActivated"); return tr("iceStateNotActivated");
case linphone::IceStateFailed: case linphone::IceState::Failed:
return tr("iceStateFailed"); return tr("iceStateFailed");
case linphone::IceStateInProgress: case linphone::IceState::InProgress:
return tr("iceStateInProgress"); return tr("iceStateInProgress");
case linphone::IceStateReflexiveConnection: case linphone::IceState::ReflexiveConnection:
return tr("iceStateReflexiveConnection"); return tr("iceStateReflexiveConnection");
case linphone::IceStateHostConnection: case linphone::IceState::HostConnection:
return tr("iceStateHostConnection"); return tr("iceStateHostConnection");
case linphone::IceStateRelayConnection: case linphone::IceState::RelayConnection:
return tr("iceStateRelayConnection"); return tr("iceStateRelayConnection");
} }
......
...@@ -78,10 +78,10 @@ public: ...@@ -78,10 +78,10 @@ public:
Q_ENUM(CallStatus); Q_ENUM(CallStatus);
enum CallEncryption { enum CallEncryption {
CallEncryptionNone = linphone::MediaEncryptionNone, CallEncryptionNone = int(linphone::MediaEncryption::None),
CallEncryptionDtls = linphone::MediaEncryptionDTLS, CallEncryptionDtls = int(linphone::MediaEncryption::DTLS),
CallEncryptionSrtp = linphone::MediaEncryptionSRTP, CallEncryptionSrtp = int(linphone::MediaEncryption::SRTP),
CallEncryptionZrtp = linphone::MediaEncryptionZRTP CallEncryptionZrtp = int(linphone::MediaEncryption::ZRTP)
}; };
Q_ENUM(CallEncryption); Q_ENUM(CallEncryption);
...@@ -139,14 +139,14 @@ signals: ...@@ -139,14 +139,14 @@ signals:
void cameraFirstFrameReceived (unsigned int width, unsigned int height); void cameraFirstFrameReceived (unsigned int width, unsigned int height);
private: private:
void handleCallStateChanged (const std::shared_ptr<linphone::Call> &call, linphone::CallState state); void handleCallStateChanged (const std::shared_ptr<linphone::Call> &call, linphone::Call::State state);
void stopAutoAnswerTimer () const; void stopAutoAnswerTimer () const;
CallStatus getStatus () const; CallStatus getStatus () const;
bool isOutgoing () const { bool isOutgoing () const {
return mCall->getDir() == linphone::CallDirOutgoing; return mCall->getDir() == linphone::Call::Dir::Outgoing;
} }
void updateIsInConference (); void updateIsInConference ();
......
...@@ -172,23 +172,23 @@ static void joinConference (const shared_ptr<linphone::Call> &call) { ...@@ -172,23 +172,23 @@ static void joinConference (const shared_ptr<linphone::Call> &call) {
addModel->update(); addModel->update();
} }
void CallsListModel::handleCallStateChanged (const shared_ptr<linphone::Call> &call, linphone::CallState state) { void CallsListModel::handleCallStateChanged (const shared_ptr<linphone::Call> &call, linphone::Call::State state) {
switch (state) { switch (state) {
case linphone::CallStateIncomingReceived: case linphone::Call::State::IncomingReceived:
addCall(call); addCall(call);
::joinConference(call); ::joinConference(call);
break; break;
case linphone::CallStateOutgoingInit: case linphone::Call::State::OutgoingInit:
addCall(call); addCall(call);
break; break;
case linphone::CallStateEnd: case linphone::Call::State::End:
case linphone::CallStateError: case linphone::Call::State::Error:
removeCall(call); removeCall(call);
break; break;
case linphone::CallStateStreamsRunning: { case linphone::Call::State::StreamsRunning: {
int index = ::findCallIndex(mList, call); int index = ::findCallIndex(mList, call);
emit callRunning(index, &call->getData<CallModel>("call-model")); emit callRunning(index, &call->getData<CallModel>("call-model"));
} break; } break;
...@@ -221,7 +221,7 @@ bool CallsListModel::removeRows (int row, int count, const QModelIndex &parent) ...@@ -221,7 +221,7 @@ bool CallsListModel::removeRows (int row, int count, const QModelIndex &parent)
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
void CallsListModel::addCall (const shared_ptr<linphone::Call> &call) { void CallsListModel::addCall (const shared_ptr<linphone::Call> &call) {
if (call->getDir() == linphone::CallDirOutgoing) if (call->getDir() == linphone::Call::Dir::Outgoing)
App::smartShowWindow(App::getInstance()->getCallsWindow()); App::smartShowWindow(App::getInstance()->getCallsWindow());
CallModel *callModel = new CallModel(call); CallModel *callModel = new CallModel(call);
......
...@@ -60,7 +60,7 @@ private: ...@@ -60,7 +60,7 @@ private:
bool removeRow (int row, const QModelIndex &parent = QModelIndex()); bool removeRow (int row, const QModelIndex &parent = QModelIndex());
bool removeRows (int row, int count, const QModelIndex &parent = QModelIndex()) override; bool removeRows (int row, int count, const QModelIndex &parent = QModelIndex()) override;
void handleCallStateChanged (const std::shared_ptr<linphone::Call> &call, linphone::CallState state); void handleCallStateChanged (const std::shared_ptr<linphone::Call> &call, linphone::Call::State state);
void addCall (const std::shared_ptr<linphone::Call> &call); void addCall (const std::shared_ptr<linphone::Call> &call);
void removeCall (const std::shared_ptr<linphone::Call> &call); void removeCall (const std::shared_ptr<linphone::Call> &call);
......
...@@ -180,7 +180,7 @@ private: ...@@ -180,7 +180,7 @@ private:
signalDataChanged(it); signalDataChanged(it);
} }
void onMsgStateChanged (const shared_ptr<linphone::ChatMessage> &message, linphone::ChatMessageState state) override { void onMsgStateChanged (const shared_ptr<linphone::ChatMessage> &message, linphone::ChatMessage::State state) override {
if (!mChatModel) if (!mChatModel)
return; return;
...@@ -189,7 +189,7 @@ private: ...@@ -189,7 +189,7 @@ private:
return; return;
// File message downloaded. // File message downloaded.
if (state == linphone::ChatMessageStateFileTransferDone && !message->isOutgoing()) { if (state == linphone::ChatMessage::State::FileTransferDone && !message->isOutgoing()) {
::createThumbnail(message); ::createThumbnail(message);
::fillThumbnailProperty((*it).first, message); ::fillThumbnailProperty((*it).first, message);
...@@ -201,7 +201,7 @@ private: ...@@ -201,7 +201,7 @@ private:
App::getInstance()->getNotifier()->notifyReceivedFileMessage(message); App::getInstance()->getNotifier()->notifyReceivedFileMessage(message);
} }
(*it).first["status"] = state; (*it).first["status"] = int(state);
signalDataChanged(it); signalDataChanged(it);
} }
...@@ -305,8 +305,8 @@ void ChatModel::setSipAddress (const QString &sipAddress) { ...@@ -305,8 +305,8 @@ void ChatModel::setSipAddress (const QString &sipAddress) {
// Old workaround. // Old workaround.
// It can exist messages with a not delivered status. It's a linphone core bug. // It can exist messages with a not delivered status. It's a linphone core bug.
if (message->getState() == linphone::ChatMessageStateInProgress) if (message->getState() == linphone::ChatMessage::State::InProgress)
map["status"] = linphone::ChatMessageStateNotDelivered; map["status"] = int(linphone::ChatMessage::State::NotDelivered);
mEntries << qMakePair(map, static_pointer_cast<void>(message)); mEntries << qMakePair(map, static_pointer_cast<void>(message));
} }
...@@ -435,7 +435,7 @@ void ChatModel::downloadFile (int id) { ...@@ -435,7 +435,7 @@ void ChatModel::downloadFile (int id) {
shared_ptr<linphone::ChatMessage> message = static_pointer_cast<linphone::ChatMessage>(entry.second); shared_ptr<linphone::ChatMessage> message = static_pointer_cast<linphone::ChatMessage>(entry.second);
switch (message->getState()) { switch (int(message->getState())) {
case MessageStatusDelivered: case MessageStatusDelivered:
case MessageStatusDeliveredToUser: case MessageStatusDeliveredToUser:
case MessageStatusDisplayed: case MessageStatusDisplayed:
...@@ -529,8 +529,8 @@ void ChatModel::fillMessageEntry (QVariantMap &dest, const shared_ptr<linphone:: ...@@ -529,8 +529,8 @@ void ChatModel::fillMessageEntry (QVariantMap &dest, const shared_ptr<linphone::
dest["type"] = EntryType::MessageEntry; dest["type"] = EntryType::MessageEntry;
dest["timestamp"] = QDateTime::fromMSecsSinceEpoch(message->getTime() * 1000); dest["timestamp"] = QDateTime::fromMSecsSinceEpoch(message->getTime() * 1000);
dest["content"] = ::Utils::coreStringToAppString(message->getText()); dest["content"] = ::Utils::coreStringToAppString(message->getText());
dest["isOutgoing"] = message->isOutgoing() || message->getState() == linphone::ChatMessageStateIdle; dest["isOutgoing"] = message->isOutgoing() || message->getState() == linphone::ChatMessage::State::Idle;
dest["status"] = message->getState(); dest["status"] = int(message->getState());
shared_ptr<const linphone::Content> content = message->getFileTransferInformation(); shared_ptr<const linphone::Content> content = message->getFileTransferInformation();
if (content) { if (content) {
...@@ -547,8 +547,8 @@ void ChatModel::fillCallStartEntry (QVariantMap &dest, const shared_ptr<linphone ...@@ -547,8 +547,8 @@ void ChatModel::fillCallStartEntry (QVariantMap &dest, const shared_ptr<linphone
dest["type"] = EntryType::CallEntry; dest["type"] = EntryType::CallEntry;
dest["timestamp"] = timestamp; dest["timestamp"] = timestamp;
dest["isOutgoing"] = callLog->getDir() == linphone::CallDirOutgoing; dest["isOutgoing"] = callLog->getDir() == linphone::Call::Dir::Outgoing;
dest["status"] = callLog->getStatus(); dest["status"] = int(callLog->getStatus());
dest["isStart"] = true; dest["isStart"] = true;
} }
...@@ -557,8 +557,8 @@ void ChatModel::fillCallEndEntry (QVariantMap &dest, const shared_ptr<linphone:: ...@@ -557,8 +557,8 @@ void ChatModel::fillCallEndEntry (QVariantMap &dest, const shared_ptr<linphone::
dest["type"] = EntryType::CallEntry; dest["type"] = EntryType::CallEntry;
dest["timestamp"] = timestamp; dest["timestamp"] = timestamp;
dest["isOutgoing"] = callLog->getDir() == linphone::CallDirOutgoing; dest["isOutgoing"] = callLog->getDir() == linphone::Call::Dir::Outgoing;
dest["status"] = callLog->getStatus(); dest["status"] = int(callLog->getStatus());
dest["isStart"] = false; dest["isStart"] = false;
} }
...@@ -576,7 +576,7 @@ void ChatModel::removeEntry (ChatEntryData &pair) { ...@@ -576,7 +576,7 @@ void ChatModel::removeEntry (ChatEntryData &pair) {
} }
case ChatModel::CallEntry: { case ChatModel::CallEntry: {
if (pair.first["status"].toInt() == linphone::CallStatusSuccess) { if (pair.first["status"].toInt() == int(linphone::Call::Status::Success)) {
// WARNING: Unable to remove symmetric call here. (start/end) // WARNING: Unable to remove symmetric call here. (start/end)
// We are between `beginRemoveRows` and `endRemoveRows`. // We are between `beginRemoveRows` and `endRemoveRows`.
// A solution is to schedule a `removeEntry` call in the Qt main loop. // A solution is to schedule a `removeEntry` call in the Qt main loop.
...@@ -601,16 +601,16 @@ void ChatModel::removeEntry (ChatEntryData &pair) { ...@@ -601,16 +601,16 @@ void ChatModel::removeEntry (ChatEntryData &pair) {
} }
void ChatModel::insertCall (const shared_ptr<linphone::CallLog> &callLog) { void ChatModel::insertCall (const shared_ptr<linphone::CallLog> &callLog) {
linphone::CallStatus status = callLog->getStatus(); linphone::Call::Status status = callLog->getStatus();
switch (status) { switch (status) {
case linphone::CallStatusAborted: case linphone::Call::Status::Aborted:
case linphone::CallStatusEarlyAborted: case linphone::Call::Status::EarlyAborted:
return; // Ignore aborted calls. return; // Ignore aborted calls.
case linphone::CallStatusSuccess: case linphone::Call::Status::Success:
case linphone::CallStatusMissed: case linphone::Call::Status::Missed:
case linphone::CallStatusDeclined: case linphone::Call::Status::Declined:
break; break;
} }
...@@ -637,7 +637,7 @@ void ChatModel::insertCall (const shared_ptr<linphone::CallLog> &callLog) { ...@@ -637,7 +637,7 @@ void ChatModel::insertCall (const shared_ptr<linphone::CallLog> &callLog) {
auto it = insertEntry(qMakePair(start, static_pointer_cast<void>(callLog))); auto it = insertEntry(qMakePair(start, static_pointer_cast<void>(callLog)));
// Add end call. (if necessary) // Add end call. (if necessary)
if (status == linphone::CallStatusSuccess) { if (status == linphone::Call::Status::Success) {
QVariantMap end; QVariantMap end;
fillCallEndEntry(end, callLog); fillCallEndEntry(end, callLog);
insertEntry(qMakePair(end, static_pointer_cast<void>(callLog)), &it); insertEntry(qMakePair(end, static_pointer_cast<void>(callLog)), &it);
...@@ -658,9 +658,9 @@ void ChatModel::insertMessageAtEnd (const shared_ptr<linphone::ChatMessage> &mes ...@@ -658,9 +658,9 @@ void ChatModel::insertMessageAtEnd (const shared_ptr<linphone::ChatMessage> &mes
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
void ChatModel::handleCallStateChanged (const shared_ptr<linphone::Call> &call, linphone::CallState state) { void ChatModel::handleCallStateChanged (const shared_ptr<linphone::Call> &call, linphone::Call::State state) {
if ( if (
(state == linphone::CallStateEnd || state == linphone::CallStateError) && (state == linphone::Call::State::End || state == linphone::Call::State::Error) &&
mChatRoom == CoreManager::getInstance()->getCore()->getChatRoom(call->getRemoteAddress()) mChatRoom == CoreManager::getInstance()->getCore()->getChatRoom(call->getRemoteAddress())
) )
insertCall(call->getCallLog()); insertCall(call->getCallLog());
......
...@@ -52,22 +52,22 @@ public: ...@@ -52,22 +52,22 @@ public:
Q_ENUM(EntryType); Q_ENUM(EntryType);
enum CallStatus { enum CallStatus {
CallStatusDeclined = linphone::CallStatusDeclined, CallStatusDeclined = int(linphone::Call::Status::Declined),
CallStatusMissed = linphone::CallStatusMissed, CallStatusMissed = int(linphone::Call::Status::Missed),
CallStatusSuccess = linphone::CallStatusSuccess CallStatusSuccess = int(linphone::Call::Status::Success)
}; };
Q_ENUM(CallStatus); Q_ENUM(CallStatus);
enum MessageStatus { enum MessageStatus {
MessageStatusDelivered = linphone::ChatMessageStateDelivered, MessageStatusDelivered = int(linphone::ChatMessage::State::Delivered),
MessageStatusDeliveredToUser = linphone::ChatMessageStateDeliveredToUser, MessageStatusDeliveredToUser = int(linphone::ChatMessage::State::DeliveredToUser),
MessageStatusDisplayed = linphone::ChatMessageStateDisplayed, MessageStatusDisplayed = int(linphone::ChatMessage::State::Displayed),
MessageStatusFileTransferDone = linphone::ChatMessageStateFileTransferDone, MessageStatusFileTransferDone = int(linphone::ChatMessage::State::FileTransferDone),
MessageStatusFileTransferError = linphone::ChatMessageStateFileTransferError, MessageStatusFileTransferError = int(linphone::ChatMessage::State::FileTransferError),
MessageStatusIdle = linphone::ChatMessageStateIdle, MessageStatusIdle = int(linphone::ChatMessage::State::Idle),
MessageStatusInProgress = linphone::ChatMessageStateInProgress, MessageStatusInProgress = int(linphone::ChatMessage::State::InProgress),
MessageStatusNotDelivered = linphone::ChatMessageStateNotDelivered MessageStatusNotDelivered = int(linphone::ChatMessage::State::NotDelivered)
}; };
Q_ENUM(MessageStatus); Q_ENUM(MessageStatus);
...@@ -134,7 +134,7 @@ private: ...@@ -134,7 +134,7 @@ private:
void insertCall (const std::shared_ptr<linphone::CallLog> &callLog); void insertCall (const std::shared_ptr<linphone::CallLog> &callLog);
void insertMessageAtEnd (const std::shared_ptr<linphone::ChatMessage> &message); void insertMessageAtEnd (const std::shared_ptr<linphone::ChatMessage> &message);
void handleCallStateChanged (const std::shared_ptr<linphone::Call> &call, linphone::CallState state); void handleCallStateChanged (const std::shared_ptr<linphone::Call> &call, linphone::Call::State state);
void handleIsComposingChanged (const std::shared_ptr<linphone::ChatRoom> &chatRoom); void handleIsComposingChanged (const std::shared_ptr<linphone::ChatRoom> &chatRoom);
void handleMessageReceived (const std::shared_ptr<linphone::ChatMessage> &message); void handleMessageReceived (const std::shared_ptr<linphone::ChatMessage> &message);
......
...@@ -140,7 +140,7 @@ ContactModel *ContactsListModel::addContact (VcardModel *vcardModel) { ...@@ -140,7 +140,7 @@ ContactModel *ContactsListModel::addContact (VcardModel *vcardModel) {
if ( if (
mLinphoneFriends->addFriend(contact->mLinphoneFriend) != mLinphoneFriends->addFriend(contact->mLinphoneFriend) !=
linphone::FriendListStatus::FriendListStatusOK linphone::FriendList::Status::OK
) { ) {
qWarning() << QStringLiteral("Unable to add contact from vcard:") << vcardModel; qWarning() << QStringLiteral("Unable to add contact from vcard:") << vcardModel;
delete contact; delete contact;
......
...@@ -88,12 +88,12 @@ void CoreHandlers::onAuthenticationRequested ( ...@@ -88,12 +88,12 @@ void CoreHandlers::onAuthenticationRequested (
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,
linphone::CallState state, linphone::Call::State state,
const string & const string &
) { ) {
emit callStateChanged(call, state); emit callStateChanged(call, state);
if (call->getState() == linphone::CallStateIncomingReceived) if (call->getState() == linphone::Call::State::IncomingReceived)
App::getInstance()->getNotifier()->notifyReceivedCall(call); App::getInstance()->getNotifier()->notifyReceivedCall(call);
} }
...@@ -110,7 +110,7 @@ void CoreHandlers::onGlobalStateChanged ( ...@@ -110,7 +110,7 @@ void CoreHandlers::onGlobalStateChanged (
linphone::GlobalState gstate, linphone::GlobalState gstate,
const string & const string &
) { ) {
if (gstate == linphone::GlobalStateOn) { if (gstate == linphone::GlobalState::On) {
mCoreStartedLock->lock(); mCoreStartedLock->lock();
Q_ASSERT(mCoreStarted == false); Q_ASSERT(mCoreStarted == false);
...@@ -130,7 +130,7 @@ void CoreHandlers::onIsComposingReceived ( ...@@ -130,7 +130,7 @@ void CoreHandlers::onIsComposingReceived (
void CoreHandlers::onLogCollectionUploadStateChanged ( void CoreHandlers::onLogCollectionUploadStateChanged (
const shared_ptr<linphone::Core> &, const shared_ptr<linphone::Core> &,
linphone::CoreLogCollectionUploadState state, linphone::Core::LogCollectionUploadState state,
const string &info const string &info
) { ) {
emit logsUploadStateChanged(state, info); emit logsUploadStateChanged(state, info);
...@@ -190,46 +190,46 @@ void CoreHandlers::onRegistrationStateChanged ( ...@@ -190,46 +190,46 @@ void CoreHandlers::onRegistrationStateChanged (
void CoreHandlers::onTransferStateChanged ( void CoreHandlers::onTransferStateChanged (
const shared_ptr<linphone::Core> &, const shared_ptr<linphone::Core> &,
const shared_ptr<linphone::Call> &call, const shared_ptr<linphone::Call> &call,
linphone::CallState state linphone::Call::State state
) { ) {
switch (state) { switch (state) {
case linphone::CallStateEarlyUpdatedByRemote: case linphone::Call::State::EarlyUpdatedByRemote:
case linphone::CallStateEarlyUpdating: case linphone::Call::State::EarlyUpdating:
case linphone::CallStateIdle: case linphone::Call::State::Idle:
case linphone::CallStateIncomingEarlyMedia: case linphone::Call::State::IncomingEarlyMedia:
case linphone::CallStateIncomingReceived: case linphone::Call::State::IncomingReceived:
case linphone::CallStateOutgoingEarlyMedia: case linphone::Call::State::OutgoingEarlyMedia:
case linphone::CallStateOutgoingRinging: case linphone::Call::State::OutgoingRinging:
case linphone::CallStatePaused: case linphone::Call::State::Paused:
case linphone::CallStatePausedByRemote: case linphone::Call::State::PausedByRemote:
case linphone::CallStatePausing: case linphone::Call::State::Pausing:
case linphone::CallStateReferred: case linphone::Call::State::Referred:
case linphone::CallStateReleased: case linphone::Call::State::Released:
case linphone::CallStateResuming: case linphone::Call::State::Resuming:
case linphone::CallStateStreamsRunning: case linphone::Call::State::StreamsRunning:
case linphone::CallStateUpdatedByRemote: case linphone::Call::State::UpdatedByRemote:
case linphone::CallStateUpdating: case linphone::Call::State::Updating:
break; // Nothing. break; // Nothing.
// 1. Init. // 1. Init.
case linphone::CallStateOutgoingInit: case linphone::Call::State::OutgoingInit:
qInfo() << QStringLiteral("Call transfer init."); qInfo() << QStringLiteral("Call transfer init.");
break; break;
// 2. In progress. // 2. In progress.
case linphone::CallStateOutgoingProgress: case linphone::Call::State::OutgoingProgress:
qInfo() << QStringLiteral("Call transfer in progress."); qInfo() << QStringLiteral("Call transfer in progress.");
break; break;
// 3. Done. // 3. Done.
case linphone::CallStateConnected: case linphone::Call::State::Connected:
qInfo() << QStringLiteral("Call transfer succeeded."); qInfo() << QStringLiteral("Call transfer succeeded.");
emit callTransferSucceeded(call); emit callTransferSucceeded(call);
break; break;
// 4. Error. // 4. Error.
case linphone::CallStateEnd: case linphone::Call::State::End:
case linphone::CallStateError: case linphone::Call::State::Error:
qWarning() << QStringLiteral("Call transfer failed."); qWarning() << QStringLiteral("Call transfer failed.");
emit callTransferFailed(call); emit callTransferFailed(call);
break; break;
...@@ -242,7 +242,7 @@ void CoreHandlers::onVersionUpdateCheckResultReceived ( ...@@ -242,7 +242,7 @@ void CoreHandlers::onVersionUpdateCheckResultReceived (
const string &version, const string &version,
const string &url const string &url
) { ) {
if (result == linphone::VersionUpdateCheckResultNewVersionAvailable) if (result == linphone::VersionUpdateCheckResult::NewVersionAvailable)
App::getInstance()->getNotifier()->notifyNewVersionAvailable( App::getInstance()->getNotifier()->notifyNewVersionAvailable(
::Utils::coreStringToAppString(version), ::Utils::coreStringToAppString(version),
::Utils::coreStringToAppString(url) ::Utils::coreStringToAppString(url)
......
...@@ -42,12 +42,12 @@ public: ...@@ -42,12 +42,12 @@ public:
signals: signals:
void authenticationRequested (const std::shared_ptr<linphone::AuthInfo> &authInfo); void authenticationRequested (const std::shared_ptr<linphone::AuthInfo> &authInfo);
void callStateChanged (const std::shared_ptr<linphone::Call> &call, linphone::CallState state); void callStateChanged (const std::shared_ptr<linphone::Call> &call, linphone::Call::State 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);
void coreStarted (); void coreStarted ();
void isComposingChanged (const std::shared_ptr<linphone::ChatRoom> &chatRoom); void isComposingChanged (const std::shared_ptr<linphone::ChatRoom> &chatRoom);
void logsUploadStateChanged (linphone::CoreLogCollectionUploadState state, const std::string &info); void logsUploadStateChanged (linphone::Core::LogCollectionUploadState state, const std::string &info);
void messageReceived (const std::shared_ptr<linphone::ChatMessage> &message); void messageReceived (const std::shared_ptr<linphone::ChatMessage> &message);
void presenceReceived (const QString &sipAddress, const std::shared_ptr<const linphone::PresenceModel> &presenceModel); void presenceReceived (const QString &sipAddress, const std::shared_ptr<const linphone::PresenceModel> &presenceModel);
void registrationStateChanged (const std::shared_ptr<linphone::ProxyConfig> &proxyConfig, linphone::RegistrationState state); void registrationStateChanged (const std::shared_ptr<linphone::ProxyConfig> &proxyConfig, linphone::RegistrationState state);
...@@ -69,7 +69,7 @@ private: ...@@ -69,7 +69,7 @@ private:
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,
linphone::CallState state, linphone::Call::State state,
const std::string &message const std::string &message
) override; ) override;
...@@ -92,7 +92,7 @@ private: ...@@ -92,7 +92,7 @@ private:
void onLogCollectionUploadStateChanged ( void onLogCollectionUploadStateChanged (
const std::shared_ptr<linphone::Core> &core, const std::shared_ptr<linphone::Core> &core,
linphone::CoreLogCollectionUploadState state, linphone::Core::LogCollectionUploadState state,
const std::string &info const std::string &info
) override; ) override;
...@@ -130,7 +130,7 @@ private: ...@@ -130,7 +130,7 @@ private:
void onTransferStateChanged ( void onTransferStateChanged (
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,
linphone::CallState state linphone::Call::State state
) override; ) override;
void onVersionUpdateCheckResultReceived ( void onVersionUpdateCheckResultReceived (
......
...@@ -253,13 +253,13 @@ void CoreManager::iterate () { ...@@ -253,13 +253,13 @@ void CoreManager::iterate () {
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
void CoreManager::handleLogsUploadStateChanged (linphone::CoreLogCollectionUploadState state, const string &info) { void CoreManager::handleLogsUploadStateChanged (linphone::Core::LogCollectionUploadState state, const string &info) {
switch (state) { switch (state) {
case linphone::CoreLogCollectionUploadStateInProgress: case linphone::Core::LogCollectionUploadState::InProgress:
break; break;
case linphone::CoreLogCollectionUploadStateDelivered: case linphone::Core::LogCollectionUploadState::Delivered:
case linphone::CoreLogCollectionUploadStateNotDelivered: case linphone::Core::LogCollectionUploadState::NotDelivered:
emit logsUploaded(::Utils::coreStringToAppString(info)); emit logsUploaded(::Utils::coreStringToAppString(info));
break; break;
} }
......
...@@ -148,7 +148,7 @@ private: ...@@ -148,7 +148,7 @@ private:
void iterate (); void iterate ();
void handleLogsUploadStateChanged (linphone::CoreLogCollectionUploadState state, const std::string &info); void handleLogsUploadStateChanged (linphone::Core::LogCollectionUploadState state, const std::string &info);
static QString getDownloadUrl (); static QString getDownloadUrl ();
......
...@@ -36,10 +36,10 @@ class Presence : public QObject { ...@@ -36,10 +36,10 @@ class Presence : public QObject {
public: public:
enum PresenceStatus { enum PresenceStatus {
Online = linphone::ConsolidatedPresenceOnline, Online = int(linphone::ConsolidatedPresence::Online),
Busy = linphone::ConsolidatedPresenceBusy, Busy = int(linphone::ConsolidatedPresence::Busy),
DoNotDisturb = linphone::ConsolidatedPresenceDoNotDisturb, DoNotDisturb = int(linphone::ConsolidatedPresence::DoNotDisturb),
Offline = linphone::ConsolidatedPresenceOffline Offline = int(linphone::ConsolidatedPresence::Offline)
}; };
Q_ENUM(PresenceStatus); Q_ENUM(PresenceStatus);
......
...@@ -32,15 +32,15 @@ using namespace std; ...@@ -32,15 +32,15 @@ using namespace std;
static inline AccountSettingsModel::RegistrationState mapLinphoneRegistrationStateToUi (linphone::RegistrationState state) { static inline AccountSettingsModel::RegistrationState mapLinphoneRegistrationStateToUi (linphone::RegistrationState state) {
switch (state) { switch (state) {
case linphone::RegistrationStateNone: case linphone::RegistrationState::None:
case linphone::RegistrationStateCleared: case linphone::RegistrationState::Cleared:
case linphone::RegistrationStateFailed: case linphone::RegistrationState::Failed:
return AccountSettingsModel::RegistrationStateNotRegistered; return AccountSettingsModel::RegistrationStateNotRegistered;
case linphone::RegistrationStateProgress: case linphone::RegistrationState::Progress:
return AccountSettingsModel::RegistrationStateInProgress; return AccountSettingsModel::RegistrationStateInProgress;
case linphone::RegistrationStateOk: case linphone::RegistrationState::Ok:
break; break;
} }
...@@ -105,7 +105,7 @@ QVariantMap AccountSettingsModel::getProxyConfigDescription (const shared_ptr<li ...@@ -105,7 +105,7 @@ QVariantMap AccountSettingsModel::getProxyConfigDescription (const shared_ptr<li
map["avpfInterval"] = proxyConfig->getAvpfRrInterval(); map["avpfInterval"] = proxyConfig->getAvpfRrInterval();
map["registerEnabled"] = proxyConfig->registerEnabled(); map["registerEnabled"] = proxyConfig->registerEnabled();
map["publishPresence"] = proxyConfig->publishEnabled(); map["publishPresence"] = proxyConfig->publishEnabled();
map["avpfEnabled"] = proxyConfig->getAvpfMode() == linphone::AVPFMode::AVPFModeEnabled; map["avpfEnabled"] = proxyConfig->getAvpfMode() == linphone::AVPFMode::Enabled;
map["registrationState"] = ::mapLinphoneRegistrationStateToUi(proxyConfig->getState()); map["registrationState"] = ::mapLinphoneRegistrationStateToUi(proxyConfig->getState());
return map; return map;
...@@ -168,8 +168,8 @@ bool AccountSettingsModel::addOrUpdateProxyConfig ( ...@@ -168,8 +168,8 @@ bool AccountSettingsModel::addOrUpdateProxyConfig (
proxyConfig->enableRegister(data["registerEnabled"].toBool()); proxyConfig->enableRegister(data["registerEnabled"].toBool());
proxyConfig->enablePublish(data["publishPresence"].toBool()); proxyConfig->enablePublish(data["publishPresence"].toBool());
proxyConfig->setAvpfMode(data["avpfEnabled"].toBool() proxyConfig->setAvpfMode(data["avpfEnabled"].toBool()
? linphone::AVPFMode::AVPFModeEnabled ? linphone::AVPFMode::Enabled
: linphone::AVPFMode::AVPFModeDefault : linphone::AVPFMode::Default
); );
return addOrUpdateProxyConfig(proxyConfig); return addOrUpdateProxyConfig(proxyConfig);
......
...@@ -306,13 +306,13 @@ QVariantList SettingsModel::getSupportedMediaEncryptions () const { ...@@ -306,13 +306,13 @@ QVariantList SettingsModel::getSupportedMediaEncryptions () const {
shared_ptr<linphone::Core> core = CoreManager::getInstance()->getCore(); shared_ptr<linphone::Core> core = CoreManager::getInstance()->getCore();
QVariantList list; QVariantList list;
if (core->mediaEncryptionSupported(linphone::MediaEncryptionDTLS)) if (core->mediaEncryptionSupported(linphone::MediaEncryption::DTLS))
list << ::buildEncryptionDescription(MediaEncryptionDtls, "DTLS"); list << ::buildEncryptionDescription(MediaEncryptionDtls, "DTLS");
if (core->mediaEncryptionSupported(linphone::MediaEncryptionSRTP)) if (core->mediaEncryptionSupported(linphone::MediaEncryption::SRTP))
list << ::buildEncryptionDescription(MediaEncryptionSrtp, "SRTP"); list << ::buildEncryptionDescription(MediaEncryptionSrtp, "SRTP");
if (core->mediaEncryptionSupported(linphone::MediaEncryptionZRTP)) if (core->mediaEncryptionSupported(linphone::MediaEncryption::ZRTP))
list << ::buildEncryptionDescription(MediaEncryptionZrtp, "ZRTP"); list << ::buildEncryptionDescription(MediaEncryptionZrtp, "ZRTP");
return list; return list;
......
...@@ -132,18 +132,18 @@ class SettingsModel : public QObject { ...@@ -132,18 +132,18 @@ class SettingsModel : public QObject {
public: public:
enum MediaEncryption { enum MediaEncryption {
MediaEncryptionNone = linphone::MediaEncryptionNone, MediaEncryptionNone = int(linphone::MediaEncryption::None),
MediaEncryptionDtls = linphone::MediaEncryptionDTLS, MediaEncryptionDtls = int(linphone::MediaEncryption::DTLS),
MediaEncryptionSrtp = linphone::MediaEncryptionSRTP, MediaEncryptionSrtp = int(linphone::MediaEncryption::SRTP),
MediaEncryptionZrtp = linphone::MediaEncryptionZRTP MediaEncryptionZrtp = int(linphone::MediaEncryption::ZRTP)
}; };
Q_ENUM(MediaEncryption); Q_ENUM(MediaEncryption);
enum LimeState { enum LimeState {
LimeStateDisabled = linphone::LimeStateDisabled, LimeStateDisabled = int(linphone::LimeState::Disabled),
LimeStateMandatory = linphone::LimeStateMandatory, LimeStateMandatory = int(linphone::LimeState::Mandatory),
LimeStatePreferred = linphone::LimeStatePreferred LimeStatePreferred = int(linphone::LimeState::Preferred)
}; };
Q_ENUM(LimeState); Q_ENUM(LimeState);
......
...@@ -136,13 +136,13 @@ QString SipAddressesModel::getTransportFromSipAddress (const QString &sipAddress ...@@ -136,13 +136,13 @@ QString SipAddressesModel::getTransportFromSipAddress (const QString &sipAddress
return QString(""); return QString("");
switch (address->getTransport()) { switch (address->getTransport()) {
case linphone::TransportTypeUdp: case linphone::TransportType::Udp:
return QStringLiteral("UDP"); return QStringLiteral("UDP");
case linphone::TransportTypeTcp: case linphone::TransportType::Tcp:
return QStringLiteral("TCP"); return QStringLiteral("TCP");
case linphone::TransportTypeTls: case linphone::TransportType::Tls:
return QStringLiteral("TLS"); return QStringLiteral("TLS");
case linphone::TransportTypeDtls: case linphone::TransportType::Dtls:
return QStringLiteral("DTLS"); return QStringLiteral("DTLS");
} }
...@@ -278,13 +278,13 @@ void SipAddressesModel::handleMessageReceived (const shared_ptr<linphone::ChatMe ...@@ -278,13 +278,13 @@ void SipAddressesModel::handleMessageReceived (const shared_ptr<linphone::ChatMe
void SipAddressesModel::handleCallStateChanged ( void SipAddressesModel::handleCallStateChanged (
const shared_ptr<linphone::Call> &call, const shared_ptr<linphone::Call> &call,
linphone::CallState state linphone::Call::State state
) { ) {
// Ignore aborted calls. // Ignore aborted calls.
if (call->getCallLog()->getStatus() == linphone::CallStatus::CallStatusAborted) if (call->getCallLog()->getStatus() == linphone::Call::Status::Aborted)
return; return;
if (state == linphone::CallStateEnd || state == linphone::CallStateError) if (state == linphone::Call::State::End || state == linphone::Call::State::Error)
addOrUpdateSipAddress( addOrUpdateSipAddress(
::Utils::coreStringToAppString(call->getRemoteAddress()->asStringUriOnly()), call ::Utils::coreStringToAppString(call->getRemoteAddress()->asStringUriOnly()), call
); );
...@@ -297,16 +297,16 @@ void SipAddressesModel::handlePresenceReceived ( ...@@ -297,16 +297,16 @@ void SipAddressesModel::handlePresenceReceived (
Presence::PresenceStatus status; Presence::PresenceStatus status;
switch (presenceModel->getConsolidatedPresence()) { switch (presenceModel->getConsolidatedPresence()) {
case linphone::ConsolidatedPresenceOnline: case linphone::ConsolidatedPresence::Online:
status = Presence::PresenceStatus::Online; status = Presence::PresenceStatus::Online;
break; break;
case linphone::ConsolidatedPresenceBusy: case linphone::ConsolidatedPresence::Busy:
status = Presence::PresenceStatus::Busy; status = Presence::PresenceStatus::Busy;
break; break;
case linphone::ConsolidatedPresenceDoNotDisturb: case linphone::ConsolidatedPresence::DoNotDisturb:
status = Presence::PresenceStatus::DoNotDisturb; status = Presence::PresenceStatus::DoNotDisturb;
break; break;
case linphone::ConsolidatedPresenceOffline: case linphone::ConsolidatedPresence::Offline:
status = Presence::PresenceStatus::Offline; status = Presence::PresenceStatus::Offline;
break; break;
} }
...@@ -392,7 +392,7 @@ void SipAddressesModel::addOrUpdateSipAddress (QVariantMap &map, ContactModel *c ...@@ -392,7 +392,7 @@ void SipAddressesModel::addOrUpdateSipAddress (QVariantMap &map, ContactModel *c
void SipAddressesModel::addOrUpdateSipAddress (QVariantMap &map, const shared_ptr<linphone::Call> &call) { void SipAddressesModel::addOrUpdateSipAddress (QVariantMap &map, const shared_ptr<linphone::Call> &call) {
const shared_ptr<linphone::CallLog> callLog = call->getCallLog(); const shared_ptr<linphone::CallLog> callLog = call->getCallLog();
map["timestamp"] = callLog->getStatus() == linphone::CallStatus::CallStatusSuccess map["timestamp"] = callLog->getStatus() == linphone::Call::Status::Success
? QDateTime::fromMSecsSinceEpoch((callLog->getStartDate() + callLog->getDuration()) * 1000) ? QDateTime::fromMSecsSinceEpoch((callLog->getStartDate() + callLog->getDuration()) * 1000)
: QDateTime::fromMSecsSinceEpoch(callLog->getStartDate() * 1000); : QDateTime::fromMSecsSinceEpoch(callLog->getStartDate() * 1000);
} }
...@@ -492,7 +492,7 @@ void SipAddressesModel::initSipAddresses () { ...@@ -492,7 +492,7 @@ void SipAddressesModel::initSipAddresses () {
if (addressDone.contains(sipAddress)) if (addressDone.contains(sipAddress))
continue; // Already used. continue; // Already used.
if (callLog->getStatus() == linphone::CallStatusAborted) if (callLog->getStatus() == linphone::Call::Status::Aborted)
continue; // Ignore aborted calls. continue; // Ignore aborted calls.
addressDone << sipAddress; addressDone << sipAddress;
...@@ -501,7 +501,7 @@ void SipAddressesModel::initSipAddresses () { ...@@ -501,7 +501,7 @@ void SipAddressesModel::initSipAddresses () {
map["sipAddress"] = sipAddress; map["sipAddress"] = sipAddress;
// The duration can be wrong if status is not success. // The duration can be wrong if status is not success.
map["timestamp"] = callLog->getStatus() == linphone::CallStatus::CallStatusSuccess map["timestamp"] = callLog->getStatus() == linphone::Call::Status::Success
? QDateTime::fromMSecsSinceEpoch((callLog->getStartDate() + callLog->getDuration()) * 1000) ? QDateTime::fromMSecsSinceEpoch((callLog->getStartDate() + callLog->getDuration()) * 1000)
: QDateTime::fromMSecsSinceEpoch(callLog->getStartDate() * 1000); : QDateTime::fromMSecsSinceEpoch(callLog->getStartDate() * 1000);
......
...@@ -81,7 +81,7 @@ private: ...@@ -81,7 +81,7 @@ private:
void handleSipAddressRemoved (ContactModel *contact, const QString &sipAddress); void handleSipAddressRemoved (ContactModel *contact, const QString &sipAddress);
void handleMessageReceived (const std::shared_ptr<linphone::ChatMessage> &message); void handleMessageReceived (const std::shared_ptr<linphone::ChatMessage> &message);
void handleCallStateChanged (const std::shared_ptr<linphone::Call> &call, linphone::CallState state); void handleCallStateChanged (const std::shared_ptr<linphone::Call> &call, linphone::Call::State state);
void handlePresenceReceived (const QString &sipAddress, const std::shared_ptr<const linphone::PresenceModel> &presenceModel); void handlePresenceReceived (const QString &sipAddress, const std::shared_ptr<const linphone::PresenceModel> &presenceModel);
void handleAllEntriesRemoved (const QString &sipAddress); void handleAllEntriesRemoved (const QString &sipAddress);
......
...@@ -26,11 +26,11 @@ ...@@ -26,11 +26,11 @@
linphone::TransportType LinphoneUtils::stringToTransportType (const QString &transport) { linphone::TransportType LinphoneUtils::stringToTransportType (const QString &transport) {
if (transport == "TCP") if (transport == "TCP")
return linphone::TransportType::TransportTypeTcp; return linphone::TransportType::Tcp;
if (transport == "UDP") if (transport == "UDP")
return linphone::TransportType::TransportTypeUdp; return linphone::TransportType::Udp;
if (transport == "TLS") if (transport == "TLS")
return linphone::TransportType::TransportTypeTls; return linphone::TransportType::Tls;
return linphone::TransportType::TransportTypeDtls; return linphone::TransportType::Dtls;
} }
linphone @ bff2f9a2
Subproject commit 1ca73da1cf180f39204df9179d44e5a0baf620ec Subproject commit bff2f9a26f46607d7c24128ff045817ec1ce3a29
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