mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-05-07 05:53:06 +00:00
Fixed fileTransferContent values not being set from content's body when fetched from db
This commit is contained in:
parent
8f1ee5a06d
commit
c48f0f70b5
3 changed files with 17 additions and 1 deletions
|
|
@ -86,6 +86,8 @@ public:
|
|||
void removeSalCustomHeader(const std::string& name);
|
||||
std::string getSalCustomHeaderValue(const std::string& name);
|
||||
|
||||
void loadFileTransferUrlFromBodyToContent();
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// Deprecated methods only used for C wrapper, to be removed some day...
|
||||
// -----------------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -305,6 +305,12 @@ bool ChatMessagePrivate::downloadFile () {
|
|||
return false;
|
||||
}
|
||||
|
||||
void ChatMessagePrivate::loadFileTransferUrlFromBodyToContent() {
|
||||
L_Q();
|
||||
int errorCode = 0;
|
||||
fileTransferChatMessageModifier.decode(q->getSharedFromThis(), errorCode);
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
void ChatMessagePrivate::sendImdn (Imdn::Type imdnType, LinphoneReason reason) {
|
||||
|
|
@ -375,7 +381,7 @@ LinphoneReason ChatMessagePrivate::receive () {
|
|||
lInfo() << "File download step already done, skipping";
|
||||
} else {
|
||||
// This will check if internal content is FileTransfer and make the appropriate changes
|
||||
fileTransferChatMessageModifier.decode(q->getSharedFromThis(), errorCode);
|
||||
loadFileTransferUrlFromBodyToContent();
|
||||
currentRecvStep |= ChatMessagePrivate::Step::FileUpload;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -440,6 +440,8 @@ MainDb::MainDb (const shared_ptr<Core> &core) : AbstractDb(*new MainDbPrivate),
|
|||
if (!chatRoom)
|
||||
return nullptr;
|
||||
|
||||
bool hasFileTransferContent = false;
|
||||
|
||||
// 1 - Fetch chat message.
|
||||
shared_ptr<ChatMessage> chatMessage = getChatMessageFromCache(eventId);
|
||||
if (chatMessage)
|
||||
|
|
@ -528,6 +530,12 @@ MainDb::MainDb (const shared_ptr<Core> &core) : AbstractDb(*new MainDbPrivate),
|
|||
}
|
||||
}
|
||||
|
||||
// 3 - Load external body url from body into FileTransferContent if needed
|
||||
if (hasFileTransferContent) {
|
||||
ChatMessagePrivate *dChatMessage = chatMessage->getPrivate();
|
||||
dChatMessage->loadFileTransferUrlFromBodyToContent();
|
||||
}
|
||||
|
||||
cache(chatMessage, eventId);
|
||||
|
||||
end:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue