From d1c80c1ec9ded9b524527bbe055c5a07b8e33b7d Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Thu, 12 Oct 2017 12:00:45 +0200 Subject: [PATCH] fix(ChatRoom): remove useless includes --- src/chat/chat-room/basic-chat-room-p.h | 3 --- src/chat/chat-room/chat-room-p.h | 21 +++++++------------ src/chat/chat-room/chat-room.cpp | 8 +------ src/chat/chat-room/chat-room.h | 20 +++++------------- src/chat/chat-room/client-group-chat-room-p.h | 7 +------ src/chat/chat-room/client-group-chat-room.cpp | 6 +----- src/chat/chat-room/client-group-chat-room.h | 6 ------ .../chat-room/real-time-text-chat-room-p.h | 10 ++++----- .../chat-room/real-time-text-chat-room.cpp | 8 ++----- src/chat/chat-room/real-time-text-chat-room.h | 5 ----- .../multipart-chat-message-modifier.cpp | 3 +++ tester/cpim-tester.cpp | 3 ++- tester/multipart-tester.cpp | 3 ++- 13 files changed, 30 insertions(+), 73 deletions(-) diff --git a/src/chat/chat-room/basic-chat-room-p.h b/src/chat/chat-room/basic-chat-room-p.h index 698996b18..12b4b986b 100644 --- a/src/chat/chat-room/basic-chat-room-p.h +++ b/src/chat/chat-room/basic-chat-room-p.h @@ -20,9 +20,6 @@ #ifndef _BASIC_CHAT_ROOM_P_H_ #define _BASIC_CHAT_ROOM_P_H_ -// From coreapi. -#include "private.h" - #include "basic-chat-room.h" #include "chat/chat-room/chat-room-p.h" diff --git a/src/chat/chat-room/chat-room-p.h b/src/chat/chat-room/chat-room-p.h index e07889fe3..ee72788d5 100644 --- a/src/chat/chat-room/chat-room-p.h +++ b/src/chat/chat-room/chat-room-p.h @@ -20,15 +20,8 @@ #ifndef _CHAT_ROOM_P_H_ #define _CHAT_ROOM_P_H_ -#include "linphone/enums/chat-room-enums.h" -#include "linphone/utils/enum-generator.h" - -// From coreapi. -#include "private.h" - -#include "chat-room.h" -#include "chat/is-composing-listener.h" #include "chat/is-composing.h" +#include "chat-room.h" #include "object/object-p.h" // ============================================================================= @@ -37,6 +30,7 @@ LINPHONE_BEGIN_NAMESPACE class ChatRoomPrivate : public ObjectPrivate, public IsComposingListener { friend class ChatMessagePrivate; + public: ChatRoomPrivate (LinphoneCore *core); virtual ~ChatRoomPrivate (); @@ -47,9 +41,10 @@ private: public: void addTransientMessage (const std::shared_ptr &msg); void addWeakMessage (const std::shared_ptr &msg); - std::list > getTransientMessages () const { + std::list> getTransientMessages () const { return transientMessages; } + void moveTransientMessageToWeakMessages (const std::shared_ptr &msg); void removeTransientMessage (const std::shared_ptr &msg); @@ -69,7 +64,7 @@ protected: std::shared_ptr getWeakMessage (unsigned int storageId) const; int sqlRequest (sqlite3 *db, const std::string &stmt); void sqlRequestMessage (sqlite3 *db, const std::string &stmt); - std::list > findMessages (const std::string &messageId); + std::list> findMessages (const std::string &messageId); void storeOrUpdateMessage (const std::shared_ptr &msg); public: @@ -100,9 +95,9 @@ public: int unreadCount = -1; bool isComposing = false; bool remoteIsComposing = false; - std::list > messages; - std::list > transientMessages; - std::list > weakMessages; + std::list> messages; + std::list> transientMessages; + std::list> weakMessages; std::list receivedRttCharacters; std::shared_ptr pendingMessage = nullptr; IsComposing isComposingHandler; diff --git a/src/chat/chat-room/chat-room.cpp b/src/chat/chat-room/chat-room.cpp index 2e759970d..f12b60850 100644 --- a/src/chat/chat-room/chat-room.cpp +++ b/src/chat/chat-room/chat-room.cpp @@ -19,16 +19,10 @@ #include -#include "linphone/api/c-chat-message.h" -#include "linphone/utils/utils.h" - #include "c-wrapper/c-wrapper.h" +#include "chat/chat-message/chat-message-p.h" #include "chat/chat-room/chat-room-p.h" #include "chat/imdn.h" -#include "content/content.h" -#include "chat/chat-message/chat-message-p.h" -#include "chat-room.h" -#include "sal/message-op.h" #include "logger/logger.h" // ============================================================================= diff --git a/src/chat/chat-room/chat-room.h b/src/chat/chat-room/chat-room.h index 84c48911d..d09203199 100644 --- a/src/chat/chat-room/chat-room.h +++ b/src/chat/chat-room/chat-room.h @@ -20,18 +20,8 @@ #ifndef _CHAT_ROOM_H_ #define _CHAT_ROOM_H_ -#include - -// From coreapi -#include "private.h" - -#include "address/address.h" -#include "object/object.h" -#include "conference/conference-interface.h" - #include "chat/chat-message/chat-message.h" - -#include "linphone/types.h" +#include "conference/conference-interface.h" // ============================================================================= @@ -60,18 +50,18 @@ public: std::shared_ptr createMessage (); void deleteHistory (); void deleteMessage (const std::shared_ptr &msg); - std::shared_ptr findMessage (const std::string& messageId); + std::shared_ptr findMessage (const std::string &messageId); std::shared_ptr findMessageWithDirection (const std::string &messageId, ChatMessage::Direction direction); - std::list > getHistory (int nbMessages); + std::list> getHistory (int nbMessages); int getHistorySize (); - std::list > getHistoryRange (int startm, int endm); + std::list> getHistoryRange (int startm, int endm); int getUnreadMessagesCount (); bool isRemoteComposing () const; void markAsRead (); LinphoneCore *getCore () const; - const Address& getPeerAddress () const; + const Address &getPeerAddress () const; State getState () const; protected: diff --git a/src/chat/chat-room/client-group-chat-room-p.h b/src/chat/chat-room/client-group-chat-room-p.h index 4b8885e85..ef874027d 100644 --- a/src/chat/chat-room/client-group-chat-room-p.h +++ b/src/chat/chat-room/client-group-chat-room-p.h @@ -20,18 +20,13 @@ #ifndef _CLIENT_GROUP_CHAT_ROOM_P_H_ #define _CLIENT_GROUP_CHAT_ROOM_P_H_ -// From coreapi. -#include "private.h" - -#include "client-group-chat-room.h" #include "chat/chat-room/chat-room-p.h" +#include "client-group-chat-room.h" // ============================================================================= LINPHONE_BEGIN_NAMESPACE -class CallSession; - class ClientGroupChatRoomPrivate : public ChatRoomPrivate { public: ClientGroupChatRoomPrivate (LinphoneCore *core); diff --git a/src/chat/chat-room/client-group-chat-room.cpp b/src/chat/chat-room/client-group-chat-room.cpp index a32d9b094..a1de405f0 100644 --- a/src/chat/chat-room/client-group-chat-room.cpp +++ b/src/chat/chat-room/client-group-chat-room.cpp @@ -22,11 +22,8 @@ #include "address/address-p.h" #include "client-group-chat-room-p.h" #include "c-wrapper/c-wrapper.h" -#include "conference/params/call-session-params-p.h" #include "conference/session/call-session-p.h" #include "conference/participant-p.h" -#include "content/content.h" -#include "hacks/hacks.h" #include "logger/logger.h" #include "sal/refer-op.h" @@ -36,8 +33,7 @@ using namespace std; LINPHONE_BEGIN_NAMESPACE -ClientGroupChatRoomPrivate::ClientGroupChatRoomPrivate (LinphoneCore *core) - : ChatRoomPrivate(core) {} +ClientGroupChatRoomPrivate::ClientGroupChatRoomPrivate (LinphoneCore *core) : ChatRoomPrivate(core) {} // ----------------------------------------------------------------------------- diff --git a/src/chat/chat-room/client-group-chat-room.h b/src/chat/chat-room/client-group-chat-room.h index 5801d3ffb..b97156cd2 100644 --- a/src/chat/chat-room/client-group-chat-room.h +++ b/src/chat/chat-room/client-group-chat-room.h @@ -20,14 +20,8 @@ #ifndef _CLIENT_GROUP_CHAT_ROOM_H_ #define _CLIENT_GROUP_CHAT_ROOM_H_ -// From coreapi -#include "private.h" - #include "chat/chat-room/chat-room.h" #include "conference/remote-conference.h" -#include "conference/session/call-session.h" - -#include "linphone/types.h" // ============================================================================= diff --git a/src/chat/chat-room/real-time-text-chat-room-p.h b/src/chat/chat-room/real-time-text-chat-room-p.h index f70a16f2d..e99f3b8ad 100644 --- a/src/chat/chat-room/real-time-text-chat-room-p.h +++ b/src/chat/chat-room/real-time-text-chat-room-p.h @@ -20,11 +20,8 @@ #ifndef _REAL_TIME_TEXT_CHAT_ROOM_P_H_ #define _REAL_TIME_TEXT_CHAT_ROOM_P_H_ -// From coreapi. -#include "private.h" - -#include "chat/chat-room/real-time-text-chat-room.h" #include "chat/chat-room/chat-room-p.h" +#include "chat/chat-room/real-time-text-chat-room.h" // ============================================================================= @@ -36,7 +33,10 @@ public: virtual ~RealTimeTextChatRoomPrivate (); public: - void setCall (LinphoneCall *call) { this->call = call; } + void setCall (LinphoneCall *call) { + this->call = call; + } + void realtimeTextReceived (uint32_t character, LinphoneCall *call); void sendMessage (const std::shared_ptr &msg) override; diff --git a/src/chat/chat-room/real-time-text-chat-room.cpp b/src/chat/chat-room/real-time-text-chat-room.cpp index 212fc9d19..1aa4a4693 100644 --- a/src/chat/chat-room/real-time-text-chat-room.cpp +++ b/src/chat/chat-room/real-time-text-chat-room.cpp @@ -17,14 +17,10 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -#include - -#include "linphone/utils/utils.h" - -#include "real-time-text-chat-room-p.h" -#include "chat/chat-message/chat-message-p.h" #include "c-wrapper/c-wrapper.h" +#include "chat/chat-message/chat-message-p.h" #include "logger/logger.h" +#include "real-time-text-chat-room-p.h" // ============================================================================= diff --git a/src/chat/chat-room/real-time-text-chat-room.h b/src/chat/chat-room/real-time-text-chat-room.h index 0dc3f6482..e8d7c919f 100644 --- a/src/chat/chat-room/real-time-text-chat-room.h +++ b/src/chat/chat-room/real-time-text-chat-room.h @@ -20,13 +20,8 @@ #ifndef _REAL_TIME_TEXT_CHAT_ROOM_H_ #define _REAL_TIME_TEXT_CHAT_ROOM_H_ -// From coreapi -#include "private.h" - #include "chat/chat-room/chat-room.h" -#include "linphone/types.h" - // ============================================================================= LINPHONE_BEGIN_NAMESPACE diff --git a/src/chat/modifier/multipart-chat-message-modifier.cpp b/src/chat/modifier/multipart-chat-message-modifier.cpp index e9c2cd2c3..10eb02133 100644 --- a/src/chat/modifier/multipart-chat-message-modifier.cpp +++ b/src/chat/modifier/multipart-chat-message-modifier.cpp @@ -17,6 +17,9 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ +// TODO: Remove me later. +#include "private.h" + #include "address/address.h" #include "chat/chat-message/chat-message.h" #include "chat/chat-room/chat-room.h" diff --git a/tester/cpim-tester.cpp b/tester/cpim-tester.cpp index 26e9a5a4d..2b486a58f 100644 --- a/tester/cpim-tester.cpp +++ b/tester/cpim-tester.cpp @@ -17,10 +17,11 @@ */ #include "address/address.h" -#include "chat/chat-room/basic-chat-room.h" #include "chat/chat-message/chat-message.h" +#include "chat/chat-room/basic-chat-room.h" #include "chat/cpim/cpim.h" #include "content/content-type.h" +#include "content/content.h" #include "liblinphone_tester.h" diff --git a/tester/multipart-tester.cpp b/tester/multipart-tester.cpp index b40687c25..29a6544cb 100644 --- a/tester/multipart-tester.cpp +++ b/tester/multipart-tester.cpp @@ -17,9 +17,10 @@ */ #include "address/address.h" -#include "chat/chat-room/basic-chat-room.h" #include "chat/chat-message/chat-message.h" +#include "chat/chat-room/basic-chat-room.h" #include "content/content-type.h" +#include "content/content.h" #include "liblinphone_tester.h"