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
1f15bc62
Commit
1f15bc62
authored
Dec 20, 2017
by
Ghislain MARY
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Do not create a fallback chatroom when invited to a group chat room.
parent
edd26b98
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
14 additions
and
16 deletions
+14
-16
coreapi/callbacks.c
coreapi/callbacks.c
+1
-1
coreapi/chat.c
coreapi/chat.c
+0
-6
coreapi/private_functions.h
coreapi/private_functions.h
+1
-1
src/c-wrapper/api/c-chat-room.cpp
src/c-wrapper/api/c-chat-room.cpp
+10
-7
src/core/core-chat-room.cpp
src/core/core-chat-room.cpp
+2
-1
No files found.
coreapi/callbacks.c
View file @
1f15bc62
...
...
@@ -727,7 +727,7 @@ static void refer_received(SalOp *op, const SalAddress *refer_to){
}
else
{
LinphoneChatRoom
*
cr
=
L_GET_C_BACK_PTR
(
L_GET_CPP_PTR_FROM_C_OBJECT
(
lc
)
->
findChatRoom
(
ChatRoomId
(
addr
,
IdentityAddress
(
op
->
get_to
()))));
if
(
!
cr
)
cr
=
_linphone_client_group_chat_room_new
(
lc
,
addr
.
asString
().
c_str
(),
nullptr
);
cr
=
_linphone_client_group_chat_room_new
(
lc
,
addr
.
asString
().
c_str
(),
nullptr
,
FALSE
);
L_GET_CPP_PTR_FROM_C_OBJECT
(
cr
)
->
join
();
static_cast
<
SalReferOp
*>
(
op
)
->
reply
(
SalReasonNone
);
return
;
...
...
coreapi/chat.c
View file @
1f15bc62
...
...
@@ -86,12 +86,6 @@ LinphoneChatRoom *linphone_core_create_client_group_chat_room (LinphoneCore *lc,
return
L_GET_C_BACK_PTR
(
L_GET_CPP_PTR_FROM_C_OBJECT
(
lc
)
->
createClientGroupChatRoom
(
L_C_TO_STRING
(
subject
)));
}
LinphoneChatRoom
*
_linphone_core_join_client_group_chat_room
(
LinphoneCore
*
lc
,
const
LinphonePrivate
::
Address
&
addr
)
{
LinphoneChatRoom
*
cr
=
_linphone_client_group_chat_room_new
(
lc
,
addr
.
asString
().
c_str
(),
nullptr
);
L_GET_CPP_PTR_FROM_C_OBJECT
(
cr
)
->
join
();
return
cr
;
}
LinphoneChatRoom
*
_linphone_core_create_server_group_chat_room
(
LinphoneCore
*
lc
,
LinphonePrivate
::
SalCallOp
*
op
)
{
return
_linphone_server_group_chat_room_new
(
lc
,
op
);
}
...
...
coreapi/private_functions.h
View file @
1f15bc62
...
...
@@ -275,7 +275,7 @@ void _linphone_proxy_config_unregister(LinphoneProxyConfig *obj);
void
_linphone_proxy_config_release_ops
(
LinphoneProxyConfig
*
obj
);
/*chat*/
LinphoneChatRoom
*
_linphone_client_group_chat_room_new
(
LinphoneCore
*
core
,
const
char
*
uri
,
const
char
*
subject
);
LinphoneChatRoom
*
_linphone_client_group_chat_room_new
(
LinphoneCore
*
core
,
const
char
*
uri
,
const
char
*
subject
,
bool_t
fallback
);
LinphoneChatRoom
*
_linphone_server_group_chat_room_new
(
LinphoneCore
*
core
,
LinphonePrivate
::
SalCallOp
*
op
);
void
linphone_chat_room_set_call
(
LinphoneChatRoom
*
cr
,
LinphoneCall
*
call
);
LinphoneChatRoomCbs
*
linphone_chat_room_cbs_new
(
void
);
...
...
src/c-wrapper/api/c-chat-room.cpp
View file @
1f15bc62
...
...
@@ -409,7 +409,7 @@ void linphone_chat_room_set_user_data (LinphoneChatRoom *cr, void *ud) {
// Constructor and destructor functions.
// =============================================================================
LinphoneChatRoom
*
_linphone_client_group_chat_room_new
(
LinphoneCore
*
core
,
const
char
*
uri
,
const
char
*
subject
)
{
LinphoneChatRoom
*
_linphone_client_group_chat_room_new
(
LinphoneCore
*
core
,
const
char
*
uri
,
const
char
*
subject
,
bool_t
fallback
)
{
LinphoneAddress
*
addr
=
linphone_address_new
(
uri
);
LinphoneProxyConfig
*
proxy
=
linphone_core_lookup_known_proxy
(
core
,
addr
);
linphone_address_unref
(
addr
);
...
...
@@ -427,15 +427,18 @@ LinphoneChatRoom *_linphone_client_group_chat_room_new (LinphoneCore *core, cons
if
(
from
.
empty
())
from
=
linphone_core_get_primary_contact
(
core
);
LinphonePrivate
::
IdentityAddress
me
(
from
);
// Create a ClientGroupToBasicChatRoom to handle fallback from ClientGroupChatRoom to BasicGroupChatRoom if
// only one participant is invited and that it does not support group chat
shared_ptr
<
LinphonePrivate
::
ClientGroupChatRoom
>
cgcr
=
make_shared
<
LinphonePrivate
::
ClientGroupChatRoom
>
(
L_GET_CPP_PTR_FROM_C_OBJECT
(
core
),
L_C_TO_STRING
(
uri
),
me
,
L_C_TO_STRING
(
subject
));
L_GET_PRIVATE
(
cgcr
)
->
setState
(
LinphonePrivate
::
ChatRoom
::
State
::
Instantiated
);
LinphoneChatRoom
*
cr
=
L_INIT
(
ChatRoom
);
L_SET_CPP_PTR_FROM_C_OBJECT
(
cr
,
make_shared
<
LinphonePrivate
::
ClientGroupToBasicChatRoom
>
(
cgcr
));
L_GET_PRIVATE
(
cgcr
)
->
setCallSessionListener
(
L_GET_PRIVATE_FROM_C_OBJECT
(
cr
));
L_GET_PRIVATE
(
cgcr
)
->
setChatRoomListener
(
L_GET_PRIVATE_FROM_C_OBJECT
(
cr
));
if
(
fallback
)
{
// Create a ClientGroupToBasicChatRoom to handle fallback from ClientGroupChatRoom to BasicGroupChatRoom if
// only one participant is invited and that it does not support group chat
L_SET_CPP_PTR_FROM_C_OBJECT
(
cr
,
make_shared
<
LinphonePrivate
::
ClientGroupToBasicChatRoom
>
(
cgcr
));
L_GET_PRIVATE
(
cgcr
)
->
setCallSessionListener
(
L_GET_PRIVATE_FROM_C_OBJECT
(
cr
));
L_GET_PRIVATE
(
cgcr
)
->
setChatRoomListener
(
L_GET_PRIVATE_FROM_C_OBJECT
(
cr
));
}
else
L_SET_CPP_PTR_FROM_C_OBJECT
(
cr
,
cgcr
);
L_GET_PRIVATE
(
cgcr
)
->
setState
(
LinphonePrivate
::
ChatRoom
::
State
::
Instantiated
);
return
cr
;
}
...
...
src/core/core-chat-room.cpp
View file @
1f15bc62
...
...
@@ -150,7 +150,8 @@ shared_ptr<AbstractChatRoom> Core::createClientGroupChatRoom (const string &subj
_linphone_client_group_chat_room_new
(
getCCore
(),
linphone_core_get_conference_factory_uri
(
getCCore
()),
L_STRING_TO_C
(
subject
)
L_STRING_TO_C
(
subject
),
TRUE
)
);
}
...
...
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