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
5c8fa71e
Commit
5c8fa71e
authored
Oct 17, 2017
by
Benjamin REIS
Browse files
create event object on notifed conference event
parent
3a1a899c
Changes
4
Hide whitespace changes
Inline
Side-by-side
src/chat/chat-room/client-group-chat-room.cpp
View file @
5c8fa71e
...
...
@@ -26,6 +26,7 @@
#include "conference/remote-conference-event-handler.h"
#include "conference/remote-conference-p.h"
#include "conference/session/call-session-p.h"
#include "event-log/events.h"
#include "logger/logger.h"
#include "sal/refer-op.h"
...
...
@@ -274,6 +275,14 @@ void ClientGroupChatRoom::onParticipantAdded (time_t tm, const Address &addr) {
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
);
ConferenceParticipantEvent
event
(
EventLog
::
Type
::
ConferenceParticipantAdded
,
tm
,
dConference
->
conferenceAddress
,
dConference
->
eventHandler
->
getLastNotify
(),
addr
);
if
(
cb
)
cb
(
cr
,
L_GET_C_BACK_PTR
(
participant
));
}
...
...
@@ -290,6 +299,13 @@ void ClientGroupChatRoom::onParticipantRemoved (time_t tm, const Address &addr)
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
);
ConferenceParticipantEvent
event
(
EventLog
::
Type
::
ConferenceParticipantRemoved
,
tm
,
dConference
->
conferenceAddress
,
dConference
->
eventHandler
->
getLastNotify
(),
addr
);
if
(
cb
)
cb
(
cr
,
L_GET_C_BACK_PTR
(
participant
));
...
...
@@ -298,6 +314,7 @@ void ClientGroupChatRoom::onParticipantRemoved (time_t tm, const Address &addr)
}
void
ClientGroupChatRoom
::
onParticipantSetAdmin
(
time_t
tm
,
const
Address
&
addr
,
bool
isAdmin
)
{
L_D_T
(
RemoteConference
,
dConference
);
shared_ptr
<
Participant
>
participant
;
if
(
isMe
(
addr
))
participant
=
getMe
();
...
...
@@ -312,22 +329,37 @@ void ClientGroupChatRoom::onParticipantSetAdmin (time_t tm, const Address &addr,
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
);
ConferenceParticipantEvent
event
(
isAdmin
?
EventLog
::
Type
::
ConferenceParticipantSetAdmin
:
EventLog
::
Type
::
ConferenceParticipantUnsetAdmin
,
tm
,
dConference
->
conferenceAddress
,
dConference
->
eventHandler
->
getLastNotify
(),
addr
);
if
(
cb
)
cb
(
cr
,
L_GET_C_BACK_PTR
(
participant
),
isAdmin
);
}
void
ClientGroupChatRoom
::
onSubjectChanged
(
time_t
tm
,
const
std
::
string
&
subject
)
{
L_D_T
(
RemoteConference
,
dConference
);
RemoteConference
::
setSubject
(
subject
);
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
);
ConferenceSubjectEvent
event
(
tm
,
dConference
->
conferenceAddress
,
dConference
->
eventHandler
->
getLastNotify
(),
subject
);
if
(
cb
)
cb
(
cr
,
subject
.
c_str
());
}
void
ClientGroupChatRoom
::
onParticipantDeviceAdded
(
time_t
tm
,
const
Address
&
addr
,
const
Address
&
gruu
)
{
L_D_T
(
RemoteConference
,
dConference
);
shared_ptr
<
Participant
>
participant
;
if
(
isMe
(
addr
))
participant
=
getMe
();
...
...
@@ -338,9 +370,18 @@ void ClientGroupChatRoom::onParticipantDeviceAdded (time_t tm, const Address &ad
return
;
}
participant
->
getPrivate
()
->
addDevice
(
gruu
);
ConferenceParticipantDeviceEvent
event
(
EventLog
::
Type
::
ConferenceParticipantDeviceAdded
,
tm
,
dConference
->
conferenceAddress
,
dConference
->
eventHandler
->
getLastNotify
(),
addr
,
gruu
);
}
void
ClientGroupChatRoom
::
onParticipantDeviceRemoved
(
time_t
tm
,
const
Address
&
addr
,
const
Address
&
gruu
)
{
L_D_T
(
RemoteConference
,
dConference
);
shared_ptr
<
Participant
>
participant
;
if
(
isMe
(
addr
))
participant
=
getMe
();
...
...
@@ -351,6 +392,14 @@ void ClientGroupChatRoom::onParticipantDeviceRemoved (time_t tm, const Address &
return
;
}
participant
->
getPrivate
()
->
removeDevice
(
gruu
);
ConferenceParticipantDeviceEvent
event
(
EventLog
::
Type
::
ConferenceParticipantDeviceRemoved
,
tm
,
dConference
->
conferenceAddress
,
dConference
->
eventHandler
->
getLastNotify
(),
addr
,
gruu
);
}
// -----------------------------------------------------------------------------
...
...
src/conference/remote-conference-event-handler-p.h
View file @
5c8fa71e
...
...
@@ -29,11 +29,6 @@
LINPHONE_BEGIN_NAMESPACE
class
RemoteConferenceEventHandlerPrivate
:
public
ObjectPrivate
{
public:
inline
unsigned
int
getLastNotify
()
const
{
return
lastNotify
;
};
private:
LinphoneCore
*
core
=
nullptr
;
ConferenceListener
*
listener
=
nullptr
;
...
...
src/conference/remote-conference-event-handler.cpp
View file @
5c8fa71e
...
...
@@ -68,7 +68,7 @@ void RemoteConferenceEventHandler::unsubscribe () {
}
}
void
RemoteConferenceEventHandler
::
notifyReceived
(
string
xmlBody
)
{
void
RemoteConferenceEventHandler
::
notifyReceived
(
const
string
&
xmlBody
)
{
L_D
();
lInfo
()
<<
"NOTIFY received for conference "
<<
d
->
confAddress
.
asString
();
istringstream
data
(
xmlBody
);
...
...
@@ -133,4 +133,9 @@ const Address &RemoteConferenceEventHandler::getConfAddress () const {
return
d
->
confAddress
;
}
unsigned
int
RemoteConferenceEventHandler
::
getLastNotify
()
const
{
L_D
();
return
d
->
lastNotify
;
};
LINPHONE_END_NAMESPACE
src/conference/remote-conference-event-handler.h
View file @
5c8fa71e
...
...
@@ -22,8 +22,6 @@
#include <string>
#include "linphone/types.h"
#include "object/object.h"
#include "conference-listener.h"
...
...
@@ -37,10 +35,11 @@ class RemoteConferenceEventHandler : public Object {
~
RemoteConferenceEventHandler
();
void
subscribe
(
const
Address
&
confAddress
);
void
notifyReceived
(
std
::
string
xmlBody
);
void
notifyReceived
(
const
std
::
string
&
xmlBody
);
void
unsubscribe
();
const
Address
&
getConfAddress
()
const
;
unsigned
int
getLastNotify
()
const
;
private:
L_DECLARE_PRIVATE
(
RemoteConferenceEventHandler
);
...
...
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