Commit eb5ab273 authored by Ronan's avatar Ronan

fix(core): rename some methods => Do not set a plural noun before "Count"!!!

parent 181bfa2e
......@@ -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_getUnreadMessagesCount(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);
......
......@@ -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 getUnreadMessagesCount();
int getUnreadMessageCount();
/**
* Returns the amount of messages associated with the peer of this chatRoom.
......
......@@ -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 getUnreadMessagesCount(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 getUnreadMessagesCount() {
public int getUnreadMessageCount() {
synchronized(getCore()){
return getUnreadMessagesCount(nativePtr);
return getUnreadMessageCount(nativePtr);
}
}
......
......@@ -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)->getUnreadChatMessagesCount();
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)->getChatMessagesCount();
return L_GET_CPP_PTR_FROM_C_OBJECT(cr)->getChatMessageCount();
}
void linphone_chat_room_delete_message (LinphoneChatRoom *cr, LinphoneChatMessage *msg) {
......
......@@ -362,12 +362,12 @@ void ChatRoom::deleteHistory () {
getCore()->getPrivate()->mainDb->cleanHistory(getChatRoomId());
}
int ChatRoom::getChatMessagesCount () {
return getCore()->getPrivate()->mainDb->getChatMessagesCount(getChatRoomId());
int ChatRoom::getChatMessageCount () {
return getCore()->getPrivate()->mainDb->getChatMessageCount(getChatRoomId());
}
int ChatRoom::getUnreadChatMessagesCount () {
return getCore()->getPrivate()->mainDb->getUnreadChatMessagesCount(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 (getUnreadChatMessagesCount() == 0)
if (getUnreadChatMessageCount() == 0)
return;
CorePrivate *dCore = getCore()->getPrivate();
......
......@@ -68,8 +68,8 @@ public:
void deleteHistory ();
int getChatMessagesCount ();
int getUnreadChatMessagesCount ();
int getChatMessageCount ();
int getUnreadChatMessageCount ();
// TODO: Remove useless functions.
void compose ();
......
......@@ -1307,7 +1307,7 @@ MainDb::MainDb (const shared_ptr<Core> &core) : AbstractDb(*new MainDbPrivate),
return false;
}
int MainDb::getEventsCount (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::getChatMessagesCount (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::getUnreadChatMessagesCount (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 (getUnreadChatMessagesCount(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::getEventsCount (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::getChatMessagesCount (const ChatRoomId &) const {
int MainDb::getChatMessageCount (const ChatRoomId &) const {
return 0;
}
int MainDb::getUnreadChatMessagesCount (const ChatRoomId &) const {
int MainDb::getUnreadChatMessageCount (const ChatRoomId &) const {
return 0;
}
......
......@@ -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 getEventsCount (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 getChatMessagesCount (const ChatRoomId &chatRoomId = ChatRoomId()) const;
int getUnreadChatMessagesCount (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;
......
......@@ -73,19 +73,19 @@ static void open_database () {
static void get_events_count () {
MainDbProvider provider;
const MainDb &mainDb = provider.getMainDb();
BC_ASSERT_EQUAL(mainDb.getEventsCount(), 5175, int, "%d");
BC_ASSERT_EQUAL(mainDb.getEventsCount(MainDb::ConferenceCallFilter), 0, int, "%d");
BC_ASSERT_EQUAL(mainDb.getEventsCount(MainDb::ConferenceInfoFilter), 18, int, "%d");
BC_ASSERT_EQUAL(mainDb.getEventsCount(MainDb::ConferenceChatMessageFilter), 5157, int, "%d");
BC_ASSERT_EQUAL(mainDb.getEventsCount(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.getChatMessagesCount(), 5157, int, "%d");
BC_ASSERT_EQUAL(mainDb.getChatMessageCount(), 5157, int, "%d");
BC_ASSERT_EQUAL(
mainDb.getChatMessagesCount(
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.getUnreadChatMessagesCount(), 2, int, "%d");
BC_ASSERT_EQUAL(mainDb.getUnreadChatMessageCount(), 2, int, "%d");
BC_ASSERT_EQUAL(
mainDb.getUnreadChatMessagesCount(
mainDb.getUnreadChatMessageCount(
ChatRoomId(IdentityAddress("sip:test-3@sip.linphone.org"), IdentityAddress("sip:test-1@sip.linphone.org"))
),
0, int, "%d"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment