diff --git a/src/im/instant_messaging.cpp b/src/im/instant_messaging.cpp index 30ef953ecd6fe2b5f05d609ac3df1a83cf14ef3a..c99a33525688230537c88f33da77036fd6feea24 100644 --- a/src/im/instant_messaging.cpp +++ b/src/im/instant_messaging.cpp @@ -56,23 +56,6 @@ static void XMLCALL 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 InstantMessaging::sendSipMessage(pjsip_inv_session* session, const std::string& id, const std::vector<std::string>& chunks) @@ -102,8 +85,6 @@ InstantMessaging::sendSipMessage(pjsip_inv_session* session, const std::string& if (ret != PJ_SUCCESS) RING_WARN("SIP send message failed: %s", sip_utils::sip_strerror(ret).c_str()); pjsip_dlg_dec_lock(dialog); - - saveMessage(text, "Me", id); } } diff --git a/src/im/instant_messaging.h b/src/im/instant_messaging.h index 8d0c2a2298797879c1c4fc7bea53db9fe05eea4b..151771058ed6b72244491d35e860e7824aacd050 100644 --- a/src/im/instant_messaging.h +++ b/src/im/instant_messaging.h @@ -33,9 +33,7 @@ #define __INSTANT_MESSAGING_H__ #include <string> -#include <iostream> #include <vector> -#include <fstream> #include <pjsip.h> #include <pjlib.h> #include <pjsip_ua.h> @@ -79,17 +77,6 @@ struct InstantMessageException : std::runtime_error using UriEntry = std::map<std::string, std::string>; 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, const std::vector<std::string>& chunks); #if HAVE_IAX