mirror of
https://github.com/anope/anope.git
synced 2026-06-30 06:16:38 +02:00
Add a helper method for getting a description of an uplink.
This commit is contained in:
@@ -23,6 +23,7 @@
|
||||
using Configuration::File;
|
||||
using Configuration::Conf;
|
||||
using Configuration::Internal::Block;
|
||||
using Configuration::Uplink;
|
||||
|
||||
File ServicesConf("anope.conf", false); // Configuration file name
|
||||
Conf *Config = NULL;
|
||||
@@ -619,6 +620,23 @@ void Conf::Post(Conf *old)
|
||||
}
|
||||
}
|
||||
|
||||
Anope::string Uplink::str() const
|
||||
{
|
||||
switch (protocol)
|
||||
{
|
||||
case AF_INET:
|
||||
return Anope::printf("%s:%u", this->host.c_str(), this->port);
|
||||
case AF_INET6:
|
||||
return Anope::printf("[%s]:%u", this->host.c_str(), this->port);
|
||||
case AF_UNIX:
|
||||
return this->host;
|
||||
}
|
||||
|
||||
// Should never be reached.
|
||||
return "";
|
||||
}
|
||||
|
||||
|
||||
Block &Conf::GetModule(const Module *m)
|
||||
{
|
||||
if (!m)
|
||||
|
||||
Reference in New Issue
Block a user