summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRobin Burchell w00t@inspircd.org <Robin Burchell w00t@inspircd.org@5417fbe8-f217-4b02-8779-1006273d7864>2008-09-30 18:45:10 +0000
committerRobin Burchell w00t@inspircd.org <Robin Burchell w00t@inspircd.org@5417fbe8-f217-4b02-8779-1006273d7864>2008-09-30 18:45:10 +0000
commitb18604c31c0c5a4f3a4d08d8338985a0d311fa0a (patch)
tree66fc9c64fdf412cc43ed4ca763ceea806d4eddaa /src
parent4996cc4b06c70df801403752e90a7078224beb45 (diff)
Added chost variable to User class, stores cloaked host, used in inspircd11 module.
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@1212 5417fbe8-f217-4b02-8779-1006273d7864
Diffstat (limited to 'src')
-rw-r--r--src/protocol/inspircd11.c33
1 files changed, 18 insertions, 15 deletions
diff --git a/src/protocol/inspircd11.c b/src/protocol/inspircd11.c
index 026c345b2..a3569b2e4 100644
--- a/src/protocol/inspircd11.c
+++ b/src/protocol/inspircd11.c
@@ -459,6 +459,7 @@ void inspircd_set_umode(User * user, int ac, const char **av)
}
break;
case 'x':
+ if (add) user->chost = user->vhost;
update_host(user);
break;
}
@@ -538,9 +539,22 @@ void InspIRCdProto::cmd_topic(const char *whosets, const char *chan, const char
send_cmd(whosets, "FTOPIC %s %lu %s :%s", chan, static_cast<unsigned long>(when), whosetit, topic);
}
+/* CHGHOST */
+void inspircd_cmd_chghost(const char *nick, const char *vhost)
+{
+ if (has_chghostmod == 1) {
+ if (!nick || !vhost) {
+ return;
+ }
+ send_cmd(s_OperServ, "CHGHOST %s %s", nick, vhost);
+ } else {
+ anope_cmd_global(s_OperServ, "CHGHOST not loaded!");
+ }
+}
+
void InspIRCdProto::cmd_vhost_off(User *u)
{
- send_cmd(s_HostServ, "MODE %s -x", u->nick);
+ inspircd_cmd_chghost(u->nick, (u->mode & umodes['x']) ? u->chost.c_str() : u->host);
}
void InspIRCdProto::cmd_akill(const char *user, const char *host, const char *who, time_t when, time_t expires, const char *reason)
@@ -888,19 +902,6 @@ void inspircd_cmd_unsqline(const char *user)
send_cmd(s_OperServ, "QLINE %s", user);
}
-/* CHGHOST */
-void inspircd_cmd_chghost(const char *nick, const char *vhost)
-{
- if (has_chghostmod == 1) {
- if (!nick || !vhost) {
- return;
- }
- send_cmd(s_OperServ, "CHGHOST %s %s", nick, vhost);
- } else {
- anope_cmd_global(s_OperServ, "CHGHOST not loaded!");
- }
-}
-
/* CHGIDENT */
void inspircd_cmd_chgident(const char *nick, const char *vIdent)
{
@@ -1425,8 +1426,10 @@ int anope_event_nick(const char *source, int ac, const char **av)
source, /* server */
av[7], /* realname */
ts, svid, htonl(*ad), av[3], NULL);
- if (user)
+ if (user) {
anope_set_umode(user, 1, &av[5]);
+ user->chost = av[3];
+ }
}
} else {
do_nick(source, av[0], NULL, NULL, NULL, NULL, 0, 0, 0, NULL,