Skip to content
GitLab
Explore
Projects
Groups
Topics
Snippets
Projects
Groups
Topics
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
BC
public
liblinphone
Compare revisions
1ffd24c63908aacd9d112b040798a9219fb52ec2...edb92f1d2e2b5ea66372c914ba0fd6a0ac1f7ea3
Source
BC/public/liblinphone
Select target project
edb92f1d2e2b5ea66372c914ba0fd6a0ac1f7ea3
Select Git revision
..
..
...
Target
BC/public/liblinphone
Select target project
BC/public/liblinphone
1ffd24c63908aacd9d112b040798a9219fb52ec2
Select Git revision
Compare
Swap revisions
Commits (1)
Fix/protect against chatroom xxxx
· edb92f1d
Simon Morlat
authored
6 years ago
edb92f1d
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
coreapi/callbacks.c
+1
-1
coreapi/callbacks.c
coreapi/chat.c
+16
-4
coreapi/chat.c
coreapi/private_functions.h
+1
-1
coreapi/private_functions.h
tester/CMakeLists.txt
+1
-0
tester/CMakeLists.txt
tester/group_chat_secure.c
+2360
-0
tester/group_chat_secure.c
tester/group_chat_tester.c
+268
-2483
tester/group_chat_tester.c
tester/liblinphone_tester.c
+2
-1
tester/liblinphone_tester.c
tester/liblinphone_tester.h
+6
-0
tester/liblinphone_tester.h
with
2655 additions
and
2490 deletions
coreapi/callbacks.c
View file @
edb92f1d
...
...
@@ -445,7 +445,7 @@ static void message_received(SalOp *op, const SalMessage *msg){
LinphoneCall
*
call
=
(
LinphoneCall
*
)
op
->
getUserPointer
();
LinphoneReason
reason
=
lc
->
chat_deny_code
;
if
(
reason
==
LinphoneReasonNone
)
{
linphone_core_message_received
(
lc
,
op
,
msg
);
reason
=
linphone_core_message_received
(
lc
,
op
,
msg
);
}
auto
messageOp
=
dynamic_cast
<
SalMessageOpInterface
*>
(
op
);
messageOp
->
reply
(
linphone_reason_to_sal
(
reason
));
...
...
This diff is collapsed.
Click to expand it.
coreapi/chat.c
View file @
edb92f1d
...
...
@@ -151,10 +151,13 @@ LinphoneChatRoom *linphone_core_find_one_to_one_chat_room_2 (
);
}
in
t
linphone_core_message_received
(
LinphoneCore
*
lc
,
LinphonePrivate
::
SalOp
*
op
,
const
SalMessage
*
sal_msg
)
{
L
in
phoneReason
linphone_core_message_received
(
LinphoneCore
*
lc
,
LinphonePrivate
::
SalOp
*
op
,
const
SalMessage
*
sal_msg
)
{
LinphoneReason
reason
=
LinphoneReasonNotAcceptable
;
std
::
string
peerAddress
;
std
::
string
localAddress
;
const
char
*
session_mode
=
sal_custom_header_find
(
op
->
getRecvCustomHeaders
(),
"Session-mode"
);
if
(
linphone_core_conference_server_enabled
(
lc
))
{
localAddress
=
peerAddress
=
op
->
getTo
();
}
else
{
...
...
@@ -170,9 +173,18 @@ int linphone_core_message_received(LinphoneCore *lc, LinphonePrivate::SalOp *op,
if
(
chatRoom
)
reason
=
L_GET_PRIVATE
(
chatRoom
)
->
onSipMessageReceived
(
op
,
sal_msg
);
else
if
(
!
linphone_core_conference_server_enabled
(
lc
))
{
chatRoom
=
L_GET_CPP_PTR_FROM_C_OBJECT
(
lc
)
->
getOrCreateBasicChatRoom
(
conferenceId
);
if
(
chatRoom
)
reason
=
L_GET_PRIVATE
(
chatRoom
)
->
onSipMessageReceived
(
op
,
sal_msg
);
/* Client mode but check that it is really for basic chatroom before creating it.*/
if
(
session_mode
&&
strcasecmp
(
session_mode
,
"true"
)
==
0
){
lError
()
<<
"Message is received in the context of a client chatroom for which we have no context."
;
reason
=
LinphoneReasonNotAcceptable
;
}
else
{
chatRoom
=
L_GET_CPP_PTR_FROM_C_OBJECT
(
lc
)
->
getOrCreateBasicChatRoom
(
conferenceId
);
if
(
chatRoom
)
reason
=
L_GET_PRIVATE
(
chatRoom
)
->
onSipMessageReceived
(
op
,
sal_msg
);
}
}
else
{
/* Server mode but chatroom not found. */
reason
=
LinphoneReasonNotFound
;
}
return
reason
;
}
...
...
This diff is collapsed.
Click to expand it.
coreapi/private_functions.h
View file @
edb92f1d
...
...
@@ -270,7 +270,7 @@ LINPHONE_PUBLIC void linphone_core_get_local_ip(LinphoneCore *lc, int af, const
LinphoneProxyConfig
*
linphone_proxy_config_new_from_config_file
(
LinphoneCore
*
lc
,
int
index
);
void
linphone_proxy_config_write_to_config_file
(
LinphoneConfig
*
config
,
LinphoneProxyConfig
*
obj
,
int
index
);
in
t
linphone_core_message_received
(
LinphoneCore
*
lc
,
LinphonePrivate
::
SalOp
*
op
,
const
SalMessage
*
msg
);
L
in
phoneReason
linphone_core_message_received
(
LinphoneCore
*
lc
,
LinphonePrivate
::
SalOp
*
op
,
const
SalMessage
*
msg
);
void
linphone_core_real_time_text_received
(
LinphoneCore
*
lc
,
LinphoneChatRoom
*
cr
,
uint32_t
character
,
LinphoneCall
*
call
);
void
linphone_call_init_media_streams
(
LinphoneCall
*
call
);
...
...
This diff is collapsed.
Click to expand it.
tester/CMakeLists.txt
View file @
edb92f1d
...
...
@@ -195,6 +195,7 @@ set(SOURCE_FILES_C
eventapi_tester.c
flexisip_tester.c
group_chat_tester.c
group_chat_secure.c
liblinphone_tester.c
log_collection_tester.c
message_tester.c
...
...
This diff is collapsed.
Click to expand it.
tester/group_chat_secure.c
0 → 100644
View file @
edb92f1d
This diff is collapsed.
Click to expand it.
tester/group_chat_tester.c
View file @
edb92f1d
This diff is collapsed.
Click to expand it.
tester/liblinphone_tester.c
View file @
edb92f1d
...
...
@@ -309,6 +309,8 @@ int logfile_arg_func(const char *arg) {
void
liblinphone_tester_add_suites
()
{
bc_tester_add_suite
(
&
setup_test_suite
);
bc_tester_add_suite
(
&
register_test_suite
);
bc_tester_add_suite
(
&
group_chat_test_suite
);
bc_tester_add_suite
(
&
secure_group_chat_test_suite
);
bc_tester_add_suite
(
&
tunnel_test_suite
);
bc_tester_add_suite
(
&
offeranswer_test_suite
);
bc_tester_add_suite
(
&
call_test_suite
);
...
...
@@ -349,7 +351,6 @@ void liblinphone_tester_add_suites() {
#ifdef VCARD_ENABLED
bc_tester_add_suite
(
&
vcard_test_suite
);
#endif
bc_tester_add_suite
(
&
group_chat_test_suite
);
bc_tester_add_suite
(
&
utils_test_suite
);
}
...
...
This diff is collapsed.
Click to expand it.
tester/liblinphone_tester.h
View file @
edb92f1d
...
...
@@ -62,6 +62,7 @@ extern test_suite_t event_test_suite;
extern
test_suite_t
main_db_test_suite
;
extern
test_suite_t
flexisip_test_suite
;
extern
test_suite_t
group_chat_test_suite
;
extern
test_suite_t
secure_group_chat_test_suite
;
extern
test_suite_t
log_collection_test_suite
;
extern
test_suite_t
message_test_suite
;
extern
test_suite_t
multi_call_test_suite
;
...
...
@@ -377,6 +378,11 @@ void message_received(LinphoneCore *lc, LinphoneChatRoom *room, LinphoneChatMess
void
file_transfer_received
(
LinphoneChatMessage
*
message
,
const
LinphoneContent
*
content
,
const
LinphoneBuffer
*
buffer
);
LinphoneBuffer
*
tester_file_transfer_send
(
LinphoneChatMessage
*
message
,
const
LinphoneContent
*
content
,
size_t
offset
,
size_t
size
);
LinphoneChatMessage
*
_send_message
(
LinphoneChatRoom
*
chatRoom
,
const
char
*
message
);
void
_send_file_plus_text
(
LinphoneChatRoom
*
cr
,
const
char
*
sendFilepath
,
const
char
*
text
);
void
_send_file
(
LinphoneChatRoom
*
cr
,
const
char
*
sendFilepath
);
void
_receive_file
(
bctbx_list_t
*
coresList
,
LinphoneCoreManager
*
lcm
,
stats
*
receiverStats
,
const
char
*
receive_filepath
,
const
char
*
sendFilepath
);
void
_receive_file_plus_text
(
bctbx_list_t
*
coresList
,
LinphoneCoreManager
*
lcm
,
stats
*
receiverStats
,
const
char
*
receive_filepath
,
const
char
*
sendFilepath
,
const
char
*
text
);
LinphoneBuffer
*
tester_memory_file_transfer_send
(
LinphoneChatMessage
*
message
,
const
LinphoneContent
*
content
,
size_t
offset
,
size_t
size
);
void
file_transfer_progress_indication
(
LinphoneChatMessage
*
message
,
const
LinphoneContent
*
content
,
size_t
offset
,
size_t
total
);
void
is_composing_received
(
LinphoneCore
*
lc
,
LinphoneChatRoom
*
room
);
...
...
This diff is collapsed.
Click to expand it.
Menu
Explore
Projects
Groups
Topics
Snippets