summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2011-05-30 19:48:14 -0400
committerAdam <Adam@anope.org>2011-05-30 19:48:14 -0400
commita11155551efd475ac511313963b878992d2de73b (patch)
tree8d54d33d065d20dd79a07cb28e142509d39589d9 /src
parentd45222798b17795d25bf42a203af5a689845262c (diff)
Bug #1273 - Fixed removing vhosts on InspIRCd when m_cloaking is unloaded
Diffstat (limited to 'src')
-rw-r--r--src/protocol/inspircd12.c15
-rw-r--r--src/protocol/inspircd20.c14
2 files changed, 25 insertions, 4 deletions
diff --git a/src/protocol/inspircd12.c b/src/protocol/inspircd12.c
index e53ac735e..01703baed 100644
--- a/src/protocol/inspircd12.c
+++ b/src/protocol/inspircd12.c
@@ -426,6 +426,7 @@ static int has_blockcaps = 0;
static int has_nickflood = 0;
static int has_chanfilter = 0;
static int has_kicknorejoin = 0;
+static int has_cloaking = 0;
void inspircd_set_umode(User *user, int ac, char **av)
{
@@ -575,8 +576,15 @@ void inspircd_cmd_topic(char *whosets, char *chan, char *whosetit,
void inspircd_cmd_vhost_off(User * u)
{
- common_svsmode(u, "-x", NULL);
- common_svsmode(u, "+x", NULL);
+ if (has_cloaking)
+ {
+ common_svsmode(u, "-x", NULL);
+ common_svsmode(u, "+x", NULL);
+ }
+ else
+ {
+ inspircd_cmd_chghost(u->nick, u->host);
+ }
if (has_chgidentmod && u->username && u->vident && strcmp(u->username, u->vident) != 0)
{
@@ -1999,6 +2007,9 @@ int anope_event_capab(char *source, int ac, char **av)
if (strstr(av[1], "m_kicknorejoin.so")) {
has_kicknorejoin = 1;
}
+ if (strstr(av[1], "m_cloaking.so")) {
+ has_cloaking = 1;
+ }
} else if (strcasecmp(av[0], "END") == 0) {
if (!has_globopsmod) {
send_cmd(NULL, "ERROR :m_globops is not loaded. This is required by Anope");
diff --git a/src/protocol/inspircd20.c b/src/protocol/inspircd20.c
index d0239ef1c..969ad4a94 100644
--- a/src/protocol/inspircd20.c
+++ b/src/protocol/inspircd20.c
@@ -473,6 +473,7 @@ static int has_chghostmod = 0;
static int has_chgidentmod = 0;
static int has_servprotectmod = 0;
static int has_hidechansmod = 0;
+static int has_cloaking = 0;
void inspircd_set_umode(User *user, int ac, char **av)
{
@@ -622,8 +623,15 @@ void inspircd_cmd_topic(char *whosets, char *chan, char *whosetit,
void inspircd_cmd_vhost_off(User * u)
{
- common_svsmode(u, "-x", NULL);
- common_svsmode(u, "+x", NULL);
+ if (has_cloaking)
+ {
+ common_svsmode(u, "-x", NULL);
+ common_svsmode(u, "+x", NULL);
+ }
+ else
+ {
+ inspircd_cmd_chghost(u->nick, u->host);
+ }
if (has_chgidentmod && u->username && u->vident && strcmp(u->username, u->vident) != 0)
{
@@ -1915,6 +1923,8 @@ int anope_event_capab(char *source, int ac, char **av)
} else if (strcasecmp(av[0], "MODULES") == 0) {
if (strstr(av[1], "m_svshold.so"))
ircd->svshold = 1;
+ if (strstr(av[1], "m_cloaking.so"))
+ has_cloaking = 1;
} else if (strcasecmp(av[0], "CHANMODES") == 0) {
char **argv;
int argc = split_buf(av[1], &argv, 1);