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
9750a40c
Commit
9750a40c
authored
Sep 28, 2017
by
Sylvain Berfini
🐮
Browse files
Use macro instead of checking if string is empty manually...
parent
5605c660
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
19 deletions
+9
-19
src/c-wrapper/api/c-chat-message.cpp
src/c-wrapper/api/c-chat-message.cpp
+9
-19
No files found.
src/c-wrapper/api/c-chat-message.cpp
View file @
9750a40c
...
...
@@ -90,13 +90,13 @@ LinphoneChatMessageCbs *linphone_chat_message_get_callbacks(const LinphoneChatMe
// =============================================================================
LinphoneChatRoom
*
linphone_chat_message_get_chat_room
(
const
LinphoneChatMessage
*
msg
)
{
return
L_GET_C_BACK_PTR
(
L_GET_CPP_PTR_FROM_C_OBJECT
(
msg
)
->
getChatRoom
());
shared_ptr
<
const
LinphonePrivate
::
ChatMessage
>
message
=
L_GET_CPP_PTR_FROM_C_OBJECT
(
msg
);
shared_ptr
<
LinphonePrivate
::
ChatRoom
>
room
=
message
->
getChatRoom
();
return
L_GET_C_BACK_PTR
(
room
);
}
const
char
*
linphone_chat_message_get_external_body_url
(
const
LinphoneChatMessage
*
msg
)
{
const
string
&
external_body_url
=
L_GET_CPP_PTR_FROM_C_OBJECT
(
msg
)
->
getExternalBodyUrl
();
if
(
external_body_url
.
empty
())
return
NULL
;
return
external_body_url
.
c_str
();
return
L_STRING_TO_C
(
L_GET_CPP_PTR_FROM_C_OBJECT
(
msg
)
->
getExternalBodyUrl
());
}
void
linphone_chat_message_set_external_body_url
(
LinphoneChatMessage
*
msg
,
const
char
*
url
)
{
...
...
@@ -164,9 +164,7 @@ bool_t linphone_chat_message_is_read(LinphoneChatMessage *msg) {
}
const
char
*
linphone_chat_message_get_appdata
(
const
LinphoneChatMessage
*
msg
)
{
const
string
&
appData
=
L_GET_CPP_PTR_FROM_C_OBJECT
(
msg
)
->
getAppdata
();
if
(
appData
.
empty
())
return
NULL
;
return
appData
.
c_str
();
return
L_STRING_TO_C
(
L_GET_CPP_PTR_FROM_C_OBJECT
(
msg
)
->
getAppdata
());
}
void
linphone_chat_message_set_appdata
(
LinphoneChatMessage
*
msg
,
const
char
*
data
)
{
...
...
@@ -196,9 +194,7 @@ const LinphoneAddress *linphone_chat_message_get_to_address(LinphoneChatMessage
}
const
char
*
linphone_chat_message_get_file_transfer_filepath
(
LinphoneChatMessage
*
msg
)
{
const
string
&
path
=
L_GET_CPP_PTR_FROM_C_OBJECT
(
msg
)
->
getFileTransferFilepath
();
if
(
path
.
empty
())
return
NULL
;
return
path
.
c_str
();
return
L_STRING_TO_C
(
L_GET_CPP_PTR_FROM_C_OBJECT
(
msg
)
->
getFileTransferFilepath
());
}
void
linphone_chat_message_set_file_transfer_filepath
(
LinphoneChatMessage
*
msg
,
const
char
*
filepath
)
{
...
...
@@ -247,9 +243,7 @@ void linphone_chat_message_remove_custom_header(LinphoneChatMessage *msg, const
}
const
char
*
linphone_chat_message_get_custom_header
(
LinphoneChatMessage
*
msg
,
const
char
*
header_name
)
{
const
string
&
header
=
L_GET_PRIVATE_FROM_C_OBJECT
(
msg
)
->
getSalCustomHeaderValue
(
header_name
);
if
(
header
.
empty
())
return
NULL
;
return
header
.
c_str
();
return
L_STRING_TO_C
(
L_GET_PRIVATE_FROM_C_OBJECT
(
msg
)
->
getSalCustomHeaderValue
(
header_name
));
}
const
LinphoneErrorInfo
*
linphone_chat_message_get_error_info
(
const
LinphoneChatMessage
*
msg
)
{
...
...
@@ -329,9 +323,7 @@ void * linphone_chat_message_get_message_state_changed_cb_user_data(LinphoneChat
// =============================================================================
const
char
*
linphone_chat_message_get_content_type
(
const
LinphoneChatMessage
*
msg
)
{
const
string
&
contentType
=
L_GET_PRIVATE_FROM_C_OBJECT
(
msg
)
->
getContentType
();
if
(
contentType
.
empty
())
return
NULL
;
return
contentType
.
c_str
();
return
L_STRING_TO_C
(
L_GET_PRIVATE_FROM_C_OBJECT
(
msg
)
->
getContentType
());
}
void
linphone_chat_message_set_content_type
(
LinphoneChatMessage
*
msg
,
const
char
*
content_type
)
{
...
...
@@ -339,9 +331,7 @@ void linphone_chat_message_set_content_type(LinphoneChatMessage *msg, const char
}
const
char
*
linphone_chat_message_get_text
(
const
LinphoneChatMessage
*
msg
)
{
const
string
&
text
=
L_GET_PRIVATE_FROM_C_OBJECT
(
msg
)
->
getText
();
if
(
text
.
empty
())
return
NULL
;
return
text
.
c_str
();
return
L_STRING_TO_C
(
L_GET_PRIVATE_FROM_C_OBJECT
(
msg
)
->
getText
());
}
int
linphone_chat_message_set_text
(
LinphoneChatMessage
*
msg
,
const
char
*
text
)
{
...
...
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