Commit f04c4a40 authored by Sylvain Berfini's avatar Sylvain Berfini 🎩
Browse files

Fix old chat_message_set_app_data api

parent e045ac01
...@@ -188,7 +188,7 @@ const string &ChatMessagePrivate::getAppdata () const { ...@@ -188,7 +188,7 @@ const string &ChatMessagePrivate::getAppdata () const {
for (const Content *c : contents) { for (const Content *c : contents) {
if (c->getContentType().isFile()) { if (c->getContentType().isFile()) {
FileContent *fileContent = (FileContent *)c; FileContent *fileContent = (FileContent *)c;
return fileContent->getFilePath(); return fileContent->getAppData("app");
} }
} }
return Utils::getEmptyConstRefObject<string>(); return Utils::getEmptyConstRefObject<string>();
...@@ -198,7 +198,8 @@ void ChatMessagePrivate::setAppdata (const string &data) { ...@@ -198,7 +198,8 @@ void ChatMessagePrivate::setAppdata (const string &data) {
for (const Content *c : contents) { for (const Content *c : contents) {
if (c->getContentType().isFile()) { if (c->getContentType().isFile()) {
FileContent *fileContent = (FileContent *)c; FileContent *fileContent = (FileContent *)c;
return fileContent->setFilePath(data); fileContent->setAppData("app", data);
break;
} }
} }
} }
......
...@@ -19,6 +19,7 @@ ...@@ -19,6 +19,7 @@
#include <memory> #include <memory>
#include "linphone/utils/utils.h"
#include "app-data-container.h" #include "app-data-container.h"
// ============================================================================= // =============================================================================
...@@ -62,10 +63,10 @@ const unordered_map<string, string> &AppDataContainer::getAppDataMap () const { ...@@ -62,10 +63,10 @@ const unordered_map<string, string> &AppDataContainer::getAppDataMap () const {
return *d->appData.get(); return *d->appData.get();
} }
string AppDataContainer::getAppData (const string &name) const { const string &AppDataContainer::getAppData (const string &name) const {
L_D(); L_D();
auto it = d->appData->find(name); auto it = d->appData->find(name);
return it == d->appData->cend() ? string() : it->second; return it == d->appData->cend() ? Utils::getEmptyConstRefObject<string>() : d->appData->at(name);
} }
void AppDataContainer::setAppData (const string &name, const string &appData) { void AppDataContainer::setAppData (const string &name, const string &appData) {
......
...@@ -41,7 +41,7 @@ public: ...@@ -41,7 +41,7 @@ public:
const std::unordered_map<std::string, std::string> &getAppDataMap () const; const std::unordered_map<std::string, std::string> &getAppDataMap () const;
std::string getAppData (const std::string &name) const; const std::string &getAppData (const std::string &name) const;
void setAppData (const std::string &name, const std::string &appData); void setAppData (const std::string &name, const std::string &appData);
void setAppData (const std::string &name, std::string &&appData); void setAppData (const std::string &name, std::string &&appData);
......
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