diff options
author | Robin Burchell w00t@inspircd.org <Robin Burchell w00t@inspircd.org@5417fbe8-f217-4b02-8779-1006273d7864> | 2008-09-30 18:45:10 +0000 |
---|---|---|
committer | Robin Burchell w00t@inspircd.org <Robin Burchell w00t@inspircd.org@5417fbe8-f217-4b02-8779-1006273d7864> | 2008-09-30 18:45:10 +0000 |
commit | b18604c31c0c5a4f3a4d08d8338985a0d311fa0a (patch) | |
tree | 66fc9c64fdf412cc43ed4ca763ceea806d4eddaa | |
parent | 4996cc4b06c70df801403752e90a7078224beb45 (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
-rw-r--r-- | include/users.h | 7 | ||||
-rw-r--r-- | src/protocol/inspircd11.c | 33 |
2 files changed, 22 insertions, 18 deletions
diff --git a/include/users.h b/include/users.h index a1136e321..b27895dfd 100644 --- a/include/users.h +++ b/include/users.h @@ -5,8 +5,8 @@ * Please read COPYING and README for further details. * * Based on the original code of Epona by Lara. - * Based on the original code of Services by Andy Church. - * + * Based on the original code of Services by Andy Church. + * * $Id$ * */ @@ -33,6 +33,7 @@ class User char *host; /* User's real hostname */ char *hostip; /* User's IP number */ char *vhost; /* User's virtual hostname */ + std::string chost; /* User's cloaked hostname */ char *vident; /* User's virtual ident */ char *realname; /* Realname */ Server *server; /* Server user is connected to */ @@ -45,7 +46,7 @@ class User NickAlias *na; - ModuleData *moduleData; /* defined for it, it should allow the module Add/Get */ + ModuleData *moduleData; /* defined for it, it should allow the module Add/Get */ int isSuperAdmin; /* is SuperAdmin on or off? */ 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, |