mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-02-01 02:39:22 +00:00
Fix old chat_message_set_app_data api
This commit is contained in:
parent
e045ac0127
commit
f04c4a40e1
3 changed files with 7 additions and 5 deletions
|
|
@ -188,7 +188,7 @@ const string &ChatMessagePrivate::getAppdata () const {
|
|||
for (const Content *c : contents) {
|
||||
if (c->getContentType().isFile()) {
|
||||
FileContent *fileContent = (FileContent *)c;
|
||||
return fileContent->getFilePath();
|
||||
return fileContent->getAppData("app");
|
||||
}
|
||||
}
|
||||
return Utils::getEmptyConstRefObject<string>();
|
||||
|
|
@ -198,7 +198,8 @@ void ChatMessagePrivate::setAppdata (const string &data) {
|
|||
for (const Content *c : contents) {
|
||||
if (c->getContentType().isFile()) {
|
||||
FileContent *fileContent = (FileContent *)c;
|
||||
return fileContent->setFilePath(data);
|
||||
fileContent->setAppData("app", data);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@
|
|||
|
||||
#include <memory>
|
||||
|
||||
#include "linphone/utils/utils.h"
|
||||
#include "app-data-container.h"
|
||||
|
||||
// =============================================================================
|
||||
|
|
@ -62,10 +63,10 @@ const unordered_map<string, string> &AppDataContainer::getAppDataMap () const {
|
|||
return *d->appData.get();
|
||||
}
|
||||
|
||||
string AppDataContainer::getAppData (const string &name) const {
|
||||
const string &AppDataContainer::getAppData (const string &name) const {
|
||||
L_D();
|
||||
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) {
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@ public:
|
|||
|
||||
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, std::string &&appData);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue