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
f00a5b0c
Commit
f00a5b0c
authored
Oct 17, 2018
by
Ronan
Committed by
Ronan
Oct 17, 2018
Browse files
fix(callbacks): avoid invalid cast to client group chat room if a chat room was created as basic
parent
7d8de88f
Pipeline
#439
failed with stage
in 0 seconds
Changes
2
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
3 deletions
+8
-3
coreapi/callbacks.c
coreapi/callbacks.c
+7
-2
include/linphone/utils/general.h
include/linphone/utils/general.h
+1
-1
No files found.
coreapi/callbacks.c
View file @
f00a5b0c
...
...
@@ -140,11 +140,16 @@ static void call_received(SalCallOp *h) {
shared_ptr
<
AbstractChatRoom
>
chatRoom
=
L_GET_CPP_PTR_FROM_C_OBJECT
(
lc
)
->
findChatRoom
(
ChatRoomId
(
IdentityAddress
(
h
->
getFrom
()),
IdentityAddress
(
h
->
getTo
()))
);
if
(
!
chatRoom
)
{
if
(
chatRoom
&&
chatRoom
->
getCapabilities
()
&
ChatRoom
::
Capabilities
::
Basic
)
{
lError
()
<<
"Invalid basic chat room found. It should have been a ClientGroupChatRoom... Recreating it..."
;
chatRoom
->
deleteFromDb
();
chatRoom
.
reset
();
}
if
(
!
chatRoom
)
chatRoom
=
L_GET_PRIVATE_FROM_C_OBJECT
(
lc
)
->
createClientGroupChatRoom
(
h
->
getSubject
(),
h
->
getRemoteContact
(),
h
->
getRemoteBody
(),
false
);
}
const
char
*
oneToOneChatRoomStr
=
sal_custom_header_find
(
h
->
getRecvCustomHeaders
(),
"One-To-One-Chat-Room"
);
if
(
oneToOneChatRoomStr
&&
(
strcmp
(
oneToOneChatRoomStr
,
"true"
)
==
0
))
L_GET_PRIVATE
(
static_pointer_cast
<
ClientGroupChatRoom
>
(
chatRoom
))
->
addOneToOneCapability
();
...
...
include/linphone/utils/general.h
View file @
f00a5b0c
...
...
@@ -234,7 +234,7 @@ namespace Private {
>::type * \
>(CLASS::mPrivate);
// Get P
rivate
data of class in a multiple inheritance case.
// Get P
ublic
data of class in a multiple inheritance case.
#define L_Q_T(CLASS, NAME) \
auto const NAME = static_cast< \
LinphonePrivate::Private::AddConstMirror< \
...
...
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