Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
BC
public
liblinphone
Commits
1207501d
Commit
1207501d
authored
Mar 15, 2018
by
Sylvain Berfini
🎩
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Started to restore external body url feature in chat message
parent
a244da20
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
23 additions
and
3 deletions
+23
-3
src/c-wrapper/api/c-chat-message.cpp
src/c-wrapper/api/c-chat-message.cpp
+1
-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
+8
-0
src/chat/chat-room/chat-room.cpp
src/chat/chat-room/chat-room.cpp
+7
-2
src/chat/modifier/file-transfer-chat-message-modifier.cpp
src/chat/modifier/file-transfer-chat-message-modifier.cpp
+4
-0
src/chat/modifier/file-transfer-chat-message-modifier.h
src/chat/modifier/file-transfer-chat-message-modifier.h
+1
-0
No files found.
src/c-wrapper/api/c-chat-message.cpp
View file @
1207501d
...
...
@@ -108,7 +108,7 @@ const char *linphone_chat_message_get_external_body_url(const LinphoneChatMessag
}
void
linphone_chat_message_set_external_body_url
(
LinphoneChatMessage
*
msg
,
const
char
*
url
)
{
L_GET_PRIVATE_FROM_C_OBJECT
(
msg
)
->
setExternalBodyUrl
(
L_C_TO_STRING
(
url
));
}
time_t
linphone_chat_message_get_time
(
const
LinphoneChatMessage
*
msg
)
{
...
...
src/chat/chat-message/chat-message-p.h
View file @
1207501d
...
...
@@ -105,6 +105,7 @@ public:
std
::
string
getSalCustomHeaderValue
(
const
std
::
string
&
name
);
void
loadFileTransferUrlFromBodyToContent
();
std
::
string
createFakeFileTransferFromUrl
(
const
std
::
string
&
url
);
void
setChatRoom
(
const
std
::
shared_ptr
<
AbstractChatRoom
>
&
chatRoom
);
...
...
@@ -127,6 +128,7 @@ public:
void
setAppdata
(
const
std
::
string
&
appData
);
const
std
::
string
&
getExternalBodyUrl
()
const
;
void
setExternalBodyUrl
(
const
std
::
string
&
url
);
bool
hasTextContent
()
const
;
const
Content
*
getTextContent
()
const
;
...
...
src/chat/chat-message/chat-message.cpp
View file @
1207501d
...
...
@@ -263,6 +263,10 @@ const string &ChatMessagePrivate::getExternalBodyUrl () const {
return
Utils
::
getEmptyConstRefObject
<
string
>
();
}
void
ChatMessagePrivate
::
setExternalBodyUrl
(
const
string
&
url
)
{
//TODO
}
const
ContentType
&
ChatMessagePrivate
::
getContentType
()
{
loadContentsFromDatabase
();
if
(
direction
==
ChatMessage
::
Direction
::
Incoming
)
{
...
...
@@ -390,6 +394,10 @@ void ChatMessagePrivate::loadFileTransferUrlFromBodyToContent() {
fileTransferChatMessageModifier
.
decode
(
q
->
getSharedFromThis
(),
errorCode
);
}
std
::
string
ChatMessagePrivate
::
createFakeFileTransferFromUrl
(
const
std
::
string
&
url
)
{
return
fileTransferChatMessageModifier
.
createFakeFileTransferFromUrl
(
url
);
}
void
ChatMessagePrivate
::
setChatRoom
(
const
shared_ptr
<
AbstractChatRoom
>
&
cr
)
{
chatRoom
=
cr
;
chatRoomId
=
cr
->
getChatRoomId
();
...
...
src/chat/chat-room/chat-room.cpp
View file @
1207501d
...
...
@@ -193,8 +193,13 @@ LinphoneReason ChatRoomPrivate::onSipMessageReceived (SalOp *op, const SalMessag
);
Content
content
;
content
.
setContentType
(
message
->
content_type
);
content
.
setBodyFromUtf8
(
message
->
text
?
message
->
text
:
""
);
if
(
message
->
url
&&
strcmp
(
message
->
content_type
,
ContentType
::
ExternalBody
.
asString
().
c_str
())
==
0
)
{
content
.
setContentType
(
ContentType
::
FileTransfer
);
content
.
setBody
(
msg
->
getPrivate
()
->
createFakeFileTransferFromUrl
(
message
->
url
));
}
else
{
content
.
setContentType
(
message
->
content_type
);
content
.
setBodyFromUtf8
(
message
->
text
?
message
->
text
:
""
);
}
msg
->
setInternalContent
(
content
);
msg
->
getPrivate
()
->
setTime
(
message
->
time
);
...
...
src/chat/modifier/file-transfer-chat-message-modifier.cpp
View file @
1207501d
...
...
@@ -968,4 +968,8 @@ void FileTransferChatMessageModifier::releaseHttpRequest () {
}
}
string
FileTransferChatMessageModifier
::
createFakeFileTransferFromUrl
(
const
string
&
url
)
{
return
""
;
//TODO
}
LINPHONE_END_NAMESPACE
src/chat/modifier/file-transfer-chat-message-modifier.h
View file @
1207501d
...
...
@@ -63,6 +63,7 @@ public:
int
downloadFile
(
const
std
::
shared_ptr
<
ChatMessage
>
&
message
,
FileTransferContent
*
fileTransferContent
);
void
cancelFileTransfer
();
bool
isFileTransferInProgressAndValid
();
std
::
string
createFakeFileTransferFromUrl
(
const
std
::
string
&
url
);
private:
int
uploadFile
();
...
...
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