Commit f58ba408 authored by Sylvain Berfini's avatar Sylvain Berfini 🎩

Moved appData from FileContent to any Content

parent 23287aae
......@@ -236,23 +236,23 @@ void ChatMessagePrivate::setFileTransferFilepath (const string &path) {
const string &ChatMessagePrivate::getAppdata () const {
for (const Content *c : getContents()) {
if (c->isFile()) {
FileContent *fileContent = (FileContent *)c;
return fileContent->getAppData("legacy");
if (!c->getAppData("legacy").empty()) {
return c->getAppData("legacy");
}
}
return Utils::getEmptyConstRefObject<string>();
}
void ChatMessagePrivate::setAppdata (const string &data) {
for (const Content *c : getContents()) {
if (c->isFile()) {
FileContent *fileContent = (FileContent *)c;
fileContent->setAppData("legacy", data);
break;
}
bool contentFound = false;
for (Content *c : getContents()) {
c->setAppData("legacy", data);
contentFound = true;
break;
}
if (contentFound) {
updateInDb();
}
updateInDb();
}
const string &ChatMessagePrivate::getExternalBodyUrl () const {
......
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