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
6dd6e829
Commit
6dd6e829
authored
Nov 17, 2017
by
Ronan
Browse files
feat(conference): refactoring, use CoreAccessor and ChatRoomId
parent
46a194d5
Changes
38
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
171 additions
and
132 deletions
+171
-132
coreapi/linphonecore.c
coreapi/linphonecore.c
+1
-1
include/linphone/api/c-event-log.h
include/linphone/api/c-event-log.h
+10
-3
src/CMakeLists.txt
src/CMakeLists.txt
+6
-6
src/c-wrapper/api/c-event-log.cpp
src/c-wrapper/api/c-event-log.cpp
+26
-8
src/call/call.cpp
src/call/call.cpp
+2
-2
src/chat/chat-room/basic-chat-room.cpp
src/chat/chat-room/basic-chat-room.cpp
+2
-2
src/chat/chat-room/chat-room.cpp
src/chat/chat-room/chat-room.cpp
+1
-1
src/chat/chat-room/chat-room.h
src/chat/chat-room/chat-room.h
+1
-1
src/chat/chat-room/client-group-chat-room.cpp
src/chat/chat-room/client-group-chat-room.cpp
+14
-14
src/chat/chat-room/real-time-text-chat-room.cpp
src/chat/chat-room/real-time-text-chat-room.cpp
+1
-1
src/chat/chat-room/server-group-chat-room-stub.cpp
src/chat/chat-room/server-group-chat-room-stub.cpp
+3
-3
src/conference/conference-p.h
src/conference/conference-p.h
+0
-6
src/conference/conference.cpp
src/conference/conference.cpp
+6
-7
src/conference/conference.h
src/conference/conference.h
+6
-4
src/conference/handlers/local-conference-event-handler-p.h
src/conference/handlers/local-conference-event-handler-p.h
+0
-1
src/conference/handlers/local-conference-event-handler.cpp
src/conference/handlers/local-conference-event-handler.cpp
+6
-4
src/conference/handlers/local-conference-event-handler.h
src/conference/handlers/local-conference-event-handler.h
+20
-16
src/conference/handlers/remote-conference-event-handler-p.h
src/conference/handlers/remote-conference-event-handler-p.h
+7
-4
src/conference/handlers/remote-conference-event-handler.cpp
src/conference/handlers/remote-conference-event-handler.cpp
+42
-33
src/conference/handlers/remote-conference-event-handler.h
src/conference/handlers/remote-conference-event-handler.h
+17
-15
No files found.
coreapi/linphonecore.c
View file @
6dd6e829
...
...
@@ -50,7 +50,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include "chat/chat-room/client-group-chat-room-p.h"
#include "chat/chat-room/server-group-chat-room-p.h"
#include "conference/remote-conference-event-handler.h"
#include "conference/
handlers/
remote-conference-event-handler.h"
#include "core/core.h"
// For migration purpose.
...
...
include/linphone/api/c-event-log.h
View file @
6dd6e829
...
...
@@ -66,11 +66,18 @@ LINPHONE_PUBLIC time_t linphone_event_log_get_creation_time (const LinphoneEvent
// -----------------------------------------------------------------------------
/**
* Returns the
conference
address of a conference event.
* Returns the
peer
address of a conference event.
* @param[in] event_log A #LinphoneEventLog object.
* @return The
conference
address.
* @return The
peer
address.
*/
LINPHONE_PUBLIC
const
LinphoneAddress
*
linphone_event_log_get_conference_address
(
const
LinphoneEventLog
*
event_log
);
LINPHONE_PUBLIC
const
LinphoneAddress
*
linphone_event_log_get_peer_address
(
const
LinphoneEventLog
*
event_log
);
/**
* Returns the local address of a conference event.
* @param[in] event_log A #LinphoneEventLog object.
* @return The local address.
*/
LINPHONE_PUBLIC
const
LinphoneAddress
*
linphone_event_log_get_local_address
(
const
LinphoneEventLog
*
event_log
);
// -----------------------------------------------------------------------------
// ConferenceNotifiedEvent.
...
...
src/CMakeLists.txt
View file @
6dd6e829
...
...
@@ -63,8 +63,10 @@ set(LINPHONE_CXX_OBJECTS_PRIVATE_HEADER_FILES
conference/conference-listener.h
conference/conference-p.h
conference/conference.h
conference/local-conference-event-handler-p.h
conference/local-conference-event-handler.h
conference/handlers/local-conference-event-handler-p.h
conference/handlers/local-conference-event-handler.h
conference/handlers/remote-conference-event-handler-p.h
conference/handlers/remote-conference-event-handler.h
conference/local-conference-p.h
conference/local-conference.h
conference/params/call-session-params-p.h
...
...
@@ -74,8 +76,6 @@ set(LINPHONE_CXX_OBJECTS_PRIVATE_HEADER_FILES
conference/participant-device.h
conference/participant-p.h
conference/participant.h
conference/remote-conference-event-handler-p.h
conference/remote-conference-event-handler.h
conference/remote-conference-p.h
conference/remote-conference.h
conference/session/call-session-listener.h
...
...
@@ -178,13 +178,13 @@ set(LINPHONE_CXX_OBJECTS_SOURCE_FILES
chat/notification/imdn.cpp
chat/notification/is-composing.cpp
conference/conference.cpp
conference/local-conference-event-handler.cpp
conference/handlers/local-conference-event-handler.cpp
conference/handlers/remote-conference-event-handler.cpp
conference/local-conference.cpp
conference/params/call-session-params.cpp
conference/params/media-session-params.cpp
conference/participant-device.cpp
conference/participant.cpp
conference/remote-conference-event-handler.cpp
conference/remote-conference.cpp
conference/session/call-session.cpp
conference/session/media-session.cpp
...
...
src/c-wrapper/api/c-event-log.cpp
View file @
6dd6e829
...
...
@@ -22,6 +22,7 @@
#include "c-wrapper/c-wrapper.h"
#include "call/call.h"
#include "chat/chat-message/chat-message.h"
#include "chat/chat-room/chat-room-id.h"
#include "event-log/events.h"
// =============================================================================
...
...
@@ -35,7 +36,8 @@ L_DECLARE_C_OBJECT_IMPL_WITH_XTORS(
EventLog
,
_linphone_event_log_constructor
,
_linphone_event_log_destructor
,
mutable
LinphoneAddress
*
conferenceAddressCache
;
mutable
LinphoneAddress
*
peerAddressCache
;
mutable
LinphoneAddress
*
localAddressCache
;
mutable
LinphoneAddress
*
participantAddressCache
;
mutable
LinphoneAddress
*
deviceAddressCache
;
);
...
...
@@ -43,8 +45,10 @@ L_DECLARE_C_OBJECT_IMPL_WITH_XTORS(
void
_linphone_event_log_constructor
(
LinphoneEventLog
*
)
{}
void
_linphone_event_log_destructor
(
LinphoneEventLog
*
event_log
)
{
if
(
event_log
->
conferenceAddressCache
)
linphone_address_unref
(
event_log
->
conferenceAddressCache
);
if
(
event_log
->
peerAddressCache
)
linphone_address_unref
(
event_log
->
peerAddressCache
);
if
(
event_log
->
localAddressCache
)
linphone_address_unref
(
event_log
->
localAddressCache
);
if
(
event_log
->
participantAddressCache
)
linphone_address_unref
(
event_log
->
participantAddressCache
);
if
(
event_log
->
deviceAddressCache
)
...
...
@@ -190,18 +194,32 @@ time_t linphone_event_log_get_creation_time (const LinphoneEventLog *event_log)
// ConferenceEvent.
// -----------------------------------------------------------------------------
const
LinphoneAddress
*
linphone_event_log_get_
conference
_address
(
const
LinphoneEventLog
*
event_log
)
{
const
LinphoneAddress
*
linphone_event_log_get_
peer
_address
(
const
LinphoneEventLog
*
event_log
)
{
if
(
!
isConferenceType
(
linphone_event_log_get_type
(
event_log
)))
return
nullptr
;
if
(
!
event_log
->
conference
AddressCache
)
event_log
->
conference
AddressCache
=
linphone_address_new
(
if
(
!
event_log
->
peer
AddressCache
)
event_log
->
peer
AddressCache
=
linphone_address_new
(
static_pointer_cast
<
const
LinphonePrivate
::
ConferenceEvent
>
(
L_GET_CPP_PTR_FROM_C_OBJECT
(
event_log
)
)
->
getC
onference
Address
().
asString
().
c_str
()
)
->
getC
hatRoomId
().
getPeer
Address
().
asString
().
c_str
()
);
return
event_log
->
conferenceAddressCache
;
return
event_log
->
peerAddressCache
;
}
const
LinphoneAddress
*
linphone_event_log_get_local_address
(
const
LinphoneEventLog
*
event_log
)
{
if
(
!
isConferenceType
(
linphone_event_log_get_type
(
event_log
)))
return
nullptr
;
if
(
!
event_log
->
localAddressCache
)
event_log
->
localAddressCache
=
linphone_address_new
(
static_pointer_cast
<
const
LinphonePrivate
::
ConferenceEvent
>
(
L_GET_CPP_PTR_FROM_C_OBJECT
(
event_log
)
)
->
getChatRoomId
().
getLocalAddress
().
asString
().
c_str
()
);
return
event_log
->
localAddressCache
;
}
// -----------------------------------------------------------------------------
...
...
src/call/call.cpp
View file @
6dd6e829
...
...
@@ -227,9 +227,9 @@ Call::Call (
const
Address
*
myAddress
=
(
direction
==
LinphoneCallIncoming
)
?
&
to
:
&
from
;
string
confType
=
lp_config_get_string
(
linphone_core_get_config
(
core
),
"misc"
,
"conference_type"
,
"local"
);
if
(
confType
==
"remote"
)
{
d
->
conference
=
new
RemoteConference
(
core
,
*
myAddress
,
d
);
d
->
conference
=
new
RemoteConference
(
core
->
cppCore
,
*
myAddress
,
d
);
}
else
{
d
->
conference
=
new
LocalConference
(
core
,
*
myAddress
,
d
);
d
->
conference
=
new
LocalConference
(
core
->
cppCore
,
*
myAddress
,
d
);
}
const
Address
*
remoteAddress
=
(
direction
==
LinphoneCallIncoming
)
?
&
from
:
&
to
;
d
->
conference
->
addParticipant
(
*
remoteAddress
,
msp
,
true
);
...
...
src/chat/chat-room/basic-chat-room.cpp
View file @
6dd6e829
...
...
@@ -30,13 +30,13 @@ using namespace std;
LINPHONE_BEGIN_NAMESPACE
BasicChatRoom
::
BasicChatRoom
(
const
shared_ptr
<
Core
>
&
core
,
const
ChatRoomId
&
chatRoomId
)
:
ChatRoom
(
*
new
BasicChatRoomPrivate
,
core
,
chatRoomId
)
{}
Basic
ChatRoom
(
*
new
BasicChatRoomPrivate
,
core
,
chatRoomId
)
{}
BasicChatRoom
::
BasicChatRoom
(
BasicChatRoomPrivate
&
p
,
const
std
::
shared_ptr
<
Core
>
&
core
,
const
ChatRoomId
&
chatRoomId
)
:
ChatRoom
(
p
,
core
,
chatRoomId
)
{}
)
:
CoreAccessor
(
core
),
ChatRoom
(
p
,
core
,
chatRoomId
)
{}
BasicChatRoom
::
CapabilitiesMask
BasicChatRoom
::
getCapabilities
()
const
{
return
static_cast
<
CapabilitiesMask
>
(
Capabilities
::
Basic
);
...
...
src/chat/chat-room/chat-room.cpp
View file @
6dd6e829
...
...
@@ -449,7 +449,7 @@ void ChatRoomPrivate::onIsComposingRefreshNeeded () {
// =============================================================================
ChatRoom
::
ChatRoom
(
ChatRoomPrivate
&
p
,
const
shared_ptr
<
Core
>
&
core
,
const
ChatRoomId
&
chatRoomId
)
:
Object
(
p
),
CoreAccessor
(
core
)
{
CoreAccessor
(
core
)
,
Object
(
p
)
{
L_D
();
d
->
chatRoomId
=
chatRoomId
;
...
...
src/chat/chat-room/chat-room.h
View file @
6dd6e829
...
...
@@ -30,7 +30,7 @@ LINPHONE_BEGIN_NAMESPACE
class
ChatRoomPrivate
;
class
LINPHONE_PUBLIC
ChatRoom
:
public
Object
,
public
CoreAccessor
,
public
ConferenceInterface
{
class
LINPHONE_PUBLIC
ChatRoom
:
public
Object
,
virtual
public
CoreAccessor
,
public
ConferenceInterface
{
friend
class
Core
;
friend
class
CorePrivate
;
friend
class
ChatMessage
;
...
...
src/chat/chat-room/client-group-chat-room.cpp
View file @
6dd6e829
...
...
@@ -22,8 +22,8 @@
#include "address/address-p.h"
#include "c-wrapper/c-wrapper.h"
#include "client-group-chat-room-p.h"
#include "conference/handlers/remote-conference-event-handler.h"
#include "conference/participant-p.h"
#include "conference/remote-conference-event-handler.h"
#include "conference/remote-conference-p.h"
#include "conference/session/call-session-p.h"
#include "core/core-p.h"
...
...
@@ -81,9 +81,9 @@ ClientGroupChatRoom::ClientGroupChatRoom (
const
std
::
string
&
factoryUri
,
const
IdentityAddress
&
me
,
const
std
::
string
&
subject
)
:
)
:
CoreAccessor
(
core
),
ChatRoom
(
*
new
ClientGroupChatRoomPrivate
,
core
,
ChatRoomId
(
IdentityAddress
(),
me
)),
RemoteConference
(
core
->
getCCore
()
,
me
,
nullptr
)
{
RemoteConference
(
core
,
me
,
nullptr
)
{
L_D_T
(
RemoteConference
,
dConference
);
dConference
->
focus
=
make_shared
<
Participant
>
(
Address
(
factoryUri
));
RemoteConference
::
setSubject
(
subject
);
...
...
@@ -141,7 +141,7 @@ void ClientGroupChatRoom::addParticipants (
}
void
ClientGroupChatRoom
::
removeParticipant
(
const
shared_ptr
<
const
Participant
>
&
participant
)
{
LinphoneCore
*
cCore
=
CoreAccessor
::
getCore
()
->
getCCore
();
LinphoneCore
*
cCore
=
getCore
()
->
getCCore
();
SalReferOp
*
referOp
=
new
SalReferOp
(
cCore
->
sal
);
LinphoneAddress
*
lAddr
=
linphone_address_new
(
getConferenceAddress
().
asString
().
c_str
());
...
...
@@ -183,7 +183,7 @@ void ClientGroupChatRoom::setParticipantAdminStatus (shared_ptr<Participant> &pa
return
;
}
LinphoneCore
*
cCore
=
CoreAccessor
::
getCore
()
->
getCCore
();
LinphoneCore
*
cCore
=
getCore
()
->
getCCore
();
SalReferOp
*
referOp
=
new
SalReferOp
(
cCore
->
sal
);
LinphoneAddress
*
lAddr
=
linphone_address_new
(
getConferenceAddress
().
asString
().
c_str
());
...
...
@@ -261,7 +261,7 @@ void ClientGroupChatRoom::onConferenceCreated (const Address &addr) {
L_D_T
(
RemoteConference
,
dConference
);
dConference
->
conferenceAddress
=
addr
;
d
->
chatRoomId
=
ChatRoomId
(
addr
,
d
->
chatRoomId
.
getLocalAddress
());
CoreAccessor
::
getCore
()
->
getPrivate
()
->
insertChatRoom
(
getSharedFromThis
());
getCore
()
->
getPrivate
()
->
insertChatRoom
(
getSharedFromThis
());
}
void
ClientGroupChatRoom
::
onConferenceTerminated
(
const
Address
&
addr
)
{
...
...
@@ -274,7 +274,7 @@ void ClientGroupChatRoom::onConferenceTerminated (const Address &addr) {
void
ClientGroupChatRoom
::
onFirstNotifyReceived
(
const
Address
&
addr
)
{
L_D
();
d
->
setState
(
ChatRoom
::
State
::
Created
);
CoreAccessor
::
getCore
()
->
getPrivate
()
->
insertChatRoomWithDb
(
getSharedFromThis
());
getCore
()
->
getPrivate
()
->
insertChatRoomWithDb
(
getSharedFromThis
());
}
void
ClientGroupChatRoom
::
onParticipantAdded
(
const
shared_ptr
<
ConferenceParticipantEvent
>
&
event
,
bool
isFullState
)
{
...
...
@@ -299,7 +299,7 @@ void ClientGroupChatRoom::onParticipantAdded (const shared_ptr<ConferencePartici
LinphoneChatRoom
*
cr
=
L_GET_C_BACK_PTR
(
this
);
LinphoneChatRoomCbs
*
cbs
=
linphone_chat_room_get_callbacks
(
cr
);
LinphoneChatRoomCbsParticipantAddedCb
cb
=
linphone_chat_room_cbs_get_participant_added
(
cbs
);
Conference
::
getCore
()
->
cppCore
->
getPrivate
()
->
mainDb
->
addEvent
(
event
);
getCore
()
->
getPrivate
()
->
mainDb
->
addEvent
(
event
);
if
(
cb
)
cb
(
cr
,
L_GET_C_BACK_PTR
(
event
));
...
...
@@ -322,7 +322,7 @@ void ClientGroupChatRoom::onParticipantRemoved (const shared_ptr<ConferenceParti
LinphoneChatRoom
*
cr
=
L_GET_C_BACK_PTR
(
this
);
LinphoneChatRoomCbs
*
cbs
=
linphone_chat_room_get_callbacks
(
cr
);
LinphoneChatRoomCbsParticipantRemovedCb
cb
=
linphone_chat_room_cbs_get_participant_removed
(
cbs
);
Conference
::
getCore
()
->
cppCore
->
getPrivate
()
->
mainDb
->
addEvent
(
event
);
getCore
()
->
getPrivate
()
->
mainDb
->
addEvent
(
event
);
if
(
cb
)
cb
(
cr
,
L_GET_C_BACK_PTR
(
event
));
...
...
@@ -351,7 +351,7 @@ void ClientGroupChatRoom::onParticipantSetAdmin (const shared_ptr<ConferencePart
LinphoneChatRoom
*
cr
=
L_GET_C_BACK_PTR
(
this
);
LinphoneChatRoomCbs
*
cbs
=
linphone_chat_room_get_callbacks
(
cr
);
LinphoneChatRoomCbsParticipantAdminStatusChangedCb
cb
=
linphone_chat_room_cbs_get_participant_admin_status_changed
(
cbs
);
Conference
::
getCore
()
->
cppCore
->
getPrivate
()
->
mainDb
->
addEvent
(
event
);
getCore
()
->
getPrivate
()
->
mainDb
->
addEvent
(
event
);
if
(
cb
)
cb
(
cr
,
L_GET_C_BACK_PTR
(
event
));
...
...
@@ -368,7 +368,7 @@ void ClientGroupChatRoom::onSubjectChanged (const shared_ptr<ConferenceSubjectEv
LinphoneChatRoom
*
cr
=
L_GET_C_BACK_PTR
(
this
);
LinphoneChatRoomCbs
*
cbs
=
linphone_chat_room_get_callbacks
(
cr
);
LinphoneChatRoomCbsSubjectChangedCb
cb
=
linphone_chat_room_cbs_get_subject_changed
(
cbs
);
Conference
::
getCore
()
->
cppCore
->
getPrivate
()
->
mainDb
->
addEvent
(
event
);
getCore
()
->
getPrivate
()
->
mainDb
->
addEvent
(
event
);
if
(
cb
)
cb
(
cr
,
L_GET_C_BACK_PTR
(
event
));
...
...
@@ -393,7 +393,7 @@ void ClientGroupChatRoom::onParticipantDeviceAdded (const shared_ptr<ConferenceP
LinphoneChatRoom
*
cr
=
L_GET_C_BACK_PTR
(
this
);
LinphoneChatRoomCbs
*
cbs
=
linphone_chat_room_get_callbacks
(
cr
);
LinphoneChatRoomCbsParticipantDeviceAddedCb
cb
=
linphone_chat_room_cbs_get_participant_device_added
(
cbs
);
Conference
::
getCore
()
->
cppCore
->
getPrivate
()
->
mainDb
->
addEvent
(
event
);
getCore
()
->
getPrivate
()
->
mainDb
->
addEvent
(
event
);
if
(
cb
)
cb
(
cr
,
L_GET_C_BACK_PTR
(
event
));
...
...
@@ -416,7 +416,7 @@ void ClientGroupChatRoom::onParticipantDeviceRemoved (const shared_ptr<Conferenc
LinphoneChatRoom
*
cr
=
L_GET_C_BACK_PTR
(
this
);
LinphoneChatRoomCbs
*
cbs
=
linphone_chat_room_get_callbacks
(
cr
);
LinphoneChatRoomCbsParticipantDeviceRemovedCb
cb
=
linphone_chat_room_cbs_get_participant_device_removed
(
cbs
);
Conference
::
getCore
()
->
cppCore
->
getPrivate
()
->
mainDb
->
addEvent
(
event
);
getCore
()
->
getPrivate
()
->
mainDb
->
addEvent
(
event
);
if
(
cb
)
cb
(
cr
,
L_GET_C_BACK_PTR
(
event
));
...
...
@@ -445,7 +445,7 @@ void ClientGroupChatRoom::onCallSessionStateChanged (
Address
addr
(
session
->
getRemoteContactAddress
()
->
asStringUriOnly
());
onConferenceCreated
(
addr
);
if
(
session
->
getRemoteContactAddress
()
->
hasParam
(
"isfocus"
))
dConference
->
eventHandler
->
subscribe
(
getC
onferenceAddress
());
dConference
->
eventHandler
->
subscribe
(
getC
hatRoomId
());
}
else
if
(
d
->
state
==
ChatRoom
::
State
::
TerminationPending
)
dConference
->
focus
->
getPrivate
()
->
getSession
()
->
terminate
();
}
else
if
((
state
==
LinphoneCallReleased
)
&&
(
d
->
state
==
ChatRoom
::
State
::
TerminationPending
))
{
...
...
src/chat/chat-room/real-time-text-chat-room.cpp
View file @
6dd6e829
...
...
@@ -104,7 +104,7 @@ void RealTimeTextChatRoomPrivate::sendMessage (const shared_ptr<ChatMessage> &ms
// =============================================================================
RealTimeTextChatRoom
::
RealTimeTextChatRoom
(
const
shared_ptr
<
Core
>
&
core
,
const
ChatRoomId
&
chatRoomId
)
:
BasicChatRoom
(
*
new
RealTimeTextChatRoomPrivate
,
core
,
chatRoomId
)
{}
CoreAccessor
(
core
),
BasicChatRoom
(
*
new
RealTimeTextChatRoomPrivate
,
core
,
chatRoomId
)
{}
RealTimeTextChatRoom
::
CapabilitiesMask
RealTimeTextChatRoom
::
getCapabilities
()
const
{
return
BasicChatRoom
::
getCapabilities
()
|
static_cast
<
CapabilitiesMask
>
(
Capabilities
::
RealTimeText
);
...
...
src/chat/chat-room/server-group-chat-room-stub.cpp
View file @
6dd6e829
...
...
@@ -77,9 +77,9 @@ bool ServerGroupChatRoomPrivate::isAdminLeft () const {
// =============================================================================
ServerGroupChatRoom
::
ServerGroupChatRoom
(
const
shared_ptr
<
Core
>
&
core
,
SalCallOp
*
op
)
:
ChatRoom
(
*
new
ServerGroupChatRoomPrivate
,
core
,
ChatRoomId
(
IdentityAddress
(
op
->
get_to
()),
IdentityAddress
(
op
->
get_to
()))),
LocalConference
(
core
->
getCCore
()
,
Address
(
op
->
get_to
()),
nullptr
)
{}
ServerGroupChatRoom
::
ServerGroupChatRoom
(
const
shared_ptr
<
Core
>
&
core
,
SalCallOp
*
op
)
:
CoreAccessor
(
core
),
ChatRoom
(
*
new
ServerGroupChatRoomPrivate
,
core
,
ChatRoomId
(
IdentityAddress
(
op
->
get_to
()),
IdentityAddress
(
op
->
get_to
()))),
LocalConference
(
core
,
Address
(
op
->
get_to
()),
nullptr
)
{}
int
ServerGroupChatRoom
::
getCapabilities
()
const
{
return
0
;
...
...
src/conference/conference-p.h
View file @
6dd6e829
...
...
@@ -20,11 +20,6 @@
#ifndef _CONFERENCE_P_H_
#define _CONFERENCE_P_H_
#include <list>
#include <memory>
#include "linphone/types.h"
#include "address/address.h"
#include "conference.h"
...
...
@@ -41,7 +36,6 @@ public:
std
::
list
<
std
::
shared_ptr
<
Participant
>>
participants
;
protected:
LinphoneCore
*
core
=
nullptr
;
CallListener
*
callListener
=
nullptr
;
std
::
shared_ptr
<
Participant
>
activeParticipant
;
...
...
src/conference/conference.cpp
View file @
6dd6e829
...
...
@@ -29,10 +29,14 @@ using namespace std;
LINPHONE_BEGIN_NAMESPACE
Conference
::
Conference
(
ConferencePrivate
&
p
,
LinphoneCore
*
core
,
const
Address
&
myAddress
,
CallListener
*
listener
)
:
mPrivate
(
&
p
)
{
Conference
::
Conference
(
ConferencePrivate
&
p
,
const
shared_ptr
<
Core
>
&
core
,
const
Address
&
myAddress
,
CallListener
*
listener
)
:
CoreAccessor
(
core
),
mPrivate
(
&
p
)
{
L_D
();
d
->
mPublic
=
this
;
d
->
core
=
core
;
d
->
callListener
=
listener
;
d
->
me
=
make_shared
<
Participant
>
(
myAddress
);
}
...
...
@@ -48,11 +52,6 @@ shared_ptr<Participant> Conference::getActiveParticipant () const {
return
d
->
activeParticipant
;
}
LinphoneCore
*
Conference
::
getCore
()
const
{
L_D
();
return
d
->
core
;
}
// -----------------------------------------------------------------------------
void
Conference
::
addParticipant
(
const
Address
&
addr
,
const
CallSessionParams
*
params
,
bool
hasMedia
)
{
...
...
src/conference/conference.h
View file @
6dd6e829
...
...
@@ -24,6 +24,7 @@
#include "conference/conference-interface.h"
#include "conference/session/call-session-listener.h"
#include "core/core-accessor.h"
// =============================================================================
...
...
@@ -33,7 +34,10 @@ class CallListener;
class
CallSessionPrivate
;
class
ConferencePrivate
;
class
LINPHONE_PUBLIC
Conference
:
public
ConferenceInterface
,
public
CallSessionListener
{
class
LINPHONE_PUBLIC
Conference
:
public
ConferenceInterface
,
public
CallSessionListener
,
virtual
public
CoreAccessor
{
friend
class
CallSessionPrivate
;
public:
...
...
@@ -41,8 +45,6 @@ public:
std
::
shared_ptr
<
Participant
>
getActiveParticipant
()
const
;
LinphoneCore
*
getCore
()
const
;
std
::
shared_ptr
<
Participant
>
findParticipant
(
const
std
::
shared_ptr
<
const
CallSession
>
&
session
)
const
;
/* ConferenceInterface */
...
...
@@ -82,7 +84,7 @@ private:
protected:
explicit
Conference
(
ConferencePrivate
&
p
,
Linphone
Core
*
core
,
const
std
::
shared_ptr
<
Core
>
&
core
,
const
Address
&
myAddress
,
CallListener
*
listener
=
nullptr
);
...
...
src/conference/local-conference-event-handler-p.h
→
src/conference/
handlers/
local-conference-event-handler-p.h
View file @
6dd6e829
...
...
@@ -47,7 +47,6 @@ public:
inline
unsigned
int
getLastNotify
()
const
{
return
lastNotify
;
};
private:
LinphoneCore
*
core
=
nullptr
;
LocalConference
*
conf
=
nullptr
;
unsigned
int
lastNotify
=
0
;
...
...
src/conference/local-conference-event-handler.cpp
→
src/conference/
handlers/
local-conference-event-handler.cpp
View file @
6dd6e829
...
...
@@ -19,12 +19,15 @@
#include <ctime>
#include "linphone/utils/utils.h"
#include "conference/local-conference.h"
#include "conference/participant-p.h"
#include "linphone/utils/utils.h"
#include "local-conference-event-handler-p.h"
#include "logger/logger.h"
#include "object/object-p.h"
// TODO: remove me.
#include "private.h"
// =============================================================================
...
...
@@ -247,12 +250,11 @@ string LocalConferenceEventHandlerPrivate::createNotifyParticipantDeviceRemoved
// =============================================================================
LocalConferenceEventHandler
::
LocalConferenceEventHandler
(
LinphoneCore
*
core
,
LocalConference
*
localConf
)
:
LocalConferenceEventHandler
::
LocalConferenceEventHandler
(
LocalConference
*
localConf
erence
)
:
Object
(
*
new
LocalConferenceEventHandlerPrivate
)
{
L_D
();
xercesc
::
XMLPlatformUtils
::
Initialize
();
d
->
conf
=
localConf
;
d
->
core
=
core
;
d
->
conf
=
localConference
;
// TODO : init d->lastNotify = last notify
}
...
...
src/conference/local-conference-event-handler.h
→
src/conference/
handlers/
local-conference-event-handler.h
View file @
6dd6e829
...
...
@@ -20,31 +20,35 @@
#ifndef _LOCAL_CONFERENCE_EVENT_HANDLER_H_
#define _LOCAL_CONFERENCE_EVENT_HANDLER_H_
#include "address/address.h"
#include "linphone/types.h"
#include "address/address.h"
#include "core/core-accessor.h"
#include "object/object.h"
// =============================================================================
LINPHONE_BEGIN_NAMESPACE
class
LocalConference
;
class
LocalConferenceEventHandlerPrivate
;
class
LocalConferenceEventHandler
:
public
Object
{
public:
LocalConferenceEventHandler
(
LinphoneCore
*
core
,
LocalConference
*
localConf
);
~
LocalConferenceEventHandler
();
void
subscribeReceived
(
LinphoneEvent
*
lev
);
void
notifyParticipantAdded
(
const
Address
&
addr
);
void
notifyParticipantRemoved
(
const
Address
&
addr
);
void
notifyParticipantSetAdmin
(
const
Address
&
addr
,
bool
isAdmin
);
void
notifySubjectChanged
();
void
notifyParticipantDeviceAdded
(
const
Address
&
addr
,
const
Address
&
gruu
);
void
notifyParticipantDeviceRemoved
(
const
Address
&
addr
,
const
Address
&
gruu
);
private:
L_DECLARE_PRIVATE
(
LocalConferenceEventHandler
);
L_DISABLE_COPY
(
LocalConferenceEventHandler
);
public:
LocalConferenceEventHandler
(
LocalConference
*
localConf
erence
);
~
LocalConferenceEventHandler
();
void
subscribeReceived
(
LinphoneEvent
*
lev
);
void
notifyParticipantAdded
(
const
Address
&
addr
);
void
notifyParticipantRemoved
(
const
Address
&
addr
);
void
notifyParticipantSetAdmin
(
const
Address
&
addr
,
bool
isAdmin
);
void
notifySubjectChanged
();
void
notifyParticipantDeviceAdded
(
const
Address
&
addr
,
const
Address
&
gruu
);
void
notifyParticipantDeviceRemoved
(
const
Address
&
addr
,
const
Address
&
gruu
);
private:
L_DECLARE_PRIVATE
(
LocalConferenceEventHandler
);
L_DISABLE_COPY
(
LocalConferenceEventHandler
);
};
LINPHONE_END_NAMESPACE
...
...
src/conference/remote-conference-event-handler-p.h
→
src/conference/
handlers/
remote-conference-event-handler-p.h
View file @
6dd6e829
...
...
@@ -20,7 +20,9 @@
#ifndef _REMOTE_CONFERENCE_EVENT_HANDLER_P_H_
#define _REMOTE_CONFERENCE_EVENT_HANDLER_P_H_
#include "address/address.h"
#include "linphone/types.h"
#include "chat/chat-room/chat-room-id.h"
#include "object/object-p.h"
#include "remote-conference-event-handler.h"
...
...
@@ -30,10 +32,11 @@ LINPHONE_BEGIN_NAMESPACE
class
RemoteConferenceEventHandlerPrivate
:
public
ObjectPrivate
{
private:
LinphoneCore
*
core
=
nullptr
;
ConferenceListener
*
listener
=
nullptr
;
Address
confAddress
;
ChatRoomId
chatRoomId
;
RemoteConference
*
conf
=
nullptr
;
LinphoneEvent
*
lev
=
nullptr
;
unsigned
int
lastNotify
=
0
;
L_DECLARE_PUBLIC
(
RemoteConferenceEventHandler
);
...
...
src/conference/remote-conference-event-handler.cpp
→
src/conference/
handlers/
remote-conference-event-handler.cpp
View file @
6dd6e829
...
...
@@ -17,13 +17,17 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#include "address/identity-address.h"
#include "private.h"
#include "linphone/utils/utils.h"
#include "conference/remote-conference.h"
#include "core/core.h"
#include "logger/logger.h"
#include "remote-conference-event-handler-p.h"
#include "linphone/utils/utils.h"
#include "xml/conference-info.h"
// TODO: Remove me later.
#include "private.h"
// =============================================================================
using
namespace
std
;
...
...
@@ -34,12 +38,11 @@ using namespace Xsd::ConferenceInfo;
// -----------------------------------------------------------------------------
RemoteConferenceEventHandler
::
RemoteConferenceEventHandler
(
LinphoneCore
*
core
,
ConferenceListener
*
listener
)
:
Object
(
*
new
RemoteConferenceEventHandlerPrivate
)
{
RemoteConferenceEventHandler
::
RemoteConferenceEventHandler
(
RemoteConference
*
remoteConference
)
:
Object
(
*
new
RemoteConferenceEventHandlerPrivate
)
{
L_D
();
xercesc
::
XMLPlatformUtils
::
Initialize
();
d
->
core
=
core
;
d
->
listener
=
listener
;
d
->
conf
=
remoteConference
;
// TODO : d->lastNotify = lastNotify
}
...
...
@@ -49,11 +52,11 @@ RemoteConferenceEventHandler::~RemoteConferenceEventHandler () {
// -----------------------------------------------------------------------------
void
RemoteConferenceEventHandler
::
subscribe
(
const
Address
&
addr
)
{
void
RemoteConferenceEventHandler
::
subscribe
(
const
ChatRoomId
&
chatRoomId
)
{
L_D
();
d
->
c
onfAddress
=
addr
;
LinphoneAddress
*
lAddr
=
linphone_address_new
(
d
->
c
onf
Address
.
asString
().
c_str
());
d
->
lev
=
linphone_core_create_subscribe
(
d
->
co
re
,
lAddr
,
"conference"
,
600
);
d
->
c
hatRoomId
=
chatRoomId
;
LinphoneAddress
*
lAddr
=
linphone_address_new
(
d
->
c
hatRoomId
.
getPeer
Address
()
.
asString
().
c_str
());
d
->
lev
=
linphone_core_create_subscribe
(
d
->
co
nf
->
getCore
()
->
getCCore
()
,
lAddr
,
"conference"
,
600
);
linphone_event_add_custom_header
(
d
->
lev
,
"Last-Notify-Version"
,
Utils
::
toString
(
d
->
lastNotify
).
c_str
());
linphone_address_unref
(
lAddr
);
linphone_event_set_internal
(
d
->
lev
,
TRUE
);
...
...
@@ -71,7 +74,10 @@ void RemoteConferenceEventHandler::unsubscribe () {