Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
liblinphone
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
10
Issues
10
List
Board
Labels
Milestones
Merge Requests
21
Merge Requests
21
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
External Wiki
External Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
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
c-chat-message.cpp
src/c-wrapper/api/c-chat-message.cpp
+1
-1
chat-message-p.h
src/chat/chat-message/chat-message-p.h
+2
-0
chat-message.cpp
src/chat/chat-message/chat-message.cpp
+8
-0
chat-room.cpp
src/chat/chat-room/chat-room.cpp
+7
-2
file-transfer-chat-message-modifier.cpp
src/chat/modifier/file-transfer-chat-message-modifier.cpp
+4
-0
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