Commit 93c17c21 authored by Sylvain Berfini's avatar Sylvain Berfini 🎩

Started c-chat-message

parent 0a15a02f
......@@ -570,14 +570,6 @@ const LinphoneAddress *linphone_chat_message_get_peer_address(LinphoneChatMessag
return linphone_chat_room_get_peer_address(msg->chat_room);
}
void linphone_chat_message_set_user_data(LinphoneChatMessage *msg, void *ud) {
msg->message_userdata = ud;
}
void *linphone_chat_message_get_user_data(const LinphoneChatMessage *msg) {
return msg->message_userdata;
}
const char *linphone_chat_message_get_external_body_url(const LinphoneChatMessage *msg) {
return msg->external_body_url;
}
......@@ -775,15 +767,6 @@ static void _linphone_chat_message_destroy(LinphoneChatMessage *msg) {
}
}
LinphoneChatMessage *linphone_chat_message_ref(LinphoneChatMessage *msg) {
belle_sip_object_ref(msg);
return msg;
}
void linphone_chat_message_unref(LinphoneChatMessage *msg) {
belle_sip_object_unref(msg);
}
void linphone_chat_message_deactivate(LinphoneChatMessage *msg){
if (msg->file_transfer_information != NULL) {
_linphone_chat_message_cancel_file_transfer(msg, FALSE);
......
......@@ -77,6 +77,7 @@ set(C_API_HEADER_FILES
c-address.h
c-api.h
c-callbacks.h
c-chat-message.h
c-chat-room.h
c-chat-room-cbs.h
c-event-log.h
......
......@@ -20,6 +20,7 @@
#define _C_API_H_
#include "linphone/api/c-address.h"
#include "linphone/api/c-chat-message.h"
#include "linphone/api/c-chat-room.h"
#include "linphone/api/c-event-log.h"
#include "linphone/api/c-participant.h"
......
/*
* c-chat-message.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 _C_CHAT_MESSAGE_H_
#define _C_CHAT_MESSAGE_H_
#include "linphone/api/c-types.h"
// =============================================================================
#ifdef __cplusplus
extern "C" {
#endif // ifdef __cplusplus
/**
* @addtogroup chatmessage
* @{
*/
/**
* Acquire a reference to the chat message.
* @param[in] cr The chat message.
* @return The same chat message.
**/
LINPHONE_PUBLIC LinphoneChatMessage *linphone_chat_message_ref(LinphoneChatMessage *msg);
/**
* Release reference to the chat message.
* @param[in] cr The chat message.
**/
LINPHONE_PUBLIC void linphone_chat_message_unref(LinphoneChatMessage *msg);
/**
* Retrieve the user pointer associated with the chat message.
* @param[in] cr The chat message.
* @return The user pointer associated with the chat message.
**/
LINPHONE_PUBLIC void *linphone_chat_message_get_user_data(const LinphoneChatMessage *msg);
/**
* Assign a user pointer to the chat message.
* @param[in] cr The chat message.
* @param[in] ud The user pointer to associate with the chat message.
**/
LINPHONE_PUBLIC void linphone_chat_message_set_user_data(LinphoneChatMessage *msg, void *ud);
/**
* @}
*/
#ifdef __cplusplus
}
#endif // ifdef __cplusplus
#endif // ifndef _C_CHAT_MESSAGE_H_
\ No newline at end of file
......@@ -24,6 +24,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include "linphone/callbacks.h"
#include "linphone/types.h"
#include "linphone/api/c-types.h"
#include "linphone/api/c-chat-message.h"
#include "linphone/api/c-chat-room.h"
#include "linphone/api/c-chat-room-cbs.h"
......@@ -58,19 +59,6 @@ LINPHONE_PUBLIC LinphoneChatMessageState linphone_chat_message_get_state(const L
**/
LINPHONE_PUBLIC LinphoneChatMessage* linphone_chat_message_clone(const LinphoneChatMessage* message);
/**
* Acquire a reference to the chat message.
* @param msg the chat message
* @return the same chat message
**/
LINPHONE_PUBLIC LinphoneChatMessage * linphone_chat_message_ref(LinphoneChatMessage *msg);
/**
* Release reference to the chat message.
* @param msg the chat message.
**/
LINPHONE_PUBLIC void linphone_chat_message_unref(LinphoneChatMessage *msg);
/**
* Destroys a LinphoneChatMessage.
**/
......@@ -250,16 +238,6 @@ LINPHONE_PUBLIC const char* linphone_chat_message_get_text(const LinphoneChatMes
*/
LINPHONE_PUBLIC time_t linphone_chat_message_get_time(const LinphoneChatMessage* message);
/**
* User pointer get function
*/
LINPHONE_PUBLIC void* linphone_chat_message_get_user_data(const LinphoneChatMessage* message);
/**
*User pointer set function
*/
LINPHONE_PUBLIC void linphone_chat_message_set_user_data(LinphoneChatMessage* message,void*);
/**
* Returns the chatroom this message belongs to.
**/
......
......@@ -99,6 +99,7 @@ set(LINPHONE_CXX_OBJECTS_SOURCE_FILES
address/address.cpp
c-wrapper/api/c-address.cpp
c-wrapper/api/c-call-params.cpp
c-wrapper/api/c-chat-message.cpp
c-wrapper/api/c-chat-room.cpp
c-wrapper/api/c-chat-room-cbs.cpp
c-wrapper/api/c-event-log.cpp
......
/*
* c-chat-message.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 "linphone/chat.h"
#include "linphone/wrapper_utils.h"
#include "private.h"
#include "c-wrapper/c-tools.h"
#include "chat/chat-message.h"
#include "chat/chat-message-p.h"
using namespace std;
#define GET_CPP_PTR(obj) L_GET_CPP_PTR_FROM_C_STRUCT(obj, ChatMessage, ChatMessage)
#define GET_CPP_PRIVATE_PTR(obj) L_GET_PRIVATE_FROM_C_STRUCT(obj, ChatMessage, ChatMessage)
/*******************************************************************************
* Reference and user data handling functions *
******************************************************************************/
LinphoneChatMessage *linphone_chat_message_ref(LinphoneChatMessage *msg) {
belle_sip_object_ref(msg);
return msg;
}
void linphone_chat_message_unref(LinphoneChatMessage *msg) {
belle_sip_object_unref(msg);
}
void * linphone_chat_message_get_user_data(const LinphoneChatMessage *msg) {
return L_GET_USER_DATA_FROM_C_STRUCT(msg, ChatMessage, ChatMessage);
}
void linphone_chat_message_set_user_data(LinphoneChatMessage *msg, void *ud) {
L_SET_USER_DATA_FROM_C_STRUCT(msg, ud, ChatMessage, ChatMessage);
}
\ 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