0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-12-26 15:33:54 +01:00

ircd:Ⓜ️:self: Move the signoff/signon greeting to self.cc.

This commit is contained in:
Jason Volk 2019-09-29 15:07:34 -07:00
parent ad195ef8a4
commit 31ee90c056
3 changed files with 35 additions and 20 deletions

View file

@ -28,6 +28,7 @@ namespace ircd::m::self
bool host(const string_view &);
void create_my_key();
void signon(), signoff();
}
namespace ircd::m

View file

@ -32,20 +32,6 @@ ircd::m::log
// init
//
ircd::conf::item<std::string>
me_online_status_msg
{
{ "name", "ircd.me.online.status_msg" },
{ "default", "Wanna chat? IRCd at your service!" }
};
ircd::conf::item<std::string>
me_offline_status_msg
{
{ "name", "ircd.me.offline.status_msg" },
{ "default", "Catch ya on the flip side..." }
};
/// --- tmp ---
extern "C" void
@ -70,9 +56,7 @@ try
reload_conf();
_fetch = std::make_unique<fetch::init>();
_modules = std::make_unique<init::modules>();
if(!ircd::write_avoid && vm::sequence::retired != 0)
presence::set(me, "online", me_online_status_msg);
self::signon();
}
catch(const m::error &e)
{
@ -106,9 +90,7 @@ noexcept try
if(m::sync::pool.size())
m::sync::pool.join();
if(!std::uncaught_exceptions() && !ircd::write_avoid)
presence::set(me, "offline", me_offline_status_msg);
self::signoff();
_fetch.reset(nullptr);
_modules.reset(nullptr);
_dbs.reset(nullptr);

View file

@ -86,6 +86,38 @@ ircd::m::my_node
ircd::my_host()
};
//
// signon/signoff greetings
//
ircd::conf::item<std::string>
me_online_status_msg
{
{ "name", "ircd.me.online.status_msg" },
{ "default", "Wanna chat? IRCd at your service!" }
};
ircd::conf::item<std::string>
me_offline_status_msg
{
{ "name", "ircd.me.offline.status_msg" },
{ "default", "Catch ya on the flip side..." }
};
void
ircd::m::self::signon()
{
if(!ircd::write_avoid && vm::sequence::retired != 0)
presence::set(me, "online", me_online_status_msg);
}
void
ircd::m::self::signoff()
{
if(!std::uncaught_exceptions() && !ircd::write_avoid)
presence::set(me, "offline", me_offline_status_msg);
}
bool
ircd::m::self::host(const string_view &other)
{