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
b764f9bb
Commit
b764f9bb
authored
Nov 09, 2017
by
Sylvain Berfini
🎩
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Removed appData in ChatMessage
parent
4957187d
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
27 additions
and
12 deletions
+27
-12
src/chat/chat-message/chat-message-p.h
src/chat/chat-message/chat-message-p.h
+0
-1
src/chat/chat-message/chat-message.cpp
src/chat/chat-message/chat-message.cpp
+13
-5
src/chat/modifier/file-transfer-chat-message-modifier.cpp
src/chat/modifier/file-transfer-chat-message-modifier.cpp
+1
-6
src/content/content-type.cpp
src/content/content-type.cpp
+12
-0
src/content/content-type.h
src/content/content-type.h
+1
-0
No files found.
src/chat/chat-message/chat-message-p.h
View file @
b764f9bb
...
...
@@ -143,7 +143,6 @@ private:
FileTransferChatMessageModifier
fileTransferChatMessageModifier
;
// Cache for returned values, used for compatibility with previous C API
std
::
string
appData
;
std
::
string
fileTransferFilePath
;
ContentType
cContentType
;
std
::
string
cText
;
...
...
src/chat/chat-message/chat-message.cpp
View file @
b764f9bb
...
...
@@ -202,14 +202,22 @@ void ChatMessagePrivate::setFileTransferFilepath (const string &path) {
}
const
string
&
ChatMessagePrivate
::
getAppdata
()
const
{
return
appData
;
for
(
const
Content
*
c
:
contents
)
{
if
(
c
->
getContentType
().
isFile
())
{
FileContent
*
fileContent
=
(
FileContent
*
)
c
;
return
fileContent
->
getFilePath
();
}
}
return
Utils
::
getEmptyConstRefObject
<
string
>
();
}
void
ChatMessagePrivate
::
setAppdata
(
const
string
&
data
)
{
appData
=
data
;
// TODO: history.
// linphone_chat_message_store_appdata(L_GET_C_BACK_PTR(this));
for
(
const
Content
*
c
:
contents
)
{
if
(
c
->
getContentType
().
isFile
())
{
FileContent
*
fileContent
=
(
FileContent
*
)
c
;
return
fileContent
->
setFilePath
(
data
);
}
}
}
const
string
&
ChatMessagePrivate
::
getExternalBodyUrl
()
const
{
...
...
src/chat/modifier/file-transfer-chat-message-modifier.cpp
View file @
b764f9bb
...
...
@@ -49,12 +49,7 @@ ChatMessageModifier::Result FileTransferChatMessageModifier::encode (const share
// For each FileContent, upload it and create a FileTransferContent
for
(
Content
*
content
:
chatMessage
->
getContents
())
{
ContentType
contentType
=
content
->
getContentType
();
//TODO Improve
if
(
contentType
!=
ContentType
::
FileTransfer
&&
contentType
!=
ContentType
::
PlainText
&&
contentType
!=
ContentType
::
ExternalBody
&&
contentType
!=
ContentType
::
Imdn
&&
contentType
!=
ContentType
::
ImIsComposing
&&
contentType
!=
ContentType
::
ResourceLists
&&
contentType
!=
ContentType
::
Sdp
&&
contentType
!=
ContentType
::
ConferenceInfo
&&
contentType
!=
ContentType
::
Cpim
)
{
if
(
contentType
.
isFile
())
{
lInfo
()
<<
"Found content with type "
<<
contentType
.
asString
()
<<
", set it for file upload"
;
FileContent
*
fileContent
=
(
FileContent
*
)
content
;
currentFileContentToTransfer
=
fileContent
;
...
...
src/content/content-type.cpp
View file @
b764f9bb
...
...
@@ -154,6 +154,18 @@ bool ContentType::isValid () const {
return
!
d
->
type
.
empty
()
&&
!
d
->
subType
.
empty
();
}
bool
ContentType
::
isFile
()
const
{
//TODO Improve
if
(
*
this
!=
ContentType
::
FileTransfer
&&
*
this
!=
ContentType
::
PlainText
&&
*
this
!=
ContentType
::
ExternalBody
&&
*
this
!=
ContentType
::
Imdn
&&
*
this
!=
ContentType
::
ImIsComposing
&&
*
this
!=
ContentType
::
ResourceLists
&&
*
this
!=
ContentType
::
Sdp
&&
*
this
!=
ContentType
::
Cpim
&&
*
this
!=
ContentType
::
ConferenceInfo
)
{
return
true
;
}
return
false
;
}
string
ContentType
::
asString
()
const
{
L_D
();
if
(
isValid
())
{
...
...
src/content/content-type.h
View file @
b764f9bb
...
...
@@ -46,6 +46,7 @@ public:
bool
operator
!=
(
const
std
::
string
&
contentType
)
const
=
delete
;
bool
isValid
()
const
;
bool
isFile
()
const
;
const
std
::
string
&
getType
()
const
;
bool
setType
(
const
std
::
string
&
type
);
...
...
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