Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
BC
public
liblinphone
Commits
c48f0f70
Commit
c48f0f70
authored
Dec 05, 2017
by
Sylvain Berfini
🐮
Browse files
Fixed fileTransferContent values not being set from content's body when fetched from db
parent
8f1ee5a0
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
1 deletion
+17
-1
src/chat/chat-message/chat-message-p.h
src/chat/chat-message/chat-message-p.h
+2
-0
src/chat/chat-message/chat-message.cpp
src/chat/chat-message/chat-message.cpp
+7
-1
src/db/main-db.cpp
src/db/main-db.cpp
+8
-0
No files found.
src/chat/chat-message/chat-message-p.h
View file @
c48f0f70
...
...
@@ -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...
// -----------------------------------------------------------------------------
...
...
src/chat/chat-message/chat-message.cpp
View file @
c48f0f70
...
...
@@ -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
f
ileTransfer
ChatMessageModifier
.
decode
(
q
->
getSharedFromThis
(),
errorCode
);
loadF
ileTransfer
UrlFromBodyToContent
(
);
currentRecvStep
|=
ChatMessagePrivate
::
Step
::
FileUpload
;
}
...
...
src/db/main-db.cpp
View file @
c48f0f70
...
...
@@ -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:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment