From c1108740d69be59b48eb798ccb5f7937f1e0fa2d Mon Sep 17 00:00:00 2001 From: Julien Wadel Date: Tue, 29 Apr 2025 15:35:26 +0200 Subject: [PATCH] - Crash on Windows when using non-UTF8 characters in system username. - Case sensitive issue with sip attributes on LDAP search. - Update SDK to 5.3.66 --- CHANGELOG.md | 4 +- .../chat-events/ChatMessageModel.cpp | 256 +++++++++--------- linphone-app/src/utils/Constants.hpp | 112 ++++---- 3 files changed, 197 insertions(+), 175 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fd88f7f06..3233ebad4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added - Screen Sharing + ## 5.2.6 - 2024-07-22 ### Fixed @@ -22,8 +23,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## 5.2.5 - 2024-07-10 ### Fixed +- Crash on Windows when using non-UTF8 characters in system username. - Case sensitive issue with sip attributes on LDAP search. -- Update SDK to 5.3.68 +- Update SDK to 5.3.66 ## 5.2.4 - 2024-04-11 diff --git a/linphone-app/src/components/chat-events/ChatMessageModel.cpp b/linphone-app/src/components/chat-events/ChatMessageModel.cpp index 16537c318..c4e5e22e2 100644 --- a/linphone-app/src/components/chat-events/ChatMessageModel.cpp +++ b/linphone-app/src/components/chat-events/ChatMessageModel.cpp @@ -19,94 +19,98 @@ */ #include "ChatMessageModel.hpp" - #include -#include #include #include #include #include +#include +#include #include #include -#include -#include #include -#include +#include +#include #include "ChatMessageListener.hpp" #include "app/App.hpp" #include "app/paths/Paths.hpp" -#include "components/chat-reaction/ChatReactionModel.hpp" +#include "app/providers/ThumbnailProvider.hpp" #include "components/chat-reaction/ChatReactionListModel.hpp" +#include "components/chat-reaction/ChatReactionModel.hpp" #include "components/contact/ContactModel.hpp" #include "components/contacts/ContactsListModel.hpp" #include "components/content/ContentListModel.hpp" #include "components/content/ContentModel.hpp" #include "components/content/ContentProxyModel.hpp" #include "components/core/CoreManager.hpp" -#include "app/providers/ThumbnailProvider.hpp" #include "components/notifier/Notifier.hpp" #include "components/participant-imdn/ParticipantImdnStateListModel.hpp" #include "components/participant-imdn/ParticipantImdnStateProxyModel.hpp" #include "components/settings/AccountSettingsModel.hpp" #include "components/settings/SettingsModel.hpp" +#include "utils/Constants.hpp" #include "utils/QExifImageHeader.hpp" #include "utils/Utils.hpp" -#include "utils/Constants.hpp" - -void ChatMessageModel::connectTo(ChatMessageListener * listener){ +void ChatMessageModel::connectTo(ChatMessageListener *listener) { connect(listener, &ChatMessageListener::fileTransferRecv, this, &ChatMessageModel::onFileTransferRecv); connect(listener, &ChatMessageListener::fileTransferSendChunk, this, &ChatMessageModel::onFileTransferSendChunk); connect(listener, &ChatMessageListener::fileTransferSend, this, &ChatMessageModel::onFileTransferSend); - connect(listener, &ChatMessageListener::fileTransferProgressIndication, this, &ChatMessageModel::onFileTransferProgressIndication); + connect(listener, &ChatMessageListener::fileTransferProgressIndication, this, + &ChatMessageModel::onFileTransferProgressIndication); connect(listener, &ChatMessageListener::msgStateChanged, this, &ChatMessageModel::onMsgStateChanged); connect(listener, &ChatMessageListener::newMessageReaction, this, &ChatMessageModel::onNewMessageReaction); - connect(listener, &ChatMessageListener::participantImdnStateChanged, this, &ChatMessageModel::onParticipantImdnStateChanged); - connect(listener, &ChatMessageListener::ephemeralMessageTimerStarted, this, &ChatMessageModel::onEphemeralMessageTimerStarted); - connect(listener, &ChatMessageListener::ephemeralMessageDeleted, this, &ChatMessageModel::onEphemeralMessageDeleted); - connect(listener, &ChatMessageListener::participantImdnStateChanged, this->getParticipantImdnStates().get(), &ParticipantImdnStateListModel::onParticipantImdnStateChanged); + connect(listener, &ChatMessageListener::participantImdnStateChanged, this, + &ChatMessageModel::onParticipantImdnStateChanged); + connect(listener, &ChatMessageListener::ephemeralMessageTimerStarted, this, + &ChatMessageModel::onEphemeralMessageTimerStarted); + connect(listener, &ChatMessageListener::ephemeralMessageDeleted, this, + &ChatMessageModel::onEphemeralMessageDeleted); + connect(listener, &ChatMessageListener::participantImdnStateChanged, this->getParticipantImdnStates().get(), + &ParticipantImdnStateListModel::onParticipantImdnStateChanged); connect(listener, &ChatMessageListener::reactionRemoved, this, &ChatMessageModel::onReactionRemoved); } // ============================================================================= -ChatMessageModel::ChatMessageModel (const std::shared_ptr& chatMessage, const std::shared_ptr& chatMessageLog, QObject * parent) : ChatEvent(ChatRoomModel::EntryType::MessageEntry, parent) { - App::getInstance()->getEngine()->setObjectOwnership(this, QQmlEngine::CppOwnership);// Avoid QML to destroy it +ChatMessageModel::ChatMessageModel(const std::shared_ptr &chatMessage, + const std::shared_ptr &chatMessageLog, + QObject *parent) + : ChatEvent(ChatRoomModel::EntryType::MessageEntry, parent) { + App::getInstance()->getEngine()->setObjectOwnership(this, QQmlEngine::CppOwnership); // Avoid QML to destroy it init(chatMessage, chatMessageLog); } -ChatMessageModel::~ChatMessageModel(){ - if(mChatMessage) - mChatMessage->removeListener(mChatMessageListener); +ChatMessageModel::~ChatMessageModel() { + if (mChatMessage) mChatMessage->removeListener(mChatMessageListener); } -void ChatMessageModel::init(const std::shared_ptr& chatMessage, const std::shared_ptr& chatMessageLog){ - if(chatMessage){ +void ChatMessageModel::init(const std::shared_ptr &chatMessage, + const std::shared_ptr &chatMessageLog) { + if (chatMessage) { mParticipantImdnStateListModel = QSharedPointer::create(chatMessage); mChatMessageListener = std::make_shared(); connectTo(mChatMessageListener.get()); mChatMessage = chatMessage; mChatMessage->addListener(mChatMessageListener); - if( mChatMessage->isReply()){ + if (mChatMessage->isReply()) { auto replyMessage = mChatMessage->getReplyMessage(); - if( replyMessage)// Reply message could be inexistant (for example : when locally deleted) + if (replyMessage) // Reply message could be inexistant (for example : when locally deleted) mReplyChatMessageModel = create(replyMessage, this->parent()); } std::list> contents = chatMessage->getContents(); QString txt; - for(auto content : contents){ - if(content->isText()) - txt += content->getUtf8Text().c_str(); + for (auto content : contents) { + if (content->isText()) txt += content->getUtf8Text().c_str(); } mContent = txt; - + mTimestamp = QDateTime::fromMSecsSinceEpoch(chatMessage->getTime() * 1000); - if(chatMessageLog) + if (chatMessageLog) mReceivedTimestamp = QDateTime::fromMSecsSinceEpoch(chatMessageLog->getCreationTime() * 1000); - else - mReceivedTimestamp = mTimestamp; + else mReceivedTimestamp = mTimestamp; } mWasDownloaded = false; @@ -114,101 +118,107 @@ void ChatMessageModel::init(const std::shared_ptr& chatMe mChatReactionListModel = QSharedPointer::create(this); } -QSharedPointer ChatMessageModel::create(const std::shared_ptr& chatMessageLog, QObject * parent){ +QSharedPointer +ChatMessageModel::create(const std::shared_ptr &chatMessageLog, QObject *parent) { auto model = QSharedPointer::create(chatMessageLog->getChatMessage(), chatMessageLog, parent); return model; } -QSharedPointer ChatMessageModel::create(const std::shared_ptr& chatMessage, QObject * parent){ +QSharedPointer ChatMessageModel::create(const std::shared_ptr &chatMessage, + QObject *parent) { auto model = QSharedPointer::create(chatMessage, nullptr, parent); return model; } -std::shared_ptr ChatMessageModel::getChatMessage(){ +std::shared_ptr ChatMessageModel::getChatMessage() { return mChatMessage; } -QSharedPointer ChatMessageModel::getContentModel(std::shared_ptr content){ +QSharedPointer ChatMessageModel::getContentModel(std::shared_ptr content) { return mContentListModel->getContentModel(content); } //----------------------------------------------------------------------------------------------------------------------- -QString ChatMessageModel::getFromDisplayName(){ - if(!mFromDisplayNameCache.isEmpty()) - return mFromDisplayNameCache; - if(!mChatMessage) - return ""; +QString ChatMessageModel::getFromDisplayName() { + if (!mFromDisplayNameCache.isEmpty()) return mFromDisplayNameCache; + if (!mChatMessage) return ""; mFromDisplayNameCache = Utils::getDisplayName(mChatMessage->getFromAddress()); return mFromDisplayNameCache; } -QString ChatMessageModel::getFromDisplayNameReplyMessage(){ - if( isReply()){ - if(!fromDisplayNameReplyMessage.isEmpty()) - return fromDisplayNameReplyMessage; - if(!mChatMessage) - return ""; +QString ChatMessageModel::getFromDisplayNameReplyMessage() { + if (isReply()) { + if (!fromDisplayNameReplyMessage.isEmpty()) return fromDisplayNameReplyMessage; + if (!mChatMessage) return ""; fromDisplayNameReplyMessage = Utils::getDisplayName(mChatMessage->getReplyMessageSenderAddress()); return fromDisplayNameReplyMessage; - }else - return ""; + } else return ""; } -QString ChatMessageModel::getFromSipAddress() const{ - return mChatMessage ? Utils::cleanSipAddress(Utils::coreStringToAppString(mChatMessage->getFromAddress()->asStringUriOnly())) : ""; +QString ChatMessageModel::getFromSipAddress() const { + return mChatMessage + ? Utils::cleanSipAddress(Utils::coreStringToAppString(mChatMessage->getFromAddress()->asStringUriOnly())) + : ""; } -QString ChatMessageModel::getToDisplayName() const{ +QString ChatMessageModel::getToDisplayName() const { return mChatMessage ? Utils::getDisplayName(mChatMessage->getToAddress()) : ""; } -QString ChatMessageModel::getToSipAddress() const{ - return mChatMessage ? Utils::cleanSipAddress(Utils::coreStringToAppString(mChatMessage->getToAddress()->asStringUriOnly())) : ""; +QString ChatMessageModel::getToSipAddress() const { + return mChatMessage + ? Utils::cleanSipAddress(Utils::coreStringToAppString(mChatMessage->getToAddress()->asStringUriOnly())) + : ""; } QString ChatMessageModel::getMyReaction() const { - if(!mChatMessage) return ""; + if (!mChatMessage) return ""; auto myReaction = mChatMessage->getOwnReaction(); return myReaction ? Utils::coreStringToAppString(myReaction->getBody()) : ""; } -ContactModel * ChatMessageModel::getContactModel() const{ - return mChatMessage ? CoreManager::getInstance()->getContactsListModel()->findContactModelFromSipAddress(Utils::cleanSipAddress(Utils::coreStringToAppString(mChatMessage->getFromAddress()->asStringUriOnly()))).get() : nullptr; +ContactModel *ChatMessageModel::getContactModel() const { + return mChatMessage ? CoreManager::getInstance() + ->getContactsListModel() + ->findContactModelFromSipAddress(Utils::cleanSipAddress( + Utils::coreStringToAppString(mChatMessage->getFromAddress()->asStringUriOnly()))) + .get() + : nullptr; } -bool ChatMessageModel::isEphemeral() const{ +bool ChatMessageModel::isEphemeral() const { return mChatMessage && mChatMessage->isEphemeral(); } -qint64 ChatMessageModel::getEphemeralExpireTime() const{ +qint64 ChatMessageModel::getEphemeralExpireTime() const { time_t t = mChatMessage ? mChatMessage->getEphemeralExpireTime() : 0; - return t >0 ? t - QDateTime::currentSecsSinceEpoch() : 0; + return t > 0 ? t - QDateTime::currentSecsSinceEpoch() : 0; } -long ChatMessageModel::getEphemeralLifetime() const{ +long ChatMessageModel::getEphemeralLifetime() const { return mChatMessage ? mChatMessage->getEphemeralLifetime() : 0; } -LinphoneEnums::ChatMessageState ChatMessageModel::getState() const{ +LinphoneEnums::ChatMessageState ChatMessageModel::getState() const { return mChatMessage ? LinphoneEnums::fromLinphone(mChatMessage->getState()) : LinphoneEnums::ChatMessageStateIdle; } -bool ChatMessageModel::isOutgoing() const{ +bool ChatMessageModel::isOutgoing() const { return mChatMessage && mChatMessage->isOutgoing(); } -ParticipantImdnStateProxyModel * ChatMessageModel::getProxyImdnStates(){ - ParticipantImdnStateProxyModel * proxy = new ParticipantImdnStateProxyModel(); +ParticipantImdnStateProxyModel *ChatMessageModel::getProxyImdnStates() { + ParticipantImdnStateProxyModel *proxy = new ParticipantImdnStateProxyModel(); proxy->setChatMessageModel(this); return proxy; } -QSharedPointer ChatMessageModel::getParticipantImdnStates() const{ +QSharedPointer ChatMessageModel::getParticipantImdnStates() const { return mParticipantImdnStateListModel; } -QSharedPointer ChatMessageModel::getContents() const{ +QSharedPointer ChatMessageModel::getContents() const { return mContentListModel; } @@ -216,52 +226,48 @@ QSharedPointer ChatMessageModel::getChatReactions() const return mChatReactionListModel; } -bool ChatMessageModel::isReply() const{ +bool ChatMessageModel::isReply() const { return mChatMessage && mChatMessage->isReply(); } -ChatMessageModel * ChatMessageModel::getReplyChatMessageModel() const{ +ChatMessageModel *ChatMessageModel::getReplyChatMessageModel() const { return mReplyChatMessageModel.get(); } -bool ChatMessageModel::isForward() const{ +bool ChatMessageModel::isForward() const { return mChatMessage && mChatMessage->isForward(); } -QString ChatMessageModel::getForwardInfo() const{ +QString ChatMessageModel::getForwardInfo() const { return mChatMessage ? Utils::coreStringToAppString(mChatMessage->getForwardInfo()) : ""; } -QString ChatMessageModel::getForwardInfoDisplayName() const{ +QString ChatMessageModel::getForwardInfoDisplayName() const { QString forwardInfo = getForwardInfo(); auto forwardAddress = Utils::interpretUrl(forwardInfo); - if(!forwardAddress || Utils::isMe(forwardAddress)) - return "";// myself - else - return Utils::getDisplayName(forwardInfo); + if (!forwardAddress || Utils::isMe(forwardAddress)) return ""; // myself + else return Utils::getDisplayName(forwardInfo); } //----------------------------------------------------------------------------------------------------------------------- - - -void ChatMessageModel::setWasDownloaded(bool wasDownloaded){ - if( mWasDownloaded != wasDownloaded) { +void ChatMessageModel::setWasDownloaded(bool wasDownloaded) { + if (mWasDownloaded != wasDownloaded) { mWasDownloaded = wasDownloaded; emit wasDownloadedChanged(); } } -void ChatMessageModel::setTimestamp(const QDateTime& timestamp) { +void ChatMessageModel::setTimestamp(const QDateTime ×tamp) { mTimestamp = timestamp; } -void ChatMessageModel::setReceivedTimestamp(const QDateTime& timestamp) { +void ChatMessageModel::setReceivedTimestamp(const QDateTime ×tamp) { mReceivedTimestamp = timestamp; } //----------------------------------------------------------------------------------------------------------------------- -void ChatMessageModel::resendMessage (){ +void ChatMessageModel::resendMessage() { switch (getState()) { case LinphoneEnums::ChatMessageStateFileTransferError: case LinphoneEnums::ChatMessageStateNotDelivered: { @@ -269,55 +275,64 @@ void ChatMessageModel::resendMessage (){ emit stateChanged(); break; } - + default: qWarning() << QStringLiteral("Unable to resend message: %1. Bad state.").arg(getState()); } } -void ChatMessageModel::sendChatReaction(const QString& reaction){ +void ChatMessageModel::sendChatReaction(const QString &reaction) { auto myReaction = mChatMessage->getOwnReaction(); - if( myReaction && Utils::coreStringToAppString(myReaction->getBody()) == reaction) { + if (myReaction && Utils::coreStringToAppString(myReaction->getBody()) == reaction) { auto chatReaction = mChatMessage->createReaction(""); chatReaction->send(); - //emit reactionRemoved(mChatMessage, chatReaction->getFromAddress()); // Do not emit because we want to display what the server got - }else{ + // emit reactionRemoved(mChatMessage, chatReaction->getFromAddress()); // Do not emit because we want to + // display what the server got + } else { auto chatReaction = mChatMessage->createReaction(Utils::appStringToCoreString(reaction)); chatReaction->send(); - //emit newMessageReaction(mChatMessage, chatReaction);// Do not emit because we want to display what the server got + // emit newMessageReaction(mChatMessage, chatReaction);// Do not emit because we want to display what the server + // got } } -void ChatMessageModel::deleteEvent(){ +void ChatMessageModel::deleteEvent() { if (mChatMessage && mChatMessage->getFileTransferInformation()) { mChatMessage->cancelFileTransfer(); } - if(mChatMessage) - mChatMessage->getChatRoom()->deleteMessage(mChatMessage); + if (mChatMessage) mChatMessage->getChatRoom()->deleteMessage(mChatMessage); } - -void ChatMessageModel::updateFileTransferInformation(){ +void ChatMessageModel::updateFileTransferInformation() { mContentListModel->updateContents(this); } -void ChatMessageModel::onFileTransferRecv(const std::shared_ptr & message, const std::shared_ptr & content, const std::shared_ptr & buffer){ +void ChatMessageModel::onFileTransferRecv(const std::shared_ptr &message, + const std::shared_ptr &content, + const std::shared_ptr &buffer) { } -void ChatMessageModel::onFileTransferSendChunk(const std::shared_ptr & message, const std::shared_ptr & content, size_t offset, size_t size, const std::shared_ptr & buffer) { - +void ChatMessageModel::onFileTransferSendChunk(const std::shared_ptr &message, + const std::shared_ptr &content, + size_t offset, + size_t size, + const std::shared_ptr &buffer) { } -std::shared_ptr ChatMessageModel::onFileTransferSend (const std::shared_ptr &,const std::shared_ptr &content,size_t,size_t) { +std::shared_ptr ChatMessageModel::onFileTransferSend( + const std::shared_ptr &, const std::shared_ptr &content, size_t, size_t) { return nullptr; } -void ChatMessageModel::onFileTransferProgressIndication (const std::shared_ptr &message,const std::shared_ptr &content,size_t offset,size_t total) { +void ChatMessageModel::onFileTransferProgressIndication(const std::shared_ptr &message, + const std::shared_ptr &content, + size_t offset, + size_t total) { auto contentModel = mContentListModel->getContentModel(content); - if(contentModel) { + if (contentModel) { contentModel->setFileOffset(offset); if (total == offset && mChatMessage && !mChatMessage->isOutgoing()) { mContentListModel->downloaded(); bool allAreDownloaded = true; - for(auto content : mContentListModel->getSharedList()) + for (auto content : mContentListModel->getSharedList()) allAreDownloaded &= content->mWasDownloaded; setWasDownloaded(allAreDownloaded); QTimer::singleShot(60, App::getInstance(), @@ -330,13 +345,14 @@ void ChatMessageModel::onFileTransferProgressIndication (const std::shared_ptr &message, linphone::ChatMessage::State state) { - updateFileTransferInformation();// On message state, file transfert information Content can be changed - if( state == linphone::ChatMessage::State::FileTransferDone) { - mContentListModel->updateContents(this);// Avoid having leak contents - if( !mWasDownloaded){// Update states +void ChatMessageModel::onMsgStateChanged(const std::shared_ptr &message, + linphone::ChatMessage::State state) { + updateFileTransferInformation(); // On message state, file transfert information Content can be changed + if (state == linphone::ChatMessage::State::FileTransferDone) { + mContentListModel->updateContents(this); // Avoid having leak contents + if (!mWasDownloaded) { // Update states bool allAreDownloaded = true; - for(auto content : mContentListModel->getSharedList()) + for (auto content : mContentListModel->getSharedList()) allAreDownloaded &= content->mWasDownloaded; setWasDownloaded(allAreDownloaded); } @@ -344,30 +360,28 @@ void ChatMessageModel::onMsgStateChanged (const std::shared_ptr & message, const std::shared_ptr & reaction){ - if(reaction->getFromAddress()->weakEqual(message->getLocalAddress())) - emit myReactionChanged(); +void ChatMessageModel::onNewMessageReaction(const std::shared_ptr &message, + const std::shared_ptr &reaction) { + if (reaction->getFromAddress()->weakEqual(message->getLocalAddress())) emit myReactionChanged(); emit newMessageReaction(message, reaction); } -void ChatMessageModel::onParticipantImdnStateChanged(const std::shared_ptr & message, const std::shared_ptr & state){ - +void ChatMessageModel::onParticipantImdnStateChanged( + const std::shared_ptr &message, + const std::shared_ptr &state) { } -void ChatMessageModel::onEphemeralMessageTimerStarted(const std::shared_ptr & message) { +void ChatMessageModel::onEphemeralMessageTimerStarted(const std::shared_ptr &message) { emit ephemeralExpireTimeChanged(); } -void ChatMessageModel::onEphemeralMessageDeleted(const std::shared_ptr & message) { - //emit remove(mSelf.lock()); - if(!isOutgoing()) - mContentListModel->removeDownloadedFiles(); +void ChatMessageModel::onEphemeralMessageDeleted(const std::shared_ptr &message) { + // emit remove(mSelf.lock()); + if (!isOutgoing()) mContentListModel->removeDownloadedFiles(); emit remove(this); } -void ChatMessageModel::onReactionRemoved(const std::shared_ptr & message, const std::shared_ptr & address) { - if(address->weakEqual(message->getLocalAddress())) - emit myReactionChanged(); +void ChatMessageModel::onReactionRemoved(const std::shared_ptr &message, + const std::shared_ptr &address) { + if (address->weakEqual(message->getLocalAddress())) emit myReactionChanged(); emit reactionRemoved(message, address); } //------------------------------------------------------------------------------------------------------- - - diff --git a/linphone-app/src/utils/Constants.hpp b/linphone-app/src/utils/Constants.hpp index d79ea2bc8..d955de93f 100644 --- a/linphone-app/src/utils/Constants.hpp +++ b/linphone-app/src/utils/Constants.hpp @@ -21,21 +21,22 @@ #ifndef CONSTANTS_H_ #define CONSTANTS_H_ +#include #include #include -#include #include "config.h" // ============================================================================= -class Constants : public QObject{ +class Constants : public QObject { Q_OBJECT public: - Constants(QObject * parent = nullptr) : QObject(parent){} - - //---------------------------------------------------------------------------------- - + Constants(QObject *parent = nullptr) : QObject(parent) { + } + + //---------------------------------------------------------------------------------- + static constexpr char DefaultLocale[] = "en"; static constexpr char DefaultFont[] = "Noto Sans"; static constexpr int DefaultFontPointSize = 10; @@ -46,13 +47,13 @@ public: #endif static constexpr int DefaultEmojiFontPointSize = 10; static QStringList getReactionsList(); - - static constexpr size_t MaxLogsCollectionSize = 10485760*5; // 50MB. - + + static constexpr size_t MaxLogsCollectionSize = 10485760 * 5; // 50MB. + #ifdef ENABLE_UPDATE_CHECK static constexpr int VersionUpdateCheckInterval = 86400000; // 24 hours in milliseconds. -#endif // ifdef ENABLE_UPDATE_CHECK - +#endif // ifdef ENABLE_UPDATE_CHECK + static constexpr char DefaultXmlrpcUri[] = "https://subscribe.linphone.org:444/wizard.php"; static constexpr char DefaultUploadLogsServer[] = "https://www.linphone.org:444/lft.php"; static constexpr char DefaultContactParameters[] = "message-expires=2419200"; @@ -67,18 +68,19 @@ public: static constexpr char PrivatePolicyUrl[] = "https://www.linphone.org/privacy-policy"; static constexpr char ContactUrl[] = "https://www.linphone.org/contact"; static constexpr char TranslationUrl[] = "https://weblate.linphone.org/projects/linphone-desktop/"; - - static constexpr int MaxMosaicParticipants = 6;// From 7, the mosaic quality will be limited to avoid useless computations - + + static constexpr int MaxMosaicParticipants = + 6; // From 7, the mosaic quality will be limited to avoid useless computations + static constexpr char LinphoneBZip2_exe[] = "https://www.linphone.org/releases/windows/tools/bzip2/bzip2.exe"; static constexpr char LinphoneBZip2_dll[] = "https://www.linphone.org/releases/windows/tools/bzip2/bzip2.dll"; static constexpr char DefaultRlsUri[] = "sips:rls@sip.linphone.org"; static constexpr char DefaultLogsEmail[] = "linphone-desktop@belledonne-communications.com"; - - static constexpr char DefaultFlexiAPIURL[] = "https://subscribe.linphone.org/api/";// Need "/" at the end + + static constexpr char DefaultFlexiAPIURL[] = "https://subscribe.linphone.org/api/"; // Need "/" at the end static constexpr char RemoteProvisioningURL[] = "https://subscribe.linphone.org/api/provisioning"; static constexpr char RemoteProvisioningBasicAuth[] = ""; -// OAuth2 settings + // OAuth2 settings static constexpr char OAuth2AuthorizationUrl[] = ""; static constexpr char OAuth2AccessTokenUrl[] = ""; static constexpr char OAuth2RedirectUri[] = ""; @@ -86,8 +88,7 @@ public: static constexpr char OAuth2Password[] = ""; static constexpr char OAuth2Scope[] = ""; static constexpr char DefaultOAuth2RemoteProvisioningHeader[] = "x-linphone-oauth2-token"; - - + Q_PROPERTY(QString PasswordRecoveryUrl MEMBER PasswordRecoveryUrl CONSTANT) Q_PROPERTY(QString CguUrl MEMBER CguUrl CONSTANT) Q_PROPERTY(QString PrivatePolicyUrl MEMBER PrivatePolicyUrl CONSTANT) @@ -96,35 +97,38 @@ public: Q_PROPERTY(int maxMosaicParticipants MEMBER MaxMosaicParticipants CONSTANT) Q_PROPERTY(QStringList reactionsList READ getReactionsList CONSTANT) -// For Webviews + // For Webviews static constexpr char DefaultAssistantRegistrationUrl[] = "https://subscribe.linphone.org/register"; static constexpr char DefaultAssistantLoginUrl[] = "https://subscribe.linphone.org/login"; static constexpr char DefaultAssistantLogoutUrl[] = "https://subscribe.linphone.org/logout"; -//-------------- + //-------------- // Max image size in bytes. (1Mb) - static constexpr qint64 MaxImageSize = 1024000;// In Bytes. - static constexpr qint64 FileSizeLimit = 524288000;// In Bytes. + static constexpr qint64 MaxImageSize = 1024000; // In Bytes. + static constexpr qint64 FileSizeLimit = 524288000; // In Bytes. static constexpr int ThumbnailImageFileWidth = 100; static constexpr int ThumbnailImageFileHeight = 100; - -//-------------------------------------------------------------------------------- -// LINPHONE -//-------------------------------------------------------------------------------- - static constexpr char LinphoneDomain[] = "sip.linphone.org"; // Use for checking if config are a Linphone + //-------------------------------------------------------------------------------- + // LINPHONE + //-------------------------------------------------------------------------------- + + static constexpr char LinphoneDomain[] = "sip.linphone.org"; // Use for checking if config are a Linphone static constexpr char WindowIconPath[] = ":/assets/images/linphone_logo.svg"; static constexpr char ApplicationMinimalQtVersion[] = "5.10.0"; - static constexpr char DefaultConferenceURI[] = "sip:conference-factory@sip.linphone.org"; // Default for a Linphone account - static constexpr char DefaultVideoConferenceURI[] = "sip:videoconference-factory@sip.linphone.org"; // Default for a Linphone account - static constexpr char DefaultLimeServerURL[] = "https://lime.linphone.org/lime-server/lime-server.php"; // Default for a Linphone account - + static constexpr char DefaultConferenceURI[] = + "sip:conference-factory@sip.linphone.org"; // Default for a Linphone account + static constexpr char DefaultVideoConferenceURI[] = + "sip:videoconference-factory@sip.linphone.org"; // Default for a Linphone account + static constexpr char DefaultLimeServerURL[] = + "https://lime.linphone.org/lime-server/lime-server.php"; // Default for a Linphone account + static constexpr char PathAssistantConfig[] = "/" EXECUTABLE_NAME "/assistant/"; static constexpr char PathAvatars[] = "/avatars/"; static constexpr char PathCaptures[] = "/" EXECUTABLE_NAME "/captures/"; - static constexpr char PathCodecs[] = "/codecs/"; - static constexpr char PathData[] = "/" EXECUTABLE_NAME; - static constexpr char PathTools[] = "/tools/"; + static constexpr char PathCodecs[] = "/codecs/"; + static constexpr char PathData[] = "/" EXECUTABLE_NAME; + static constexpr char PathTools[] = "/tools/"; static constexpr char PathLogs[] = "/logs/"; static constexpr char PathVfs[] = "/vfs/"; #ifdef APPLE @@ -135,7 +139,7 @@ public: static constexpr char PathPluginsApp[] = "app/"; static constexpr char PathSounds[] = "/sounds/" EXECUTABLE_NAME; static constexpr char PathUserCertificates[] = "/usr-crt/"; - + static constexpr char PathCallHistoryList[] = "/call-history.db"; static constexpr char PathConfig[] = "/linphonerc"; static constexpr char PathDatabase[] = "/linphone.db"; @@ -147,45 +151,47 @@ public: static constexpr char PathZrtpSecrets[] = "/zidcache"; static constexpr char PathISpellDicts[] = "/" EXECUTABLE_NAME "/ispell_dictionaries/"; static constexpr char PathISpellOwnDict[] = "/" EXECUTABLE_NAME "/ispell_own_dict"; - + static constexpr char LanguagePath[] = ":/languages/"; - + // The main windows of Linphone desktop. static constexpr char QmlViewMainWindow[] = "qrc:/ui/views/App/Main/MainWindow.qml"; static constexpr char QmlViewCallsWindow[] = "qrc:/ui/views/App/Calls/CallsWindow.qml"; static constexpr char QmlViewSettingsWindow[] = "qrc:/ui/views/App/Settings/SettingsWindow.qml"; - + static constexpr char MainQmlUri[] = "Linphone"; - + static constexpr char AttachVirtualWindowMethodName[] = "attachVirtualWindow"; static constexpr char AboutPath[] = "qrc:/ui/views/App/Main/Dialogs/About.qml"; - + static constexpr char AssistantViewName[] = "Assistant"; - + static constexpr char QtDomain[] = "qt"; static constexpr char SrcPattern[] = "/src/"; - static constexpr char LinphoneLocaleEncoding[] = "UTF-8";// Alternative is to use "locale" + static constexpr char LinphoneLocaleEncoding[] = "UTF-8"; // Alternative is to use "locale" static constexpr char VcardScheme[] = EXECUTABLE_NAME "-desktop:/"; static constexpr int CbsCallInterval = 20; static constexpr char RcVersionName[] = "rc_version"; - static constexpr int RcVersionCurrent = 6; // 2 = Conference URI - // 3 = CPIM on basic chat rooms - // 4 = RTP bundle mode - // 5 = Video Conference URI - // 6 = Publish expires -//-------------------------------------------------------------------------------- + static constexpr int RcVersionCurrent = 6; // 2 = Conference URI + // 3 = CPIM on basic chat rooms + // 4 = RTP bundle mode + // 5 = Video Conference URI + // 6 = Publish expires +//-------------------------------------------------------------------------------- // CISCO //-------------------------------------------------------------------------------- #if defined(Q_OS_LINUX) || defined(Q_OS_WIN) static constexpr char H264Description[] = "Provided by CISCO SYSTEM,INC"; #endif // if defined(Q_OS_LINUX) || defined(Q_OS_WIN) - + #ifdef Q_OS_LINUX static constexpr char LibraryExtension[] = "so"; static constexpr char H264InstallName[] = "libopenh264.so"; #ifdef Q_PROCESSOR_X86_64 - static constexpr char PluginUrlH264[] = "http://ciscobinary.openh264.org/libopenh264-2.2.0-linux64.6.so.bz2"; - static constexpr char PluginH264Check[] = "45ba1aaeb6213c19cd9622b79788e16b05beabc4d16a3a74e57f046a0826fd77"; + // static constexpr char PluginUrlH264[] = "http://ciscobinary.openh264.org/libopenh264-2.2.0-linux64.6.so.bz2"; + // static constexpr char PluginH264Check[] = "45ba1aaeb6213c19cd9622b79788e16b05beabc4d16a3a74e57f046a0826fd77"; + static constexpr char PluginUrlH264[] = "http://ciscobinary.openh264.org/libopenh264-2.4.1-linux64.7.so.bz2"; + static constexpr char PluginH264Check[] = ""; #else static constexpr char PluginUrlH264[] = "http://ciscobinary.openh264.org/libopenh264-2.2.0-linux32.6.so.bz2"; static constexpr char PluginH264Check[] = "bf18e0e79c4a23018b0ea5ad6d7dd14fd1b6a6189d2f88fd56dece019fc415c8"; @@ -202,7 +208,7 @@ public: #endif // ifdef Q_OS_WIN64 #endif // ifdef Q_OS_LINUX -//-------------------------------------------------------------------------------- + //-------------------------------------------------------------------------------- }; #endif