diff --git a/src/server/forum_user_handler.cpp b/src/server/forum_user_handler.cpp index 1aae75455f1..29e038051bc 100644 --- a/src/server/forum_user_handler.cpp +++ b/src/server/forum_user_handler.cpp @@ -322,15 +322,6 @@ std::string fuh::get_hash(const std::string& user) { } } -std::string fuh::get_mail(const std::string& user) { - try { - return get_detail_for_user(user, "user_email"); - } catch (const sql_error& e) { - ERR_UH << "Could not retrieve email for user '" << user << "' :" << e.message << std::endl; - return ""; - } -} - std::time_t fuh::get_lastlogin(const std::string& user) { try { int time_int = get_writable_detail_for_user(user, "user_lastvisit"); diff --git a/src/server/forum_user_handler.hpp b/src/server/forum_user_handler.hpp index e66c647d85d..bc2f26db4e6 100644 --- a/src/server/forum_user_handler.hpp +++ b/src/server/forum_user_handler.hpp @@ -91,9 +91,6 @@ class fuh : public user_handler { private: std::string get_hash(const std::string& user); - std::string get_mail(const std::string& user); - /*std::vector get_friends(const std::string& user); - std::vector get_ignores(const std::string& user);*/ std::time_t get_lastlogin(const std::string& user); std::time_t get_registrationdate(const std::string& user); bool is_inactive(const std::string& user); diff --git a/src/server/server.cpp b/src/server/server.cpp index 35c89cebd0c..3d6569cfa40 100644 --- a/src/server/server.cpp +++ b/src/server/server.cpp @@ -525,10 +525,7 @@ void server::load_config() #ifdef HAVE_MYSQLPP user_handler_.reset(new fuh(user_handler)); #endif - // Initiate the mailer class with the [mail] tag - // from the config file if(user_handler_) { - user_handler_->init_mailer(cfg_.child("mail")); uuid_ = user_handler_->get_uuid(); } } diff --git a/src/server/user_handler.cpp b/src/server/user_handler.cpp index 17433d44ef5..a9429b6903e 100644 --- a/src/server/user_handler.cpp +++ b/src/server/user_handler.cpp @@ -27,25 +27,6 @@ #include #include -bool user_handler::send_mail(const std::string& to_user, - const std::string& /*subject*/, const std::string& /*message*/) { - - //If this user is registered at all - if(!user_exists(to_user)) { - throw error("Could not send email. No user with the name '" + to_user + "' exists."); - } - - // If this user did not provide an email - if(get_mail(to_user).empty()) { - throw error("Could not send email. The email address of the user '" + to_user + "' is empty."); - } - - throw user_handler::error("This server is configured not to send email."); -} - -void user_handler::init_mailer(const config &) { -} - std::string user_handler::create_unsecure_nonce(int length) { srand(static_cast(std::time(nullptr))); diff --git a/src/server/user_handler.hpp b/src/server/user_handler.hpp index 048af5bed7c..90bb9957168 100644 --- a/src/server/user_handler.hpp +++ b/src/server/user_handler.hpp @@ -150,9 +150,6 @@ class user_handler { error(const std::string& message) : game::error(message) {} }; - /** Initiate the mailer object. */ - void init_mailer(const config &c); - /** Create a random string of digits for password encryption. */ std::string create_unsecure_nonce(int length = 8); std::string create_secure_nonce(); @@ -178,20 +175,4 @@ class user_handler { virtual void db_insert_game_player_info(const std::string& uuid, int game_id, const std::string& username, int side_number, const std::string& is_host, const std::string& faction) =0; virtual void db_insert_modification_info(const std::string& uuid, int game_id, const std::string& modification_name) =0; virtual void db_set_oos_flag(const std::string& uuid, int game_id) =0; - - protected: - - /** - * Sends an email to the specified address. Requires access to an SMTP server. - * - * Throws an error if the mail could not be sent. - */ - bool send_mail(const std::string& to_user, const std::string& subject, const std::string& message); - - /** - * Used in send_mail(). - * - * Should return an empty string when not used. - */ - virtual std::string get_mail(const std::string& user) =0; };