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
eb5ab273
Commit
eb5ab273
authored
Dec 04, 2017
by
Ronan
Browse files
fix(core): rename some methods => Do not set a plural noun before "Count"!!!
parent
181bfa2e
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
33 additions
and
33 deletions
+33
-33
coreapi/linphonecore_jni.cc
coreapi/linphonecore_jni.cc
+1
-1
java/common/org/linphone/core/LinphoneChatRoom.java
java/common/org/linphone/core/LinphoneChatRoom.java
+1
-1
java/impl/org/linphone/core/LinphoneChatRoomImpl.java
java/impl/org/linphone/core/LinphoneChatRoomImpl.java
+3
-3
src/c-wrapper/api/c-chat-room.cpp
src/c-wrapper/api/c-chat-room.cpp
+2
-2
src/chat/chat-room/chat-room.cpp
src/chat/chat-room/chat-room.cpp
+5
-5
src/chat/chat-room/chat-room.h
src/chat/chat-room/chat-room.h
+2
-2
src/db/main-db.cpp
src/db/main-db.cpp
+7
-7
src/db/main-db.h
src/db/main-db.h
+3
-3
tester/main-db-tester.cpp
tester/main-db-tester.cpp
+9
-9
No files found.
coreapi/linphonecore_jni.cc
View file @
eb5ab273
...
...
@@ -4497,7 +4497,7 @@ extern "C" jint Java_org_linphone_core_LinphoneChatRoomImpl_getHistorySize (JNI
,
jlong
ptr
)
{
return
(
jint
)
linphone_chat_room_get_history_size
((
LinphoneChatRoom
*
)
ptr
);
}
extern
"C"
jint
Java_org_linphone_core_LinphoneChatRoomImpl_getUnreadMessage
s
Count
(
JNIEnv
*
env
extern
"C"
jint
Java_org_linphone_core_LinphoneChatRoomImpl_getUnreadMessageCount
(
JNIEnv
*
env
,
jobject
thiz
,
jlong
ptr
)
{
return
(
jint
)
linphone_chat_room_get_unread_messages_count
((
LinphoneChatRoom
*
)
ptr
);
...
...
java/common/org/linphone/core/LinphoneChatRoom.java
View file @
eb5ab273
...
...
@@ -80,7 +80,7 @@ public interface LinphoneChatRoom {
* Returns the amount of unread messages associated with the peer of this chatRoom.
* @return the amount of unread messages
*/
int
getUnreadMessage
s
Count
();
int
getUnreadMessageCount
();
/**
* Returns the amount of messages associated with the peer of this chatRoom.
...
...
java/impl/org/linphone/core/LinphoneChatRoomImpl.java
View file @
eb5ab273
...
...
@@ -32,7 +32,7 @@ class LinphoneChatRoomImpl implements LinphoneChatRoom {
private
native
Object
[]
getHistoryRange
(
long
ptr
,
int
begin
,
int
end
);
private
native
Object
[]
getHistory
(
long
ptr
,
int
limit
);
private
native
void
destroy
(
long
ptr
);
private
native
int
getUnreadMessage
s
Count
(
long
ptr
);
private
native
int
getUnreadMessageCount
(
long
ptr
);
private
native
int
getHistorySize
(
long
ptr
);
private
native
void
deleteHistory
(
long
ptr
);
private
native
void
compose
(
long
ptr
);
...
...
@@ -101,9 +101,9 @@ class LinphoneChatRoomImpl implements LinphoneChatRoom {
}
}
public
int
getUnreadMessage
s
Count
()
{
public
int
getUnreadMessageCount
()
{
synchronized
(
getCore
()){
return
getUnreadMessage
s
Count
(
nativePtr
);
return
getUnreadMessageCount
(
nativePtr
);
}
}
...
...
src/c-wrapper/api/c-chat-room.cpp
View file @
eb5ab273
...
...
@@ -176,11 +176,11 @@ void linphone_chat_room_mark_as_read (LinphoneChatRoom *cr) {
}
int
linphone_chat_room_get_unread_messages_count
(
LinphoneChatRoom
*
cr
)
{
return
L_GET_CPP_PTR_FROM_C_OBJECT
(
cr
)
->
getUnreadChatMessage
s
Count
();
return
L_GET_CPP_PTR_FROM_C_OBJECT
(
cr
)
->
getUnreadChatMessageCount
();
}
int
linphone_chat_room_get_history_size
(
LinphoneChatRoom
*
cr
)
{
return
L_GET_CPP_PTR_FROM_C_OBJECT
(
cr
)
->
getChatMessage
s
Count
();
return
L_GET_CPP_PTR_FROM_C_OBJECT
(
cr
)
->
getChatMessageCount
();
}
void
linphone_chat_room_delete_message
(
LinphoneChatRoom
*
cr
,
LinphoneChatMessage
*
msg
)
{
...
...
src/chat/chat-room/chat-room.cpp
View file @
eb5ab273
...
...
@@ -362,12 +362,12 @@ void ChatRoom::deleteHistory () {
getCore
()
->
getPrivate
()
->
mainDb
->
cleanHistory
(
getChatRoomId
());
}
int
ChatRoom
::
getChatMessage
s
Count
()
{
return
getCore
()
->
getPrivate
()
->
mainDb
->
getChatMessage
s
Count
(
getChatRoomId
());
int
ChatRoom
::
getChatMessageCount
()
{
return
getCore
()
->
getPrivate
()
->
mainDb
->
getChatMessageCount
(
getChatRoomId
());
}
int
ChatRoom
::
getUnreadChatMessage
s
Count
()
{
return
getCore
()
->
getPrivate
()
->
mainDb
->
getUnreadChatMessage
s
Count
(
getChatRoomId
());
int
ChatRoom
::
getUnreadChatMessageCount
()
{
return
getCore
()
->
getPrivate
()
->
mainDb
->
getUnreadChatMessageCount
(
getChatRoomId
());
}
// -----------------------------------------------------------------------------
...
...
@@ -438,7 +438,7 @@ std::list<Address> ChatRoom::getComposingAddresses () const {
void
ChatRoom
::
markAsRead
()
{
L_D
();
if
(
getUnreadChatMessage
s
Count
()
==
0
)
if
(
getUnreadChatMessageCount
()
==
0
)
return
;
CorePrivate
*
dCore
=
getCore
()
->
getPrivate
();
...
...
src/chat/chat-room/chat-room.h
View file @
eb5ab273
...
...
@@ -68,8 +68,8 @@ public:
void
deleteHistory
();
int
getChatMessage
s
Count
();
int
getUnreadChatMessage
s
Count
();
int
getChatMessageCount
();
int
getUnreadChatMessageCount
();
// TODO: Remove useless functions.
void
compose
();
...
...
src/db/main-db.cpp
View file @
eb5ab273
...
...
@@ -1307,7 +1307,7 @@ MainDb::MainDb (const shared_ptr<Core> &core) : AbstractDb(*new MainDbPrivate),
return
false
;
}
int
MainDb
::
getEvent
s
Count
(
FilterMask
mask
)
const
{
int
MainDb
::
getEventCount
(
FilterMask
mask
)
const
{
L_D
();
if
(
!
isConnected
())
{
...
...
@@ -1441,7 +1441,7 @@ MainDb::MainDb (const shared_ptr<Core> &core) : AbstractDb(*new MainDbPrivate),
return
list
<
shared_ptr
<
EventLog
>>
();
}
int
MainDb
::
getChatMessage
s
Count
(
const
ChatRoomId
&
chatRoomId
)
const
{
int
MainDb
::
getChatMessageCount
(
const
ChatRoomId
&
chatRoomId
)
const
{
L_D
();
if
(
!
isConnected
())
{
...
...
@@ -1477,7 +1477,7 @@ MainDb::MainDb (const shared_ptr<Core> &core) : AbstractDb(*new MainDbPrivate),
return
count
;
}
int
MainDb
::
getUnreadChatMessage
s
Count
(
const
ChatRoomId
&
chatRoomId
)
const
{
int
MainDb
::
getUnreadChatMessageCount
(
const
ChatRoomId
&
chatRoomId
)
const
{
L_D
();
if
(
!
isConnected
())
{
...
...
@@ -1525,7 +1525,7 @@ MainDb::MainDb (const shared_ptr<Core> &core) : AbstractDb(*new MainDbPrivate),
return
;
}
if
(
getUnreadChatMessage
s
Count
(
chatRoomId
)
==
0
)
if
(
getUnreadChatMessageCount
(
chatRoomId
)
==
0
)
return
;
string
query
=
"UPDATE conference_chat_message_event"
...
...
@@ -2186,7 +2186,7 @@ MainDb::MainDb (const shared_ptr<Core> &core) : AbstractDb(*new MainDbPrivate),
return
false
;
}
int
MainDb
::
getEvent
s
Count
(
FilterMask
)
const
{
int
MainDb
::
getEventCount
(
FilterMask
)
const
{
return
0
;
}
...
...
@@ -2201,11 +2201,11 @@ MainDb::MainDb (const shared_ptr<Core> &core) : AbstractDb(*new MainDbPrivate),
return
list
<
shared_ptr
<
EventLog
>>
();
}
int
MainDb
::
getChatMessage
s
Count
(
const
ChatRoomId
&
)
const
{
int
MainDb
::
getChatMessageCount
(
const
ChatRoomId
&
)
const
{
return
0
;
}
int
MainDb
::
getUnreadChatMessage
s
Count
(
const
ChatRoomId
&
)
const
{
int
MainDb
::
getUnreadChatMessageCount
(
const
ChatRoomId
&
)
const
{
return
0
;
}
...
...
src/db/main-db.h
View file @
eb5ab273
...
...
@@ -60,7 +60,7 @@ public:
bool
addEvent
(
const
std
::
shared_ptr
<
EventLog
>
&
eventLog
);
bool
updateEvent
(
const
std
::
shared_ptr
<
EventLog
>
&
eventLog
);
static
bool
deleteEvent
(
const
std
::
shared_ptr
<
const
EventLog
>
&
eventLog
);
int
getEvent
s
Count
(
FilterMask
mask
=
NoFilter
)
const
;
int
getEventCount
(
FilterMask
mask
=
NoFilter
)
const
;
static
std
::
shared_ptr
<
EventLog
>
getEventFromKey
(
const
MainDbKey
&
dbKey
);
...
...
@@ -77,8 +77,8 @@ public:
// Conference chat message events.
// ---------------------------------------------------------------------------
int
getChatMessage
s
Count
(
const
ChatRoomId
&
chatRoomId
=
ChatRoomId
())
const
;
int
getUnreadChatMessage
s
Count
(
const
ChatRoomId
&
chatRoomId
=
ChatRoomId
())
const
;
int
getChatMessageCount
(
const
ChatRoomId
&
chatRoomId
=
ChatRoomId
())
const
;
int
getUnreadChatMessageCount
(
const
ChatRoomId
&
chatRoomId
=
ChatRoomId
())
const
;
void
markChatMessagesAsRead
(
const
ChatRoomId
&
chatRoomId
=
ChatRoomId
())
const
;
std
::
list
<
std
::
shared_ptr
<
ChatMessage
>>
getUnreadChatMessages
(
const
ChatRoomId
&
chatRoomId
=
ChatRoomId
())
const
;
...
...
tester/main-db-tester.cpp
View file @
eb5ab273
...
...
@@ -73,19 +73,19 @@ static void open_database () {
static
void
get_events_count
()
{
MainDbProvider
provider
;
const
MainDb
&
mainDb
=
provider
.
getMainDb
();
BC_ASSERT_EQUAL
(
mainDb
.
getEvent
s
Count
(),
5175
,
int
,
"%d"
);
BC_ASSERT_EQUAL
(
mainDb
.
getEvent
s
Count
(
MainDb
::
ConferenceCallFilter
),
0
,
int
,
"%d"
);
BC_ASSERT_EQUAL
(
mainDb
.
getEvent
s
Count
(
MainDb
::
ConferenceInfoFilter
),
18
,
int
,
"%d"
);
BC_ASSERT_EQUAL
(
mainDb
.
getEvent
s
Count
(
MainDb
::
ConferenceChatMessageFilter
),
5157
,
int
,
"%d"
);
BC_ASSERT_EQUAL
(
mainDb
.
getEvent
s
Count
(
MainDb
::
NoFilter
),
5175
,
int
,
"%d"
);
BC_ASSERT_EQUAL
(
mainDb
.
getEventCount
(),
5175
,
int
,
"%d"
);
BC_ASSERT_EQUAL
(
mainDb
.
getEventCount
(
MainDb
::
ConferenceCallFilter
),
0
,
int
,
"%d"
);
BC_ASSERT_EQUAL
(
mainDb
.
getEventCount
(
MainDb
::
ConferenceInfoFilter
),
18
,
int
,
"%d"
);
BC_ASSERT_EQUAL
(
mainDb
.
getEventCount
(
MainDb
::
ConferenceChatMessageFilter
),
5157
,
int
,
"%d"
);
BC_ASSERT_EQUAL
(
mainDb
.
getEventCount
(
MainDb
::
NoFilter
),
5175
,
int
,
"%d"
);
}
static
void
get_messages_count
()
{
MainDbProvider
provider
;
const
MainDb
&
mainDb
=
provider
.
getMainDb
();
BC_ASSERT_EQUAL
(
mainDb
.
getChatMessage
s
Count
(),
5157
,
int
,
"%d"
);
BC_ASSERT_EQUAL
(
mainDb
.
getChatMessageCount
(),
5157
,
int
,
"%d"
);
BC_ASSERT_EQUAL
(
mainDb
.
getChatMessage
s
Count
(
mainDb
.
getChatMessageCount
(
ChatRoomId
(
IdentityAddress
(
"sip:test-3@sip.linphone.org"
),
IdentityAddress
(
"sip:test-1@sip.linphone.org"
))
),
861
,
int
,
"%d"
...
...
@@ -95,9 +95,9 @@ static void get_messages_count () {
static
void
get_unread_messages_count
()
{
MainDbProvider
provider
;
const
MainDb
&
mainDb
=
provider
.
getMainDb
();
BC_ASSERT_EQUAL
(
mainDb
.
getUnreadChatMessage
s
Count
(),
2
,
int
,
"%d"
);
BC_ASSERT_EQUAL
(
mainDb
.
getUnreadChatMessageCount
(),
2
,
int
,
"%d"
);
BC_ASSERT_EQUAL
(
mainDb
.
getUnreadChatMessage
s
Count
(
mainDb
.
getUnreadChatMessageCount
(
ChatRoomId
(
IdentityAddress
(
"sip:test-3@sip.linphone.org"
),
IdentityAddress
(
"sip:test-1@sip.linphone.org"
))
),
0
,
int
,
"%d"
...
...
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