diff options
author | claiff <claiff@mail.ru> | 2022-09-20 16:05:35 +0300 |
---|---|---|
committer | claiff <claiff@mail.ru> | 2022-09-20 16:05:35 +0300 |
commit | a282ae6418c85db1aae5a2823dd37d56e56e5249 (patch) | |
tree | 00fb2677007f87b5572d088d0421e3075291f8ac /src/service | |
parent | 7485f26f35c9cfc1489a2e425fee57a2b51059a9 (diff) | |
download | obmc-sila-smtp-a282ae6418c85db1aae5a2823dd37d56e56e5249.tar.xz |
temp
Diffstat (limited to 'src/service')
-rw-r--r-- | src/service/smtp.cpp | 18 | ||||
-rw-r--r-- | src/service/smtp.hpp | 12 |
2 files changed, 12 insertions, 18 deletions
diff --git a/src/service/smtp.cpp b/src/service/smtp.cpp index 702de2d..7b1ca70 100644 --- a/src/service/smtp.cpp +++ b/src/service/smtp.cpp @@ -11,7 +11,7 @@ namespace smtp::service :mSettingsStorage(settings), mMailTo(mail_to) { CreateService( connection ); - CreateMessagerInterface( connection ); + CreateMessengerInterface( connection ); CreateSettingsManagerInterface( connection ); CreateMailManagerInterface( connection ); } @@ -27,17 +27,17 @@ namespace smtp::service connection->request_name( SMTP_BUS_NAME ); } - void Smtp::CreateMessagerInterface( ConnectionPtr connection ) + void Smtp::CreateMessengerInterface( ConnectionPtr connection ) { static constexpr char SMTP_OBJECT_NAME[] = "/xyz/openbmc_project/SMTP/Messenger"; static constexpr char SMTP_INTERFACE_NAME[] = "xyz.openbmc_project.Messenger"; mObjectServer = std::make_shared<sdbusplus::asio::object_server>( connection ); - mMessagerInterface = mObjectServer->add_interface( SMTP_OBJECT_NAME, SMTP_INTERFACE_NAME ); + mMessengerInterface = mObjectServer->add_interface( SMTP_OBJECT_NAME, SMTP_INTERFACE_NAME ); - AddMessagerMethods(); + AddMessengerMethods(); - mMessagerInterface->initialize(); + mMessengerInterface->initialize(); } void Smtp::CreateSettingsManagerInterface(ConnectionPtr connection) @@ -66,13 +66,13 @@ namespace smtp::service mManagerMailInterface->initialize(); } - void Smtp::AddMessagerMethods() + void Smtp::AddMessengerMethods() { static constexpr char SMTP_SEND_MESSAGE_METHOD_NAME[] = "SendMail"; - mMessagerInterface->register_method(SMTP_SEND_MESSAGE_METHOD_NAME, [this]( std::string const& mail_from, - std::string const& theme, - std::string const& text ) + mMessengerInterface->register_method( SMTP_SEND_MESSAGE_METHOD_NAME, [this]( std::string const& mail_from, + std::string const& theme, + std::string const& text ) { return message::Sender{ mSettingsStorage, mMailTo }.Send( mail_from, theme, text );}); } diff --git a/src/service/smtp.hpp b/src/service/smtp.hpp index a52c9c0..edf964e 100644 --- a/src/service/smtp.hpp +++ b/src/service/smtp.hpp @@ -20,21 +20,15 @@ namespace smtp::service Smtp( ConnectionPtr connection, manage::Settings const& settings, manage::Mail const& mail_to ); ~Smtp() = default; private: - void FillStorageByDefault(); void CreateService( ConnectionPtr bus ); - void CreateMessagerInterface( ConnectionPtr connection ); + void CreateMessengerInterface( ConnectionPtr connection ); void CreateSettingsManagerInterface( ConnectionPtr connection ); void CreateMailManagerInterface( ConnectionPtr connection ); - void AddProperties(); - void AddMessagerMethods(); + void AddMessengerMethods(); void AddSettingsManagerMethods(); void AddMailManagerMethods(); - bool RefreshSettings( bool is_need_auth, bool is_need_ssl, - std::string const& user, std::string const& password, - std::string const& host, std::string const& port ); - - InterfacePtr mMessagerInterface; + InterfacePtr mMessengerInterface; InterfacePtr mManagerSettingsInterface; InterfacePtr mManagerMailInterface; |