X-Git-Url: https://jfr.im/git/irc/evilnet/x3.git/blobdiff_plain/d914d1cbfd541d1c1302ac989a8c5b7d57d25f55..0f3e9cfc4b5d0f13085c975e10c0e6c4c8e5fbc3:/src/proto-p10.c diff --git a/src/proto-p10.c b/src/proto-p10.c index 72936b8..580cbc5 100644 --- a/src/proto-p10.c +++ b/src/proto-p10.c @@ -306,6 +306,7 @@ static unsigned int num_notice_funcs; static struct dict *unbursted_channels; static char *his_servername; static char *his_servercomment; +static int extended_accounts; static struct userNode *AddUser(struct server* uplink, const char *nick, const char *ident, const char *hostname, const char *modes, const char *numeric, const char *userinfo, time_t timestamp, const char *realip); @@ -437,19 +438,24 @@ irc_user(struct userNode *user) void irc_rename(struct userNode *user, const char *new_handle) { - putsock("%s " P10_ACCOUNT " %s M %s", self->numeric, user->numeric, new_handle); + if(extended_accounts) + putsock("%s " P10_ACCOUNT " %s M %s", self->numeric, user->numeric, new_handle); } void irc_delete(struct userNode *user) { - putsock("%s " P10_ACCOUNT " %s U", self->numeric, user->numeric); + if(extended_accounts) + putsock("%s " P10_ACCOUNT " %s U", self->numeric, user->numeric); } void irc_account(struct userNode *user, const char *stamp, time_t timestamp) { - putsock("%s " P10_ACCOUNT " %s R %s %lu", self->numeric, user->numeric, stamp, timestamp); + if(extended_accounts) + putsock("%s " P10_ACCOUNT " %s R %s %lu", self->numeric, user->numeric, stamp, timestamp); + else + putsock("%s " P10_ACCOUNT " %s %s %lu", self->numeric, user->numeric, stamp, timestamp); } void @@ -573,10 +579,10 @@ irc_introduce(const char *passwd) } void -irc_gline(struct server *srv, struct gline *gline) +irc_gline(struct server *srv, struct gline *gline, int silent) { - putsock("%s " P10_GLINE " %s +%s %ld :<%s> %s", - self->numeric, (srv ? srv->numeric : "*"), gline->target, gline->expires-now, gline->issuer, gline->reason); + putsock("%s " P10_GLINE " %s +%s %ld :%s<%s> %s", + self->numeric, (srv ? srv->numeric : "*"), gline->target, gline->expires-now, silent ? "AUTO " : "", gline->issuer, gline->reason); } void @@ -1103,6 +1109,9 @@ static CMD_FUNC(cmd_account) user = GetUserN(argv[1]); if (!user) return 1; /* A QUIT probably passed the ACCOUNT. */ + + if(!extended_accounts) /* any need for this function without? */ + return 1; if(!strcmp(argv[2],"C")) { @@ -1431,7 +1440,7 @@ static CMD_FUNC(cmd_num_gline) { if (argc < 6) return 0; - gline_add(origin, argv[3], atoi(argv[4])-now, argv[5], now, 0); + gline_add(origin, argv[3], atoi(argv[4])-now, argv[5], now, 0, 0); return 1; } @@ -1572,7 +1581,7 @@ static CMD_FUNC(cmd_gline) if (argv[2][0] == '+') { if (argc < 5) return 0; - gline_add(origin, argv[2]+1, strtoul(argv[3], NULL, 0), argv[argc-1], now, 0); + gline_add(origin, argv[2]+1, strtoul(argv[3], NULL, 0), argv[argc-1], now, 0, 0); return 1; } else if (argv[2][0] == '-') { gline_remove(argv[2]+1, 0); @@ -1652,6 +1661,8 @@ init_parse(void) char numer[COMBO_NUMERIC_LEN+1]; /* read config items */ + str = conf_get_data("server/extended_accounts", RECDB_QSTRING); + extended_accounts = str ? enabled_string(str) : 1; str = conf_get_data("server/ping_freq", RECDB_QSTRING); ping_freq = str ? ParseInterval(str) : 120; str = conf_get_data("server/ping_timeout", RECDB_QSTRING);