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
181bfa2e
Commit
181bfa2e
authored
Dec 04, 2017
by
Ghislain MARY
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Change the chat room instantiated callback to chat room state changed.
parent
05271e86
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
16 additions
and
19 deletions
+16
-19
coreapi/linphonecore.c
coreapi/linphonecore.c
+4
-4
coreapi/private_functions.h
coreapi/private_functions.h
+1
-1
coreapi/vtables.c
coreapi/vtables.c
+2
-2
include/linphone/callbacks.h
include/linphone/callbacks.h
+3
-3
include/linphone/core.h
include/linphone/core.h
+5
-5
src/chat/chat-room/chat-room.cpp
src/chat/chat-room/chat-room.cpp
+1
-4
No files found.
coreapi/linphonecore.c
View file @
181bfa2e
...
...
@@ -434,12 +434,12 @@ void linphone_core_cbs_set_version_update_check_result_received(LinphoneCoreCbs
cbs
->
vtable
->
version_update_check_result_received
=
cb
;
}
LinphoneCoreCbsChatRoom
Instantiat
edCb
linphone_core_cbs_get_chat_room_
in
sta
ntiat
ed
(
LinphoneCoreCbs
*
cbs
)
{
return
cbs
->
vtable
->
chat_room_
in
sta
ntiat
ed
;
LinphoneCoreCbsChatRoom
StateChang
edCb
linphone_core_cbs_get_chat_room_sta
te_chang
ed
(
LinphoneCoreCbs
*
cbs
)
{
return
cbs
->
vtable
->
chat_room_sta
te_chang
ed
;
}
void
linphone_core_cbs_set_chat_room_
in
sta
ntiat
ed
(
LinphoneCoreCbs
*
cbs
,
LinphoneCoreCbsChatRoom
Instantiat
edCb
cb
)
{
cbs
->
vtable
->
chat_room_
in
sta
ntiat
ed
=
cb
;
void
linphone_core_cbs_set_chat_room_sta
te_chang
ed
(
LinphoneCoreCbs
*
cbs
,
LinphoneCoreCbsChatRoom
StateChang
edCb
cb
)
{
cbs
->
vtable
->
chat_room_sta
te_chang
ed
=
cb
;
}
void
linphone_core_cbs_set_ec_calibration_result
(
LinphoneCoreCbs
*
cbs
,
LinphoneCoreCbsEcCalibrationResultCb
cb
)
{
...
...
coreapi/private_functions.h
View file @
181bfa2e
...
...
@@ -536,7 +536,7 @@ void linphone_core_notify_friend_list_created(LinphoneCore *lc, LinphoneFriendLi
void
linphone_core_notify_friend_list_removed
(
LinphoneCore
*
lc
,
LinphoneFriendList
*
list
);
void
linphone_core_notify_call_created
(
LinphoneCore
*
lc
,
LinphoneCall
*
call
);
void
linphone_core_notify_version_update_check_result_received
(
LinphoneCore
*
lc
,
LinphoneVersionUpdateCheckResult
result
,
const
char
*
version
,
const
char
*
url
);
void
linphone_core_notify_chat_room_
in
sta
ntiat
ed
(
LinphoneCore
*
lc
,
LinphoneChatRoom
*
cr
);
void
linphone_core_notify_chat_room_sta
te_chang
ed
(
LinphoneCore
*
lc
,
LinphoneChatRoom
*
cr
,
LinphoneChatRoomState
state
);
void
linphone_core_notify_ec_calibration_result
(
LinphoneCore
*
lc
,
LinphoneEcCalibratorStatus
status
,
int
delay_ms
);
void
linphone_core_notify_ec_calibration_audio_init
(
LinphoneCore
*
lc
);
...
...
coreapi/vtables.c
View file @
181bfa2e
...
...
@@ -288,8 +288,8 @@ void linphone_core_notify_version_update_check_result_received(LinphoneCore *lc,
cleanup_dead_vtable_refs
(
lc
);
}
void
linphone_core_notify_chat_room_
in
sta
ntiat
ed
(
LinphoneCore
*
lc
,
LinphoneChatRoom
*
cr
)
{
NOTIFY_IF_EXIST
(
chat_room_
in
sta
ntiat
ed
,
lc
,
cr
);
void
linphone_core_notify_chat_room_sta
te_chang
ed
(
LinphoneCore
*
lc
,
LinphoneChatRoom
*
cr
,
LinphoneChatRoomState
state
)
{
NOTIFY_IF_EXIST
(
chat_room_sta
te_chang
ed
,
lc
,
cr
,
state
);
cleanup_dead_vtable_refs
(
lc
);
}
...
...
include/linphone/callbacks.h
View file @
181bfa2e
...
...
@@ -399,11 +399,11 @@ typedef LinphoneCoreCbsFriendListRemovedCb LinphoneCoreFriendListRemovedCb;
typedef
void
(
*
LinphoneCoreCbsVersionUpdateCheckResultReceivedCb
)
(
LinphoneCore
*
lc
,
LinphoneVersionUpdateCheckResult
result
,
const
char
*
version
,
const
char
*
url
);
/**
* Callback prototype telling that a LinphoneChatRoom
object has been instantiated. This is useful to set the callbacks on the LinphoneChatRoom object
.
* Callback prototype telling that a LinphoneChatRoom
state has changed
.
* @param[in] lc LinphoneCore object
* @param[in] cr The LinphoneChatRoom object t
h
at has
been instantiat
ed
* @param[in] cr The LinphoneChatRoom object
for which the s
tat
e
has
chang
ed
*/
typedef
void
(
*
LinphoneCoreCbsChatRoom
Instantiat
edCb
)
(
LinphoneCore
*
lc
,
LinphoneChatRoom
*
cr
);
typedef
void
(
*
LinphoneCoreCbsChatRoom
StateChang
edCb
)
(
LinphoneCore
*
lc
,
LinphoneChatRoom
*
cr
,
LinphoneChatRoomState
state
);
/**
* @}
...
...
include/linphone/core.h
View file @
181bfa2e
...
...
@@ -185,7 +185,7 @@ typedef struct _LinphoneCoreVTable{
LinphoneCoreFriendListRemovedCb
friend_list_removed
;
LinphoneCoreCbsCallCreatedCb
call_created
;
LinphoneCoreCbsVersionUpdateCheckResultReceivedCb
version_update_check_result_received
;
LinphoneCoreCbsChatRoom
Instantiat
edCb
chat_room_
in
sta
ntiat
ed
;
LinphoneCoreCbsChatRoom
StateChang
edCb
chat_room_sta
te_chang
ed
;
LinphoneCoreCbsEcCalibrationResultCb
ec_calibration_result
;
LinphoneCoreCbsEcCalibrationAudioInitCb
ec_calibration_audio_init
;
LinphoneCoreCbsEcCalibrationAudioUninitCb
ec_calibration_audio_uninit
;
...
...
@@ -666,18 +666,18 @@ LINPHONE_PUBLIC void linphone_core_cbs_set_version_update_check_result_received(
LINPHONE_PUBLIC
LinphoneCoreCbsVersionUpdateCheckResultReceivedCb
linphone_core_cbs_get_version_update_check_result_received
(
LinphoneCoreCbs
*
cbs
);
/**
* Get the chat room
in
sta
ntiat
ed callback.
* Get the chat room sta
te chang
ed callback.
* @param[in] cbs LinphoneCoreCbs object
* @return The current callback
*/
LINPHONE_PUBLIC
LinphoneCoreCbsChatRoom
Instantiat
edCb
linphone_core_cbs_get_chat_room_
in
sta
ntiat
ed
(
LinphoneCoreCbs
*
cbs
);
LINPHONE_PUBLIC
LinphoneCoreCbsChatRoom
StateChang
edCb
linphone_core_cbs_get_chat_room_sta
te_chang
ed
(
LinphoneCoreCbs
*
cbs
);
/**
* Set the chat room
in
sta
ntiat
ed callback.
* Set the chat room sta
te chang
ed callback.
* @param[in] cbs LinphoneCoreCbs object
* @param[in] cb The callback to use
*/
LINPHONE_PUBLIC
void
linphone_core_cbs_set_chat_room_
in
sta
ntiat
ed
(
LinphoneCoreCbs
*
cbs
,
LinphoneCoreCbsChatRoom
Instantiat
edCb
cb
);
LINPHONE_PUBLIC
void
linphone_core_cbs_set_chat_room_sta
te_chang
ed
(
LinphoneCoreCbs
*
cbs
,
LinphoneCoreCbsChatRoom
StateChang
edCb
cb
);
/**
* @brief Sets a callback to call each time the echo-canceler calibration is completed.
...
...
src/chat/chat-room/chat-room.cpp
View file @
181bfa2e
...
...
@@ -57,12 +57,8 @@ void ChatRoomPrivate::release () {
// -----------------------------------------------------------------------------
void
ChatRoomPrivate
::
setState
(
ChatRoom
::
State
newState
)
{
L_Q
();
if
(
newState
!=
state
)
{
state
=
newState
;
if
(
state
==
ChatRoom
::
State
::
Created
)
// TODO : Rename from instatiated to created.
linphone_core_notify_chat_room_instantiated
(
q
->
getCore
()
->
getCCore
(),
L_GET_C_BACK_PTR
(
q
));
notifyStateChanged
();
}
}
...
...
@@ -272,6 +268,7 @@ void ChatRoomPrivate::notifyIsComposingReceived (const Address &remoteAddr, bool
void
ChatRoomPrivate
::
notifyStateChanged
()
{
L_Q
();
linphone_core_notify_chat_room_state_changed
(
q
->
getCore
()
->
getCCore
(),
L_GET_C_BACK_PTR
(
q
),
(
LinphoneChatRoomState
)
state
);
LinphoneChatRoom
*
cr
=
L_GET_C_BACK_PTR
(
q
);
LinphoneChatRoomCbs
*
cbs
=
linphone_chat_room_get_callbacks
(
cr
);
LinphoneChatRoomCbsStateChangedCb
cb
=
linphone_chat_room_cbs_get_state_changed
(
cbs
);
...
...
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