mirror of
https://github.com/anope/anope.git
synced 2026-07-04 20:53:12 +02:00
add vhost support for hybrid
This commit is contained in:
+4
-2
@@ -282,14 +282,16 @@ class CoreExport User : public virtual Base, public Extensible, public CommandRe
|
||||
/** Remove a mode on the user
|
||||
* @param bi The client setting the mode
|
||||
* @param um The user mode
|
||||
* @param param Optional param for the mode
|
||||
*/
|
||||
void RemoveMode(BotInfo *bi, UserMode *um);
|
||||
void RemoveMode(BotInfo *bi, UserMode *um, const Anope::string ¶m = "");
|
||||
|
||||
/** Remove a mode from the user
|
||||
* @param bi The client setting the mode
|
||||
* @param name The mode name
|
||||
* @param param Optional param for the mode
|
||||
*/
|
||||
void RemoveMode(BotInfo *bi, const Anope::string &name);
|
||||
void RemoveMode(BotInfo *bi, const Anope::string &name, const Anope::string ¶m = "");
|
||||
|
||||
/** Set a string of modes on a user
|
||||
* @param bi The client setting the modes
|
||||
|
||||
@@ -26,6 +26,7 @@ class HybridProto : public IRCDProto
|
||||
CanSZLine = true;
|
||||
CanSVSHold = true;
|
||||
CanCertFP = true;
|
||||
CanSetVHost = true;
|
||||
RequiresID = true;
|
||||
MaxModes = 4;
|
||||
}
|
||||
@@ -260,6 +261,16 @@ class HybridProto : public IRCDProto
|
||||
this->SendSQLineDel(&x);
|
||||
}
|
||||
|
||||
void SendVhost(User *u, const Anope::string &ident, const Anope::string &host) anope_override
|
||||
{
|
||||
u->SetMode(Config->GetClient("HostServ"), "CLOAK", host);
|
||||
}
|
||||
|
||||
void SendVhostDel(User *u) anope_override
|
||||
{
|
||||
u->RemoveMode(Config->GetClient("HostServ"), "CLOAK", u->host);
|
||||
}
|
||||
|
||||
bool IsIdentValid(const Anope::string &ident) anope_override
|
||||
{
|
||||
if (ident.empty() || ident.length() > Config->GetBlock("networkinfo")->Get<unsigned>("userlen"))
|
||||
@@ -603,6 +614,7 @@ class ProtoHybrid : public Module
|
||||
ModeManager::AddUserMode(new UserModeOperOnly("HIDEOPER", 'H'));
|
||||
ModeManager::AddUserMode(new UserMode("REGPRIV", 'R'));
|
||||
ModeManager::AddUserMode(new UserModeNoone("SSL", 'S'));
|
||||
ModeManager::AddUserMode(new UserMode("CLOAK", 'x'));
|
||||
|
||||
/* b/e/I */
|
||||
ModeManager::AddChannelMode(new ChannelModeList("BAN", 'b'));
|
||||
|
||||
+4
-4
@@ -488,18 +488,18 @@ void User::SetMode(BotInfo *bi, const Anope::string &uname, const Anope::string
|
||||
SetMode(bi, ModeManager::FindUserModeByName(uname), param);
|
||||
}
|
||||
|
||||
void User::RemoveMode(BotInfo *bi, UserMode *um)
|
||||
void User::RemoveMode(BotInfo *bi, UserMode *um, const Anope::string ¶m)
|
||||
{
|
||||
if (!um || !HasMode(um->name))
|
||||
return;
|
||||
|
||||
ModeManager::StackerAdd(bi, this, um, false);
|
||||
ModeManager::StackerAdd(bi, this, um, false, param);
|
||||
RemoveModeInternal(bi, um);
|
||||
}
|
||||
|
||||
void User::RemoveMode(BotInfo *bi, const Anope::string &name)
|
||||
void User::RemoveMode(BotInfo *bi, const Anope::string &name, const Anope::string ¶m)
|
||||
{
|
||||
RemoveMode(bi, ModeManager::FindUserModeByName(name));
|
||||
RemoveMode(bi, ModeManager::FindUserModeByName(name), param);
|
||||
}
|
||||
|
||||
void User::SetModes(BotInfo *bi, const char *umodes, ...)
|
||||
|
||||
Reference in New Issue
Block a user