#include "modules/account.h"
#include "modules/sasl.h"
#include "modules/ssl.h"
-#include "modules/spanningtree.h"
+#include "modules/server.h"
enum
{
static std::string sasl_target;
-class ServerTracker : public SpanningTreeEventListener
+class ServerTracker : public ServerEventListener
{
bool online;
public:
ServerTracker(Module* mod)
- : SpanningTreeEventListener(mod)
+ : ServerEventListener(mod)
{
Reset();
}
void SendHostIP()
{
parameterlist params;
- params.push_back(user->host);
+ params.push_back(user->GetRealHost());
params.push_back(user->GetIPString());
+ params.push_back(SSLIOHook::IsSSL(&user->eh) ? "S" : "P");
SendSASL(user, "*", 'H', params);
}
allow_empty_last_param = false;
}
- CmdResult HandleLocal(const std::vector<std::string>& parameters, LocalUser* user)
+ CmdResult HandleLocal(const std::vector<std::string>& parameters, LocalUser* user) CXX11_OVERRIDE
{
{
if (!cap.get(user))
this->flags_needed = FLAG_SERVERONLY; // should not be called by users
}
- CmdResult Handle(const std::vector<std::string>& parameters, User *user)
+ CmdResult Handle(const std::vector<std::string>& parameters, User* user) CXX11_OVERRIDE
{
User* target = ServerInstance->FindUUID(parameters[1]);
if (!target)
return CMD_SUCCESS;
}
- RouteDescriptor GetRouting(User* user, const std::vector<std::string>& parameters)
+ RouteDescriptor GetRouting(User* user, const std::vector<std::string>& parameters) CXX11_OVERRIDE
{
return ROUTE_BROADCAST;
}
void ReadConfig(ConfigStatus& status) CXX11_OVERRIDE
{
- sasl_target = ServerInstance->Config->ConfValue("sasl")->getString("target", "*");
+ std::string target = ServerInstance->Config->ConfValue("sasl")->getString("target");
+ if (target.empty())
+ throw ModuleException("<sasl:target> must be set to the name of your services server!");
+
+ sasl_target = target;
servertracker.Reset();
}