diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index e656f4111..024d0cb6f 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -47,6 +47,9 @@ set(LINPHONE_CXX_OBJECTS_PRIVATE_HEADER_FILES chat/is-composing.h chat/real-time-text-chat-room-p.h chat/real-time-text-chat-room.h + chat/modifier/chat-message-modifier.h + chat/modifier/multipart-chat-message-modifier.h + chat/modifier/cpim-chat-message-modifier.h conference/conference-listener.h conference/conference-p.h conference/conference.h @@ -111,6 +114,8 @@ set(LINPHONE_CXX_OBJECTS_SOURCE_FILES chat/imdn.cpp chat/is-composing.cpp chat/real-time-text-chat-room.cpp + chat/modifier/multipart-chat-message-modifier.cpp + chat/modifier/cpim-chat-message-modifier.cpp conference/conference.cpp conference/local-conference.cpp conference/params/call-session-params.cpp diff --git a/src/chat/chat-message.cpp b/src/chat/chat-message.cpp index 1e6a987ad..f4cae49b0 100644 --- a/src/chat/chat-message.cpp +++ b/src/chat/chat-message.cpp @@ -39,10 +39,12 @@ private: string contentType; string text; bool isSecured = false; + bool isReadOnly = false; time_t time = 0; string id; string appData; list > contents; + shared_ptr private_content; unordered_map customHeaders; ChatMessage::State state = ChatMessage::Idle; shared_ptr eventsDb; @@ -127,6 +129,11 @@ bool ChatMessage::isSecured () const { return d->isSecured; } +bool ChatMessage::isReadOnly () const { + L_D(const ChatMessage); + return d->isReadOnly; +} + time_t ChatMessage::getTime () const { L_D(const ChatMessage); return d->time; diff --git a/src/chat/chat-message.h b/src/chat/chat-message.h index 830cf9991..e69883d40 100644 --- a/src/chat/chat-message.h +++ b/src/chat/chat-message.h @@ -77,6 +77,7 @@ public: bool containsReadableText () const; bool isSecured () const; + bool isReadOnly () const; time_t getTime () const; diff --git a/src/chat/modifier/chat-message-modifier.h b/src/chat/modifier/chat-message-modifier.h new file mode 100644 index 000000000..7fa2de4cb --- /dev/null +++ b/src/chat/modifier/chat-message-modifier.h @@ -0,0 +1,38 @@ +/* + * chat-message-modifier.h + * Copyright (C) 2017 Belledonne Communications SARL + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + + #ifndef _CHAT_MESSAGE_MODIFIER_H_ + #define _CHAT_MESSAGE_MODIFIER_H_ + + #include "chat/chat-message.h" + + // ============================================================================= + + LINPHONE_BEGIN_NAMESPACE + + class ChatMessageModifier { + public: + virtual void encode(std::shared_ptr msg) = 0; + virtual void decode(std::shared_ptr msg) = 0; + virtual ~ChatMessageModifier () = default; + }; + + LINPHONE_END_NAMESPACE + + #endif // ifndef _CHAT_MESSAGE_MODIFIER_H_ + \ No newline at end of file diff --git a/src/chat/modifier/cpim-chat-message-modifier.cpp b/src/chat/modifier/cpim-chat-message-modifier.cpp new file mode 100644 index 000000000..c6843a242 --- /dev/null +++ b/src/chat/modifier/cpim-chat-message-modifier.cpp @@ -0,0 +1,33 @@ +/* + * cpim-chat-message-modifier.cpp + * Copyright (C) 2017 Belledonne Communications SARL + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + + #include "cpim-chat-message-modifier.h" + + LINPHONE_BEGIN_NAMESPACE + + using namespace std; + + void CpimChatMessageModifier::encode(shared_ptr msg) { + //TODO + } + + void CpimChatMessageModifier::decode(shared_ptr msg) { + //TODO + } + +LINPHONE_END_NAMESPACE \ No newline at end of file diff --git a/src/chat/modifier/cpim-chat-message-modifier.h b/src/chat/modifier/cpim-chat-message-modifier.h new file mode 100644 index 000000000..ccdaddbdc --- /dev/null +++ b/src/chat/modifier/cpim-chat-message-modifier.h @@ -0,0 +1,38 @@ +/* + * cpim-chat-message-modifier.h + * Copyright (C) 2017 Belledonne Communications SARL + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + + #ifndef _CPIM_CHAT_MESSAGE_MODIFIER_H_ + #define _CPIM_CHAT_MESSAGE_MODIFIER_H_ + + #include "chat-message-modifier.h" + + // ============================================================================= + + LINPHONE_BEGIN_NAMESPACE + + class CpimChatMessageModifier : ChatMessageModifier { + public: + virtual void encode(std::shared_ptr msg) = 0; + virtual void decode(std::shared_ptr msg) = 0; + virtual ~CpimChatMessageModifier () = default; + }; + + LINPHONE_END_NAMESPACE + + #endif // ifndef _CPIM_CHAT_MESSAGE_MODIFIER_H_ + \ No newline at end of file diff --git a/src/chat/modifier/multipart-chat-message-modifier.cpp b/src/chat/modifier/multipart-chat-message-modifier.cpp new file mode 100644 index 000000000..c805cfeb9 --- /dev/null +++ b/src/chat/modifier/multipart-chat-message-modifier.cpp @@ -0,0 +1,33 @@ +/* + * multipart-chat-message-modifier.cpp + * Copyright (C) 2017 Belledonne Communications SARL + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + + #include "multipart-chat-message-modifier.h" + + LINPHONE_BEGIN_NAMESPACE + + using namespace std; + + void MultipartChatMessageModifier::encode(shared_ptr msg) { + //TODO + } + + void MultipartChatMessageModifier::decode(shared_ptr msg) { + //TODO + } + +LINPHONE_END_NAMESPACE \ No newline at end of file diff --git a/src/chat/modifier/multipart-chat-message-modifier.h b/src/chat/modifier/multipart-chat-message-modifier.h new file mode 100644 index 000000000..4577825b4 --- /dev/null +++ b/src/chat/modifier/multipart-chat-message-modifier.h @@ -0,0 +1,38 @@ +/* + * multipart-chat-message-modifier.h + * Copyright (C) 2017 Belledonne Communications SARL + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + + #ifndef _MULTIPART_CHAT_MESSAGE_MODIFIER_H_ + #define _MULTIPART_CHAT_MESSAGE_MODIFIER_H_ + + #include "chat-message-modifier.h" + + // ============================================================================= + + LINPHONE_BEGIN_NAMESPACE + + class MultipartChatMessageModifier : ChatMessageModifier { + public: + virtual void encode(std::shared_ptr msg) = 0; + virtual void decode(std::shared_ptr msg) = 0; + virtual ~MultipartChatMessageModifier () = default; + }; + + LINPHONE_END_NAMESPACE + + #endif // ifndef _MULTIPART_CHAT_MESSAGE_MODIFIER_H_ + \ No newline at end of file