Skip to content
Snippets Groups Projects
Commit a58acea0 authored by Stepan Salenikovich's avatar Stepan Salenikovich
Browse files

im: remove message saving

This is not used by the daemon and the clients save IMs via LRC.
There is no need for this function and it only pollutes the daemon
dir with im files.

Issue: #79618
Change-Id: Ibab3f83a3c6a966f0d602017c50aeb7cd7a4567f
parent 0fb5dd82
No related branches found
No related tags found
No related merge requests found
...@@ -56,23 +56,6 @@ static void XMLCALL ...@@ -56,23 +56,6 @@ static void XMLCALL
endElementCallback(void * /*userData*/, const char* /*name*/) endElementCallback(void * /*userData*/, const char* /*name*/)
{} {}
bool
InstantMessaging::saveMessage(const std::string& message, const std::string& author,
const std::string& id, int mode)
{
std::ofstream File;
std::string filename = "im_" + id;
File.open(filename.c_str(), static_cast<std::ios_base::openmode>(mode));
if (!File.good() || !File.is_open())
return false;
File << "[" << author << "] " << message << '\n';
File.close();
return true;
}
void void
InstantMessaging::sendSipMessage(pjsip_inv_session* session, const std::string& id, InstantMessaging::sendSipMessage(pjsip_inv_session* session, const std::string& id,
const std::vector<std::string>& chunks) const std::vector<std::string>& chunks)
...@@ -102,8 +85,6 @@ InstantMessaging::sendSipMessage(pjsip_inv_session* session, const std::string& ...@@ -102,8 +85,6 @@ InstantMessaging::sendSipMessage(pjsip_inv_session* session, const std::string&
if (ret != PJ_SUCCESS) if (ret != PJ_SUCCESS)
RING_WARN("SIP send message failed: %s", sip_utils::sip_strerror(ret).c_str()); RING_WARN("SIP send message failed: %s", sip_utils::sip_strerror(ret).c_str());
pjsip_dlg_dec_lock(dialog); pjsip_dlg_dec_lock(dialog);
saveMessage(text, "Me", id);
} }
} }
......
...@@ -33,9 +33,7 @@ ...@@ -33,9 +33,7 @@
#define __INSTANT_MESSAGING_H__ #define __INSTANT_MESSAGING_H__
#include <string> #include <string>
#include <iostream>
#include <vector> #include <vector>
#include <fstream>
#include <pjsip.h> #include <pjsip.h>
#include <pjlib.h> #include <pjlib.h>
#include <pjsip_ua.h> #include <pjsip_ua.h>
...@@ -79,17 +77,6 @@ struct InstantMessageException : std::runtime_error ...@@ -79,17 +77,6 @@ struct InstantMessageException : std::runtime_error
using UriEntry = std::map<std::string, std::string>; using UriEntry = std::map<std::string, std::string>;
using UriList = std::list<UriEntry>; using UriList = std::list<UriEntry>;
/*
* 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
*
* @param message The text message
* @param id The current call
* @return True if the message could have been successfully saved, False otherwise
*/
bool saveMessage(const std::string& message, const std::string& author, const std::string& id,
int mode = MODE_APPEND);
void sendSipMessage(pjsip_inv_session* session, const std::string& id, void sendSipMessage(pjsip_inv_session* session, const std::string& id,
const std::vector<std::string>& chunks); const std::vector<std::string>& chunks);
#if HAVE_IAX #if HAVE_IAX
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment