- 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
This commit is contained in:
Julien Wadel 2025-04-29 15:35:26 +02:00
parent 1c18288fba
commit c1108740d6
3 changed files with 197 additions and 175 deletions

View file

@ -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

View file

@ -19,94 +19,98 @@
*/
#include "ChatMessageModel.hpp"
#include <QQmlApplicationEngine>
#include <algorithm>
#include <QDateTime>
#include <QDesktopServices>
#include <QElapsedTimer>
#include <QFileInfo>
#include <QImageReader>
#include <QMessageBox>
#include <QMimeDatabase>
#include <QTimer>
#include <QUuid>
#include <QMessageBox>
#include <QUrlQuery>
#include <QImageReader>
#include <QUuid>
#include <algorithm>
#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<linphone::ChatMessage>& chatMessage, const std::shared_ptr<const linphone::EventLog>& 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<linphone::ChatMessage> &chatMessage,
const std::shared_ptr<const linphone::EventLog> &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<linphone::ChatMessage>& chatMessage, const std::shared_ptr<const linphone::EventLog>& chatMessageLog){
if(chatMessage){
void ChatMessageModel::init(const std::shared_ptr<linphone::ChatMessage> &chatMessage,
const std::shared_ptr<const linphone::EventLog> &chatMessageLog) {
if (chatMessage) {
mParticipantImdnStateListModel = QSharedPointer<ParticipantImdnStateListModel>::create(chatMessage);
mChatMessageListener = std::make_shared<ChatMessageListener>();
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<std::shared_ptr<linphone::Content>> 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<linphone::ChatMessage>& chatMe
mChatReactionListModel = QSharedPointer<ChatReactionListModel>::create(this);
}
QSharedPointer<ChatMessageModel> ChatMessageModel::create(const std::shared_ptr<const linphone::EventLog>& chatMessageLog, QObject * parent){
QSharedPointer<ChatMessageModel>
ChatMessageModel::create(const std::shared_ptr<const linphone::EventLog> &chatMessageLog, QObject *parent) {
auto model = QSharedPointer<ChatMessageModel>::create(chatMessageLog->getChatMessage(), chatMessageLog, parent);
return model;
}
QSharedPointer<ChatMessageModel> ChatMessageModel::create(const std::shared_ptr<linphone::ChatMessage>& chatMessage, QObject * parent){
QSharedPointer<ChatMessageModel> ChatMessageModel::create(const std::shared_ptr<linphone::ChatMessage> &chatMessage,
QObject *parent) {
auto model = QSharedPointer<ChatMessageModel>::create(chatMessage, nullptr, parent);
return model;
}
std::shared_ptr<linphone::ChatMessage> ChatMessageModel::getChatMessage(){
std::shared_ptr<linphone::ChatMessage> ChatMessageModel::getChatMessage() {
return mChatMessage;
}
QSharedPointer<ContentModel> ChatMessageModel::getContentModel(std::shared_ptr<linphone::Content> content){
QSharedPointer<ContentModel> ChatMessageModel::getContentModel(std::shared_ptr<linphone::Content> 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<ParticipantImdnStateListModel> ChatMessageModel::getParticipantImdnStates() const{
QSharedPointer<ParticipantImdnStateListModel> ChatMessageModel::getParticipantImdnStates() const {
return mParticipantImdnStateListModel;
}
QSharedPointer<ContentListModel> ChatMessageModel::getContents() const{
QSharedPointer<ContentListModel> ChatMessageModel::getContents() const {
return mContentListModel;
}
@ -216,52 +226,48 @@ QSharedPointer<ChatReactionListModel> 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 &timestamp) {
mTimestamp = timestamp;
}
void ChatMessageModel::setReceivedTimestamp(const QDateTime& timestamp) {
void ChatMessageModel::setReceivedTimestamp(const QDateTime &timestamp) {
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<linphone::ChatMessage> & message, const std::shared_ptr<linphone::Content> & content, const std::shared_ptr<const linphone::Buffer> & buffer){
void ChatMessageModel::onFileTransferRecv(const std::shared_ptr<linphone::ChatMessage> &message,
const std::shared_ptr<linphone::Content> &content,
const std::shared_ptr<const linphone::Buffer> &buffer) {
}
void ChatMessageModel::onFileTransferSendChunk(const std::shared_ptr<linphone::ChatMessage> & message, const std::shared_ptr<linphone::Content> & content, size_t offset, size_t size, const std::shared_ptr<linphone::Buffer> & buffer) {
void ChatMessageModel::onFileTransferSendChunk(const std::shared_ptr<linphone::ChatMessage> &message,
const std::shared_ptr<linphone::Content> &content,
size_t offset,
size_t size,
const std::shared_ptr<linphone::Buffer> &buffer) {
}
std::shared_ptr<linphone::Buffer> ChatMessageModel::onFileTransferSend (const std::shared_ptr<linphone::ChatMessage> &,const std::shared_ptr<linphone::Content> &content,size_t,size_t) {
std::shared_ptr<linphone::Buffer> ChatMessageModel::onFileTransferSend(
const std::shared_ptr<linphone::ChatMessage> &, const std::shared_ptr<linphone::Content> &content, size_t, size_t) {
return nullptr;
}
void ChatMessageModel::onFileTransferProgressIndication (const std::shared_ptr<linphone::ChatMessage> &message,const std::shared_ptr<linphone::Content> &content,size_t offset,size_t total) {
void ChatMessageModel::onFileTransferProgressIndication(const std::shared_ptr<linphone::ChatMessage> &message,
const std::shared_ptr<linphone::Content> &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<ContentModel>())
for (auto content : mContentListModel->getSharedList<ContentModel>())
allAreDownloaded &= content->mWasDownloaded;
setWasDownloaded(allAreDownloaded);
QTimer::singleShot(60, App::getInstance(),
@ -330,13 +345,14 @@ void ChatMessageModel::onFileTransferProgressIndication (const std::shared_ptr<l
}
}
void ChatMessageModel::onMsgStateChanged (const std::shared_ptr<linphone::ChatMessage> &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<linphone::ChatMessage> &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<ContentModel>())
for (auto content : mContentListModel->getSharedList<ContentModel>())
allAreDownloaded &= content->mWasDownloaded;
setWasDownloaded(allAreDownloaded);
}
@ -344,30 +360,28 @@ void ChatMessageModel::onMsgStateChanged (const std::shared_ptr<linphone::ChatMe
emit stateChanged();
}
void ChatMessageModel::onNewMessageReaction(const std::shared_ptr<linphone::ChatMessage> & message, const std::shared_ptr<const linphone::ChatMessageReaction> & reaction){
if(reaction->getFromAddress()->weakEqual(message->getLocalAddress()))
emit myReactionChanged();
void ChatMessageModel::onNewMessageReaction(const std::shared_ptr<linphone::ChatMessage> &message,
const std::shared_ptr<const linphone::ChatMessageReaction> &reaction) {
if (reaction->getFromAddress()->weakEqual(message->getLocalAddress())) emit myReactionChanged();
emit newMessageReaction(message, reaction);
}
void ChatMessageModel::onParticipantImdnStateChanged(const std::shared_ptr<linphone::ChatMessage> & message, const std::shared_ptr<const linphone::ParticipantImdnState> & state){
void ChatMessageModel::onParticipantImdnStateChanged(
const std::shared_ptr<linphone::ChatMessage> &message,
const std::shared_ptr<const linphone::ParticipantImdnState> &state) {
}
void ChatMessageModel::onEphemeralMessageTimerStarted(const std::shared_ptr<linphone::ChatMessage> & message) {
void ChatMessageModel::onEphemeralMessageTimerStarted(const std::shared_ptr<linphone::ChatMessage> &message) {
emit ephemeralExpireTimeChanged();
}
void ChatMessageModel::onEphemeralMessageDeleted(const std::shared_ptr<linphone::ChatMessage> & message) {
//emit remove(mSelf.lock());
if(!isOutgoing())
mContentListModel->removeDownloadedFiles();
void ChatMessageModel::onEphemeralMessageDeleted(const std::shared_ptr<linphone::ChatMessage> &message) {
// emit remove(mSelf.lock());
if (!isOutgoing()) mContentListModel->removeDownloadedFiles();
emit remove(this);
}
void ChatMessageModel::onReactionRemoved(const std::shared_ptr<linphone::ChatMessage> & message, const std::shared_ptr<const linphone::Address> & address) {
if(address->weakEqual(message->getLocalAddress()))
emit myReactionChanged();
void ChatMessageModel::onReactionRemoved(const std::shared_ptr<linphone::ChatMessage> &message,
const std::shared_ptr<const linphone::Address> &address) {
if (address->weakEqual(message->getLocalAddress())) emit myReactionChanged();
emit reactionRemoved(message, address);
}
//-------------------------------------------------------------------------------------------------------

View file

@ -21,21 +21,22 @@
#ifndef CONSTANTS_H_
#define CONSTANTS_H_
#include <QDir>
#include <QObject>
#include <QString>
#include <QDir>
#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