Commit 8fce516b authored by Sylvain Berfini's avatar Sylvain Berfini 🎩
Browse files

Added chat message modifiers skeletons

parent 68bb508c
......@@ -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
......
......@@ -39,10 +39,12 @@ private:
string contentType;
string text;
bool isSecured = false;
bool isReadOnly = false;
time_t time = 0;
string id;
string appData;
list<shared_ptr<Content> > contents;
shared_ptr<Content> private_content;
unordered_map<string, string> customHeaders;
ChatMessage::State state = ChatMessage::Idle;
shared_ptr<EventsDb> 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;
......
......@@ -77,6 +77,7 @@ public:
bool containsReadableText () const;
bool isSecured () const;
bool isReadOnly () const;
time_t getTime () const;
......
/*
* 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 <http://www.gnu.org/licenses/>.
*/
#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<ChatMessagePrivate> msg) = 0;
virtual void decode(std::shared_ptr<ChatMessagePrivate> msg) = 0;
virtual ~ChatMessageModifier () = default;
};
LINPHONE_END_NAMESPACE
#endif // ifndef _CHAT_MESSAGE_MODIFIER_H_
\ No newline at end of file
/*
* 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 <http://www.gnu.org/licenses/>.
*/
#include "cpim-chat-message-modifier.h"
LINPHONE_BEGIN_NAMESPACE
using namespace std;
void CpimChatMessageModifier::encode(shared_ptr<ChatMessagePrivate> msg) {
//TODO
}
void CpimChatMessageModifier::decode(shared_ptr<ChatMessagePrivate> msg) {
//TODO
}
LINPHONE_END_NAMESPACE
\ No newline at end of file
/*
* 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 <http://www.gnu.org/licenses/>.
*/
#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<ChatMessagePrivate> msg) = 0;
virtual void decode(std::shared_ptr<ChatMessagePrivate> msg) = 0;
virtual ~CpimChatMessageModifier () = default;
};
LINPHONE_END_NAMESPACE
#endif // ifndef _CPIM_CHAT_MESSAGE_MODIFIER_H_
\ No newline at end of file
/*
* 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 <http://www.gnu.org/licenses/>.
*/
#include "multipart-chat-message-modifier.h"
LINPHONE_BEGIN_NAMESPACE
using namespace std;
void MultipartChatMessageModifier::encode(shared_ptr<ChatMessagePrivate> msg) {
//TODO
}
void MultipartChatMessageModifier::decode(shared_ptr<ChatMessagePrivate> msg) {
//TODO
}
LINPHONE_END_NAMESPACE
\ No newline at end of file
/*
* 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 <http://www.gnu.org/licenses/>.
*/
#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<ChatMessagePrivate> msg) = 0;
virtual void decode(std::shared_ptr<ChatMessagePrivate> msg) = 0;
virtual ~MultipartChatMessageModifier () = default;
};
LINPHONE_END_NAMESPACE
#endif // ifndef _MULTIPART_CHAT_MESSAGE_MODIFIER_H_
\ No newline at end of file
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