Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linphone
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
7
Issues
7
List
Board
Labels
Milestones
Merge Requests
9
Merge Requests
9
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
External Wiki
External Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
BC
public
linphone
Commits
6e786d69
Commit
6e786d69
authored
Jun 21, 2019
by
Sylvain Berfini
🎩
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added ChatRoom::isEmpty method
parent
f83c0538
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
23 additions
and
3 deletions
+23
-3
c-chat-room.h
include/linphone/api/c-chat-room.h
+7
-0
c-chat-room.cpp
src/c-wrapper/api/c-chat-room.cpp
+4
-0
abstract-chat-room.h
src/chat/chat-room/abstract-chat-room.h
+1
-1
chat-room.cpp
src/chat/chat-room/chat-room.cpp
+4
-0
chat-room.h
src/chat/chat-room/chat-room.h
+1
-1
proxy-chat-room.cpp
src/chat/chat-room/proxy-chat-room.cpp
+5
-0
proxy-chat-room.h
src/chat/chat-room/proxy-chat-room.h
+1
-1
No files found.
include/linphone/api/c-chat-room.h
View file @
6e786d69
...
...
@@ -169,6 +169,13 @@ LINPHONE_PUBLIC void linphone_chat_room_delete_history(LinphoneChatRoom *cr);
*/
LINPHONE_PUBLIC
int
linphone_chat_room_get_history_size
(
LinphoneChatRoom
*
cr
);
/**
* Returns whether or not a #LinphoneChatRoom has at least one #LinphoneChatMessage or not.
* @param[in] cr The #LinphoneChatRoom object corresponding to the conversation
* @return true if there are no #LinphoneChatMessage, false otherwise.
*/
LINPHONE_PUBLIC
bool_t
linphone_chat_room_is_empty
(
LinphoneChatRoom
*
cr
);
/**
* Gets nb_message most recent messages from cr chat room, sorted from oldest to most recent.
* @param[in] cr The #LinphoneChatRoom object corresponding to the conversation for which messages should be retrieved
...
...
src/c-wrapper/api/c-chat-room.cpp
View file @
6e786d69
...
...
@@ -208,6 +208,10 @@ int linphone_chat_room_get_history_size (LinphoneChatRoom *cr) {
return
L_GET_CPP_PTR_FROM_C_OBJECT
(
cr
)
->
getChatMessageCount
();
}
bool_t
linphone_chat_room_is_empty
(
LinphoneChatRoom
*
cr
)
{
return
(
bool_t
)
L_GET_CPP_PTR_FROM_C_OBJECT
(
cr
)
->
isEmpty
();
}
void
linphone_chat_room_delete_message
(
LinphoneChatRoom
*
cr
,
LinphoneChatMessage
*
msg
)
{
shared_ptr
<
LinphonePrivate
::
EventLog
>
event
=
LinphonePrivate
::
MainDb
::
getEventFromKey
(
L_GET_PRIVATE_FROM_C_OBJECT
(
msg
)
->
dbKey
...
...
src/chat/chat-room/abstract-chat-room.h
View file @
6e786d69
...
...
@@ -81,7 +81,7 @@ public:
virtual
void
deleteHistory
()
=
0
;
virtual
std
::
shared_ptr
<
ChatMessage
>
getLastChatMessageInHistory
()
const
=
0
;
virtual
bool
isEmpty
()
const
=
0
;
virtual
int
getChatMessageCount
()
const
=
0
;
virtual
int
getUnreadChatMessageCount
()
const
=
0
;
...
...
src/chat/chat-room/chat-room.cpp
View file @
6e786d69
...
...
@@ -464,6 +464,10 @@ shared_ptr<ChatMessage> ChatRoom::getLastChatMessageInHistory () const {
return
getCore
()
->
getPrivate
()
->
mainDb
->
getLastChatMessage
(
getConferenceId
());
}
bool
ChatRoom
::
isEmpty
()
const
{
return
getCore
()
->
getPrivate
()
->
mainDb
->
getLastChatMessage
(
getConferenceId
())
==
nullptr
;
}
int
ChatRoom
::
getChatMessageCount
()
const
{
return
getCore
()
->
getPrivate
()
->
mainDb
->
getChatMessageCount
(
getConferenceId
());
}
...
...
src/chat/chat-room/chat-room.h
View file @
6e786d69
...
...
@@ -61,7 +61,7 @@ public:
void
deleteHistory
()
override
;
std
::
shared_ptr
<
ChatMessage
>
getLastChatMessageInHistory
()
const
override
;
bool
isEmpty
()
const
override
;
int
getChatMessageCount
()
const
override
;
int
getUnreadChatMessageCount
()
const
override
;
...
...
src/chat/chat-room/proxy-chat-room.cpp
View file @
6e786d69
...
...
@@ -140,6 +140,11 @@ shared_ptr<ChatMessage> ProxyChatRoom::getLastChatMessageInHistory () const {
return
d
->
chatRoom
->
getLastChatMessageInHistory
();
}
bool
ProxyChatRoom
::
isEmpty
()
const
{
L_D
();
return
d
->
chatRoom
->
isEmpty
();
}
int
ProxyChatRoom
::
getChatMessageCount
()
const
{
L_D
();
return
d
->
chatRoom
->
getChatMessageCount
();
...
...
src/chat/chat-room/proxy-chat-room.h
View file @
6e786d69
...
...
@@ -56,7 +56,7 @@ public:
void
deleteHistory
()
override
;
std
::
shared_ptr
<
ChatMessage
>
getLastChatMessageInHistory
()
const
override
;
bool
isEmpty
()
const
override
;
int
getChatMessageCount
()
const
override
;
int
getUnreadChatMessageCount
()
const
override
;
...
...
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