Commit d81435fa authored by Rafaël Carré's avatar Rafaël Carré

IM : simplify

parent d6a2bb56
This diff is collapsed.
......@@ -50,11 +50,7 @@
#include <iax-client.h>
#define EMPTY_MESSAGE pj_str((char*)"")
#define STR_TEXT pj_str((char*)"text")
#define STR_PLAIN pj_str((char*)"plain")
#define METHOD_NAME pj_str((char*)"MESSAGE")
#define MAXIMUM_MESSAGE_LENGTH 1560 /* PJSIP's sip message limit */
#define DELIMITER_CHAR "\n\n"
#define MODE_APPEND std::ios::out || std::ios::app
#define MODE_TEST std::ios::out
......@@ -90,11 +86,6 @@ class InstantMessaging
*/
~InstantMessaging();
/*
* Register and initialize instant messaging support
*/
bool init ();
/**
* Set maximum size fo this module.
*/
......@@ -110,21 +101,6 @@ class InstantMessaging
return messageMaxSize;
}
/*
* Open an existing file if possible or create a new one. *
* @param id The current call
* @return int The number of currently open file stream
*/
int openArchive (std::string& id);
/*
* Close the file corresponding to the specified call
*
* @param id The current call
* @return int The number of remaining open file stream
*/
int closeArchive (std::string& id);
/*
* Write the text message to the right file
* The call ID is associated to a file descriptor, so it is easy then to retrieve the right file
......@@ -135,40 +111,21 @@ class InstantMessaging
*/
bool saveMessage (const std::string& message, const std::string& author, const std::string& id, int mode = MODE_APPEND);
/*
* Receive a string SIP message, for a specific call
*
* @param message The message contained in the TEXT message
* @param id The call recipient of the message
*/
std::string receive (const std::string& message, const std::string& author, const std::string& id);
/*
* Send a SIP string message inside a call
*
* @param id The call ID we will retrieve the invite session from
* @param message The string message, as sent by the client
*
* @return pj_status_t 0 on success
* 1 otherwise
*/
pj_status_t sip_send (pjsip_inv_session*, const std::string& id, const std::string&);
void sip_send (pjsip_inv_session*, const std::string& id, const std::string&);
pj_status_t send_sip_message (pjsip_inv_session*, const std::string& id, const std::string&);
void send_sip_message (pjsip_inv_session*, const std::string& id, const std::string&);
bool iax_send (iax_session* session, const std::string& id, const std::string& message);
void iax_send (iax_session* session, const std::string& id, const std::string& message);
bool send_iax_message (iax_session *session, const std::string& id, const std::string&);
void send_iax_message (iax_session *session, const std::string& id, const std::string&);
std::vector<std::string> split_message (const std::string&);
/**
* Notify the clients, through D-Bus, that a new message has arrived
*
* @param id The callID to notify (TODO: accountID?)
*/
pj_status_t notify (const std::string& /*id*/);
std::vector<std::string> split_message(std::string);
/**
......
......@@ -47,7 +47,6 @@ using std::endl;
void InstantMessagingTest::setUp()
{
_im = new sfl::InstantMessaging ();
_im->init ();
}
void InstantMessagingTest::testSaveSingleMessage ()
......
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