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
d111d78f
Commit
d111d78f
authored
Nov 30, 2017
by
Ronan
Browse files
feat(core-c): provide a way to find chat room
parent
af709ad4
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
32 additions
and
20 deletions
+32
-20
coreapi/chat.c
coreapi/chat.c
+11
-0
coreapi/tester_utils.cpp
coreapi/tester_utils.cpp
+0
-11
coreapi/tester_utils.h
coreapi/tester_utils.h
+0
-2
include/linphone/core.h
include/linphone/core.h
+19
-5
src/db/abstract/abstract-db.cpp
src/db/abstract/abstract-db.cpp
+2
-2
No files found.
coreapi/chat.c
View file @
d111d78f
...
...
@@ -104,6 +104,17 @@ LinphoneChatRoom *linphone_core_get_chat_room_from_uri(LinphoneCore *lc, const c
return
L_GET_C_BACK_PTR
(
lc
->
cppCore
->
getOrCreateBasicChatRoomFromUri
(
L_C_TO_STRING
(
to
)));
}
LinphoneChatRoom
*
linphone_core_find_chat_room
(
const
LinphoneCore
*
lc
,
const
LinphoneAddress
*
peerAddr
,
const
LinphoneAddress
*
localAddr
)
{
return
L_GET_C_BACK_PTR
(
lc
->
cppCore
->
findChatRoom
(
LinphonePrivate
::
ChatRoomId
(
LinphonePrivate
::
IdentityAddress
(
*
L_GET_CPP_PTR_FROM_C_OBJECT
(
peerAddr
)),
LinphonePrivate
::
IdentityAddress
(
*
L_GET_CPP_PTR_FROM_C_OBJECT
(
localAddr
))
)));
}
int
linphone_core_message_received
(
LinphoneCore
*
lc
,
LinphonePrivate
::
SalOp
*
op
,
const
SalMessage
*
sal_msg
)
{
LinphoneReason
reason
=
LinphoneReasonNotAcceptable
;
const
char
*
peerAddress
;
...
...
coreapi/tester_utils.cpp
View file @
d111d78f
...
...
@@ -56,17 +56,6 @@ bctbx_list_t **linphone_core_get_call_logs_attribute(LinphoneCore *lc) {
return
&
lc
->
call_logs
;
}
LinphoneChatRoom
*
linphone_core_find_chat_room
(
const
LinphoneCore
*
lc
,
const
LinphoneAddress
*
peerAddr
,
const
LinphoneAddress
*
localAddr
)
{
shared_ptr
<
ChatRoom
>
chatRoom
=
lc
->
cppCore
->
findChatRoom
(
ChatRoomId
(
IdentityAddress
(
*
L_GET_CPP_PTR_FROM_C_OBJECT
(
peerAddr
)),
IdentityAddress
(
*
L_GET_CPP_PTR_FROM_C_OBJECT
(
localAddr
))
));
if
(
chatRoom
)
return
L_GET_C_BACK_PTR
(
chatRoom
);
return
nullptr
;
}
void
linphone_core_cbs_set_auth_info_requested
(
LinphoneCoreCbs
*
cbs
,
LinphoneCoreAuthInfoRequestedCb
cb
)
{
cbs
->
vtable
->
auth_info_requested
=
cb
;
}
...
...
coreapi/tester_utils.h
View file @
d111d78f
...
...
@@ -93,8 +93,6 @@ LINPHONE_PUBLIC mblk_t *_linphone_call_stats_get_received_rtcp (const LinphoneCa
LINPHONE_PUBLIC
LinphoneQualityReporting
*
linphone_call_log_get_quality_reporting
(
LinphoneCallLog
*
call_log
);
LINPHONE_PUBLIC
reporting_session_report_t
**
linphone_quality_reporting_get_reports
(
LinphoneQualityReporting
*
qreporting
);
LINPHONE_PUBLIC
LinphoneChatRoom
*
linphone_core_find_chat_room
(
const
LinphoneCore
*
lc
,
const
LinphoneAddress
*
peerAddr
,
const
LinphoneAddress
*
localAddr
);
LINPHONE_PUBLIC
MSList
*
linphone_core_fetch_friends_from_db
(
LinphoneCore
*
lc
,
LinphoneFriendList
*
list
);
LINPHONE_PUBLIC
MSList
*
linphone_core_fetch_friends_lists_from_db
(
LinphoneCore
*
lc
);
LINPHONE_PUBLIC
void
linphone_friend_invalidate_subscription
(
LinphoneFriend
*
lf
);
...
...
include/linphone/core.h
View file @
d111d78f
...
...
@@ -3448,7 +3448,7 @@ LINPHONE_PUBLIC void linphone_core_set_preview_video_definition(LinphoneCore *lc
/**
* @biref Sets the video size for the captured (preview) video.
*
*
* This method is for advanced usage where a video capture must be set independently of the size of the stream actually sent through the call.
* This allows for example to have the preview window with HD resolution even if due to bandwidth constraint the sent video size is small.
* Using this feature increases the CPU consumption, since a rescaling will be done internally.
...
...
@@ -3501,7 +3501,7 @@ LINPHONE_PUBLIC LinphoneVideoDefinition * linphone_core_get_current_preview_vide
/**
* @brief Returns the effective video size for the captured video as provided by the camera.
*
*
* When preview is disabled or not yet started, this function returns a zeroed video size.
* @see #linphone_core_set_preview_video_size()
* @ingroup media_parameters
...
...
@@ -4725,7 +4725,7 @@ LINPHONE_PUBLIC bool_t linphone_core_video_multicast_enabled(const LinphoneCore
/**
* @brief Set the network simulator parameters.
*
*
* Liblinphone has the capabability of simulating the effects of a network (latency, lost packets, jitter, max bandwidth).
* Please refer to the oRTP documentation for the meaning of the parameters of the OrtpNetworkSimulatorParams structure.
* This function has effect for future calls, but not for currently running calls, though this behavior may be changed in future versions.
...
...
@@ -4941,7 +4941,7 @@ LINPHONE_PUBLIC const char *linphone_core_get_chat_database_path(const LinphoneC
LINPHONE_PUBLIC
LinphoneChatRoom
*
linphone_core_create_client_group_chat_room
(
LinphoneCore
*
lc
,
const
char
*
subject
);
/**
* Get a chat room whose peer is the supplied address. If it does not exist yet, it will be created.
* Get a
basic
chat room whose peer is the supplied address. If it does not exist yet, it will be created.
* No reference is transfered to the application. The LinphoneCore keeps a reference on the chat room.
* @param lc the linphone core
* @param addr a linphone address.
...
...
@@ -4950,7 +4950,7 @@ LINPHONE_PUBLIC LinphoneChatRoom * linphone_core_create_client_group_chat_room(L
LINPHONE_PUBLIC
LinphoneChatRoom
*
linphone_core_get_chat_room
(
LinphoneCore
*
lc
,
const
LinphoneAddress
*
addr
);
/**
* Get a chat room for messaging from a sip uri like sip:joe@sip.linphone.org. If it does not exist yet, it will be created.
* Get a
basic
chat room for messaging from a sip uri like sip:joe@sip.linphone.org. If it does not exist yet, it will be created.
* No reference is transfered to the application. The LinphoneCore keeps a reference on the chat room.
* @param lc A #LinphoneCore object
* @param to The destination address for messages.
...
...
@@ -4958,6 +4958,20 @@ LINPHONE_PUBLIC LinphoneChatRoom *linphone_core_get_chat_room(LinphoneCore *lc,
**/
LINPHONE_PUBLIC
LinphoneChatRoom
*
linphone_core_get_chat_room_from_uri
(
LinphoneCore
*
lc
,
const
char
*
to
);
/**
* Find a chat room.
* No reference is transfered to the application. The LinphoneCore keeps a reference on the chat room.
* @param lc the linphone core
* @param peerAddr a linphone address.
* @param localAddr a linphone address.
* @return #LinphoneChatRoom where messaging can take place.
**/
LINPHONE_PUBLIC
LinphoneChatRoom
*
linphone_core_find_chat_room
(
const
LinphoneCore
*
lc
,
const
LinphoneAddress
*
peerAddr
,
const
LinphoneAddress
*
localAddr
);
/**
* Removes a chatroom including all message history from the LinphoneCore.
* @param lc A #LinphoneCore object
...
...
src/db/abstract/abstract-db.cpp
View file @
d111d78f
...
...
@@ -52,8 +52,8 @@ bool AbstractDb::connect (Backend backend, const string ¶meters) {
d
->
backend
=
backend
;
d
->
dbSession
=
DbSessionProvider
::
getInstance
()
->
getSession
(
(
backend
==
Mysql
?
"mysql://"
:
"sqlite3://"
)
+
parameters
);
(
backend
==
Mysql
?
"mysql://"
:
"sqlite3://"
)
+
parameters
);
if
(
d
->
dbSession
)
{
try
{
...
...
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