diff options
author | DukePyrolator <DukePyrolator@anope.org> | 2013-06-21 07:42:09 +0200 |
---|---|---|
committer | DukePyrolator <DukePyrolator@anope.org> | 2013-06-21 07:42:09 +0200 |
commit | 27dde3266c8809edd522d6a95ce0c1262e5cae0e (patch) | |
tree | 16fc3f998b9967067a2235766560b287d470945e /src | |
parent | f1c3f0d820caedfd7667c09bd06f60b9c23283d9 (diff) |
updated Hybrid protocol module to support vhosts
Diffstat (limited to 'src')
-rw-r--r-- | src/protocol/hybrid.c | 38 | ||||
-rw-r--r-- | src/protocol/hybrid.h | 8 |
2 files changed, 32 insertions, 14 deletions
diff --git a/src/protocol/hybrid.c b/src/protocol/hybrid.c index c9b6ccdd7..965920af3 100644 --- a/src/protocol/hybrid.c +++ b/src/protocol/hybrid.c @@ -1,7 +1,7 @@ /* ircd-hybrid-8 protocol module * * (C) 2003-2013 Anope Team - * (C) 2012 by the Hybrid Development Team + * (C) 2012-2013 by the Hybrid Development Team * * Please read COPYING and README for further details. * @@ -38,10 +38,10 @@ IRCDVar myIrcd[] = { "+io", /* Global alias mode */ "+", /* Used by BotServ Bots */ 3, /* Chan Max Symbols */ - "-ilmnpstORS", /* Modes to Remove */ + "-cilmnpstMORS", /* Modes to Remove */ "+o", /* Channel Umode used by Botserv bots */ 1, /* SVSNICK */ - 0, /* Vhost */ + 1, /* Vhost */ 0, /* Has Owner */ NULL, /* Mode to set for an owner */ NULL, /* Mode to unset for an owner */ @@ -74,7 +74,7 @@ IRCDVar myIrcd[] = { CMODE_r, /* Channel Mode */ 0, /* vidents */ 0, /* svshold */ - 0, /* time stamp on mode */ + 1, /* time stamp on mode */ 0, /* NICKIP */ 0, /* UMODE */ 0, /* O:LINE */ @@ -83,7 +83,7 @@ IRCDVar myIrcd[] = { CMODE_p, /* No Knock */ 0, /* Admin Only */ DEFAULT_MLOCK, /* Default MLOCK */ - 0, /* Vhost Mode */ + UMODE_x, /* Vhost Mode */ 0, /* +f */ 0, /* +L */ 0, /* +f Mode */ @@ -100,7 +100,7 @@ IRCDVar myIrcd[] = { 0, /* SJOIN invite char */ 0, /* Can remove User Channel Modes with SVSMODE */ 0, /* Sglines are not enforced until user reconnects */ - NULL, /* vhost char */ + "x", /* vhost char */ 0, /* ts6 */ 0, /* support helper umode */ 0, /* p10 */ @@ -161,6 +161,7 @@ void hybrid_set_umode(User *user, int ac, char **av) alog("debug: Changing mode for %s to %s", user->nick, modes); while (*modes) { + uint32 backup = user->mode; /* This looks better, much better than "add ? (do_add) : (do_remove)". * At least this is readable without paying much attention :) -GD @@ -178,6 +179,8 @@ void hybrid_set_umode(User *user, int ac, char **av) add = 0; break; case 'd': + user->mode = backup; + if (ac == 0) { alog("user: umode +d with no parameter (?) for user %s", user->nick); @@ -208,7 +211,16 @@ void hybrid_set_umode(User *user, int ac, char **av) user->mode &= ~UMODE_r; } break; + case 'x': + if (!add) { + if (user->vhost) { + free(user->vhost); + user->vhost = NULL; + } + } + update_host(user); + break; } } } @@ -711,14 +723,20 @@ void hybrid_cmd_topic(char *whosets, char *chan, char *whosetit, send_cmd(whosets, "TOPIC %s :%s", chan, topic); } -void hybrid_cmd_vhost_off(User * u) +void hybrid_cmd_vhost_off(User *user) { - /* Not Supported by this IRCD */ + common_svsmode(user, "-x", user->host); + notice_lang(s_HostServ, user, HOST_OFF); } void hybrid_cmd_vhost_on(char *nick, char *vIdent, char *vhost) { - /* Not Supported by this IRCD */ + User *user = finduser(nick); + + if (!user) + return; + + common_svsmode(user, "+x", vhost); } void hybrid_cmd_join(char *user, char *channel, time_t chantime) @@ -1557,7 +1575,7 @@ int AnopeInit(int argc, char **argv) moduleAddVersion(VERSION_STRING); moduleSetType(PROTOCOL); - pmodule_ircd_version("Hybrid 8.0.*"); + pmodule_ircd_version("Hybrid 8.1.*"); pmodule_ircd_cap(myIrcdcap); pmodule_ircd_var(myIrcd); pmodule_ircd_cbmodeinfos(myCbmodeinfos); diff --git a/src/protocol/hybrid.h b/src/protocol/hybrid.h index 561822fe5..a1d83b987 100644 --- a/src/protocol/hybrid.h +++ b/src/protocol/hybrid.h @@ -1,13 +1,13 @@ /* Hybrid IRCD functions * * (C) 2003-2013 Anope Team - * (C) 2012 by the Hybrid Development Team + * (C) 2012-2013 by the Hybrid Development Team * * 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. + * * */ @@ -26,7 +26,7 @@ #define UMODE_s 0x00008000 /* See general server notices */ #define UMODE_u 0x00010000 /* See unauthorized client notices */ #define UMODE_w 0x00000020 /* See server generated WALLOPS */ -#define UMODE_x 0x00020000 /* See remote server connection and split notices */ +#define UMODE_x 0x00020000 /* Host name is hidden */ #define UMODE_y 0x00040000 /* See LINKS, STATS (if configured), TRACE notices */ #define UMODE_z 0x00080000 /* See oper generated WALLOPS */ #define UMODE_R 0x80000000 /* unmode +R - No non registered msgs */ |