diff --git a/Linphone/core/chat/message/content/ChatMessageContentCore.cpp b/Linphone/core/chat/message/content/ChatMessageContentCore.cpp index bc48c291c..e37abf6f6 100644 --- a/Linphone/core/chat/message/content/ChatMessageContentCore.cpp +++ b/Linphone/core/chat/message/content/ChatMessageContentCore.cpp @@ -97,16 +97,16 @@ void ChatMessageContentCore::setSelf(QSharedPointer me) mChatMessageContentModelConnection->makeConnectToCore(&ChatMessageContentCore::lDownloadFile, [this]() { mChatMessageContentModelConnection->invokeToModel([this] { - QString error; - bool downloaded = mChatMessageContentModel->downloadFile(mName, &error); + QString *error = new QString(); + bool downloaded = mChatMessageContentModel->downloadFile(mName, error); if (!downloaded) { - mChatMessageContentModelConnection->invokeToCore([this, &error] { - QString message = error; + mChatMessageContentModelConnection->invokeToCore([this, error] { //: Error downloading file %1 - if (error.isEmpty()) error = tr("download_file_default_error").arg(mName); - Utils::showInformationPopup(tr("info_popup_error_titile"), message, false); + if (error->isEmpty()) *error = tr("download_file_default_error").arg(mName); + Utils::showInformationPopup(tr("info_popup_error_titile"), *error, false); + delete error; }); - } + } else delete error; }); }); mChatMessageContentModelConnection->makeConnectToModel( diff --git a/Linphone/data/languages/de.ts b/Linphone/data/languages/de.ts index 2d0597d61..045d4b8ab 100644 --- a/Linphone/data/languages/de.ts +++ b/Linphone/data/languages/de.ts @@ -2240,24 +2240,24 @@ ChatMessageContentCore - + download_file_default_error Error downloading file %1 - + info_popup_error_titile - + popup_error_title Error Fehler - + popup_open_file_error_does_not_exist_message Could not open file : unknown path %1 @@ -2329,8 +2329,8 @@ Error - download_file_error_wrong_state - Wrong message state when requesting downloading, state = %1 + download_file_server_error + Error while trying to download content : %1 @@ -2346,7 +2346,13 @@ Error - + + download_file_error_null_name + Content name is null, can't download it ! + + + + download_file_error_unable_to_download Unable to download file of entry %1 @@ -5646,28 +5652,28 @@ Pour les activer dans un projet commercial, merci de nous contacter. Erweiterte Einstellungen - - + + login_proxy_server_url "Outbound SIP Proxy URI" - + login_proxy_server_url_tooltip "If this field is filled, the outbound proxy will be enabled automatically. Leave it empty to disable it." - - + + login_registrar_uri "Registrar URI" - + login_id "Authentication ID (if different)" diff --git a/Linphone/data/languages/en.ts b/Linphone/data/languages/en.ts index 695a6f23d..2eed5c476 100644 --- a/Linphone/data/languages/en.ts +++ b/Linphone/data/languages/en.ts @@ -2217,24 +2217,24 @@ ChatMessageContentCore - + download_file_default_error Error downloading file %1 Error downloading file %1 - + info_popup_error_titile Error - + popup_error_title Error Error - + popup_open_file_error_does_not_exist_message Could not open file : unknown path %1 Could not open file : unknown path %1 @@ -2301,9 +2301,9 @@ Error - download_file_error_wrong_state - Wrong message state when requesting downloading, state = %1 - Wrong message state when requesting downloading, state = %1 + download_file_server_error + Error while trying to download content : %1 + Error while trying to download content : %1 @@ -2318,7 +2318,13 @@ Error This file was already downloaded and is no more on the server. Your peer have to resend it if you want to get it - + + download_file_error_null_name + Content name is null, can't download it ! + Content name is null, can't download it ! + + + download_file_error_unable_to_download Unable to download file of entry %1 Unable to download file of entry %1 @@ -5541,28 +5547,28 @@ To enable them in a commercial project, please contact us. Advanced parameters - - + + login_proxy_server_url "Outbound SIP Proxy URI" Outbound SIP Proxy URI - + login_proxy_server_url_tooltip "If this field is filled, the outbound proxy will be enabled automatically. Leave it empty to disable it." If this field is filled, the outbound proxy will be enabled automatically. Leave it empty to disable it. - - + + login_registrar_uri "Registrar URI" Registrar URI - + login_id "Authentication ID (if different)" Authentication ID (if different) diff --git a/Linphone/data/languages/fr.ts b/Linphone/data/languages/fr.ts index 8f7db69bf..2e8180cc0 100644 --- a/Linphone/data/languages/fr.ts +++ b/Linphone/data/languages/fr.ts @@ -2217,24 +2217,24 @@ ChatMessageContentCore - + download_file_default_error Error downloading file %1 Erreur de téléchargement du fichier %1 - + info_popup_error_titile Erreur - + popup_error_title Error Erreur - + popup_open_file_error_does_not_exist_message Could not open file : unknown path %1 Impossible d'ouvrir le fichier : chemin inconnu (%1) @@ -2301,9 +2301,9 @@ Error - download_file_error_wrong_state - Wrong message state when requesting downloading, state = %1 - Erreur dans l'état du message lors de la requête de téléchargement (state = %1) + download_file_server_error + Error while trying to download content : %1 + Erreur en tentant de télécharger le contenu : %1 @@ -2318,7 +2318,13 @@ Error Le fichier a déjà été téléchargé et n'est plus disponible sur le serveur. Votre correspondant devra vous le renvoyez si vous souhaitez l'obtenir - + + download_file_error_null_name + Content name is null, can't download it ! + Le nom du contenu est nul, impossible de le télécharger ! + + + download_file_error_unable_to_download Unable to download file of entry %1 Impossible de télécharger le fichier : %1 @@ -5541,28 +5547,28 @@ Pour les activer dans un projet commercial, merci de nous contacter.Paramètres avancés - - + + login_proxy_server_url "Outbound SIP Proxy URI" URI du proxy SIP sortant - + login_proxy_server_url_tooltip "If this field is filled, the outbound proxy will be enabled automatically. Leave it empty to disable it." Si ce champ est rempli, l’outbound proxy sera activé automatiquement. Laissez-le vide pour le désactiver. - - + + login_registrar_uri "Registrar URI" Registrar URI - + login_id "Authentication ID (if different)" Identifiant de connexion (si différent) diff --git a/Linphone/model/chat/message/content/ChatMessageContentModel.cpp b/Linphone/model/chat/message/content/ChatMessageContentModel.cpp index 48bd283e4..181049d04 100644 --- a/Linphone/model/chat/message/content/ChatMessageContentModel.cpp +++ b/Linphone/model/chat/message/content/ChatMessageContentModel.cpp @@ -91,8 +91,8 @@ bool ChatMessageContentModel::downloadFile(const QString &name, QString *error) default: auto state = LinphoneEnums::fromLinphone(mChatMessageModel->getState()); lWarning() << QStringLiteral("Wrong message state when requesting downloading, state=") << state; - //: Wrong message state when requesting downloading, state = %1 - if (error) *error = tr("download_file_error_wrong_state").arg(LinphoneEnums::toString(state)); + //: Error while trying to download content : %1 + if (error) *error = tr("download_file_server_error").arg(LinphoneEnums::toString(state)); return false; } bool soFarSoGood; @@ -113,7 +113,13 @@ bool ChatMessageContentModel::downloadFile(const QString &name, QString *error) //: to get it if (error) *error = tr("download_file_error_file_transfer_unavailable"); return false; + } else if (mContent->getName().empty()) { + lWarning() << QStringLiteral("content name is null, can't download it !"); + //: Content name is null, can't download it ! + if (error) *error = tr("download_file_error_null_name"); + return false; } else { + lDebug() << log().arg("download file : %1").arg(name); auto downloaded = mChatMessageModel->getMonitor()->downloadContent(mContent); if (!downloaded && error) { lWarning() << QStringLiteral("Unable to download file of entry %1.").arg(name);