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
231f0e39
Commit
231f0e39
authored
Oct 03, 2017
by
Ghislain MARY
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add callback on chat room subject change.
parent
b5e01655
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
44 additions
and
0 deletions
+44
-0
include/linphone/api/c-callbacks.h
include/linphone/api/c-callbacks.h
+7
-0
include/linphone/api/c-chat-room-cbs.h
include/linphone/api/c-chat-room-cbs.h
+14
-0
src/c-wrapper/api/c-chat-room-cbs.cpp
src/c-wrapper/api/c-chat-room-cbs.cpp
+9
-0
src/chat/client-group-chat-room.cpp
src/chat/client-group-chat-room.cpp
+9
-0
src/chat/client-group-chat-room.h
src/chat/client-group-chat-room.h
+1
-0
src/conference/conference-listener.h
src/conference/conference-listener.h
+1
-0
src/conference/remote-conference.cpp
src/conference/remote-conference.cpp
+2
-0
src/conference/remote-conference.h
src/conference/remote-conference.h
+1
-0
No files found.
include/linphone/api/c-callbacks.h
View file @
231f0e39
...
...
@@ -183,6 +183,13 @@ typedef void (*LinphoneChatRoomCbsParticipantAdminStatusChangedCb) (LinphoneChat
*/
typedef
void
(
*
LinphoneChatRoomCbsStateChangedCb
)
(
LinphoneChatRoom
*
cr
,
LinphoneChatRoomState
newState
);
/**
* Callback used to notify that the subject of a chat room has changed.
* @param[in] cr #LinphoneChatRoom object
* @param[in] subject The new subject of the chat room
*/
typedef
void
(
*
LinphoneChatRoomCbsSubjectChangedCb
)
(
LinphoneChatRoom
*
cr
,
const
char
*
subject
);
/**
* Callback used to notify a chat room that a message has been received but we were unable to decrypt it
* @param cr #LinphoneChatRoom involved in this conversation
...
...
include/linphone/api/c-chat-room-cbs.h
View file @
231f0e39
...
...
@@ -144,6 +144,20 @@ LINPHONE_PUBLIC LinphoneChatRoomCbsStateChangedCb linphone_chat_room_cbs_get_sta
*/
LINPHONE_PUBLIC
void
linphone_chat_room_cbs_set_state_changed
(
LinphoneChatRoomCbs
*
cbs
,
LinphoneChatRoomCbsStateChangedCb
cb
);
/**
* Get the subject changed callback.
* @param[in] cbs LinphoneChatRoomCbs object.
* @return The current subject changed callback.
*/
LINPHONE_PUBLIC
LinphoneChatRoomCbsSubjectChangedCb
linphone_chat_room_cbs_get_subject_changed
(
const
LinphoneChatRoomCbs
*
cbs
);
/**
* Set the subject changed callback.
* @param[in] cbs LinphoneChatRoomCbs object.
* @param[in] cb The subject changed callback to be used.
*/
LINPHONE_PUBLIC
void
linphone_chat_room_cbs_set_subject_changed
(
LinphoneChatRoomCbs
*
cbs
,
LinphoneChatRoomCbsSubjectChangedCb
cb
);
/**
* Get the undecryptable message received callback.
* @param[in] cbs LinphoneChatRoomCbs object.
...
...
src/c-wrapper/api/c-chat-room-cbs.cpp
View file @
231f0e39
...
...
@@ -31,6 +31,7 @@ struct _LinphoneChatRoomCbs {
LinphoneChatRoomCbsParticipantRemovedCb
participantRemovedCb
;
LinphoneChatRoomCbsParticipantAdminStatusChangedCb
participantAdminStatusChangedCb
;
LinphoneChatRoomCbsStateChangedCb
stateChangedCb
;
LinphoneChatRoomCbsSubjectChangedCb
subjectChangedCb
;
LinphoneChatRoomCbsUndecryptableMessageReceivedCb
undecryptableMessageReceivedCb
;
};
...
...
@@ -116,6 +117,14 @@ void linphone_chat_room_cbs_set_state_changed (LinphoneChatRoomCbs *cbs, Linphon
cbs
->
stateChangedCb
=
cb
;
}
LinphoneChatRoomCbsSubjectChangedCb
linphone_chat_room_cbs_get_subject_changed
(
const
LinphoneChatRoomCbs
*
cbs
)
{
return
cbs
->
subjectChangedCb
;
}
void
linphone_chat_room_cbs_set_subject_changed
(
LinphoneChatRoomCbs
*
cbs
,
LinphoneChatRoomCbsSubjectChangedCb
cb
)
{
cbs
->
subjectChangedCb
=
cb
;
}
LinphoneChatRoomCbsUndecryptableMessageReceivedCb
linphone_chat_room_cbs_get_undecryptable_message_received
(
const
LinphoneChatRoomCbs
*
cbs
)
{
return
cbs
->
undecryptableMessageReceivedCb
;
}
...
...
src/chat/client-group-chat-room.cpp
View file @
231f0e39
...
...
@@ -184,6 +184,15 @@ void ClientGroupChatRoom::onParticipantSetAdmin (const Address &addr, bool isAdm
cb
(
cr
,
L_GET_C_BACK_PTR
(
participant
),
isAdmin
);
}
void
ClientGroupChatRoom
::
onSubjectChanged
(
const
std
::
string
&
subject
)
{
this
->
subject
=
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
);
if
(
cb
)
cb
(
cr
,
subject
.
c_str
());
}
// -----------------------------------------------------------------------------
void
ClientGroupChatRoom
::
onCallSessionStateChanged
(
const
CallSession
&
session
,
LinphoneCallState
state
,
const
string
&
message
)
{
...
...
src/chat/client-group-chat-room.h
View file @
231f0e39
...
...
@@ -59,6 +59,7 @@ private:
void
onParticipantAdded
(
const
Address
&
addr
)
override
;
void
onParticipantRemoved
(
const
Address
&
addr
)
override
;
void
onParticipantSetAdmin
(
const
Address
&
addr
,
bool
isAdmin
)
override
;
void
onSubjectChanged
(
const
std
::
string
&
subject
)
override
;
private:
/* CallSessionListener */
...
...
src/conference/conference-listener.h
View file @
231f0e39
...
...
@@ -32,6 +32,7 @@ public:
virtual
void
onParticipantAdded
(
const
Address
&
addr
)
=
0
;
virtual
void
onParticipantRemoved
(
const
Address
&
addr
)
=
0
;
virtual
void
onParticipantSetAdmin
(
const
Address
&
addr
,
bool
isAdmin
)
=
0
;
virtual
void
onSubjectChanged
(
const
std
::
string
&
subject
)
=
0
;
};
LINPHONE_END_NAMESPACE
...
...
src/conference/remote-conference.cpp
View file @
231f0e39
...
...
@@ -92,4 +92,6 @@ void RemoteConference::onParticipantRemoved (const Address &addr) {}
void
RemoteConference
::
onParticipantSetAdmin
(
const
Address
&
addr
,
bool
isAdmin
)
{}
void
RemoteConference
::
onSubjectChanged
(
const
std
::
string
&
subject
)
{}
LINPHONE_END_NAMESPACE
src/conference/remote-conference.h
View file @
231f0e39
...
...
@@ -48,6 +48,7 @@ protected:
void
onParticipantAdded
(
const
Address
&
addr
)
override
;
void
onParticipantRemoved
(
const
Address
&
addr
)
override
;
void
onParticipantSetAdmin
(
const
Address
&
addr
,
bool
isAdmin
)
override
;
void
onSubjectChanged
(
const
std
::
string
&
subject
)
override
;
protected:
RemoteConferenceEventHandler
*
eventHandler
=
nullptr
;
...
...
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