/* proto-p10.c - IRC protocol output
* Copyright 2000-2004 srvx Development Team
*
- * This file is part of srvx.
+ * This file is part of x3.
*
* srvx is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
dict_insert(irc_func_dict, "401", cmd_dummy); /* target left network */
dict_insert(irc_func_dict, "403", cmd_dummy); /* no such channel */
dict_insert(irc_func_dict, "404", cmd_dummy); /* cannot send to channel */
+ dict_insert(irc_func_dict, "439", cmd_dummy); /* target change too fast */
dict_insert(irc_func_dict, "441", cmd_dummy); /* target isn't on that channel */
dict_insert(irc_func_dict, "442", cmd_dummy); /* you aren't on that channel */
dict_insert(irc_func_dict, "443", cmd_dummy); /* is already on channel (after invite?) */
if (!hostname)
hostname = self->name;
make_numeric(self, local_num, numeric);
+ /* TODO: Make these modes part of the conf file */
return AddUser(self, nick, nick, hostname, modes ? modes : "+oik", numeric, desc, now, "AAAAAA");
}
int
is_valid_nick(const char *nick) {
+ unsigned int ii;
/* IRC has some of The Most Fucked-Up ideas about character sets
* in the world.. */
if (!isalpha(*nick) && !strchr("{|}~[\\]^_`", *nick))
return 0;
- for (++nick; *nick; ++nick)
- if (!isalnum(*nick) && !strchr("{|}~[\\]^-_`", *nick))
+ for (ii = 0; nick[ii]; ++ii)
+ if (!isalnum(nick[ii]) && !strchr("{|}~[\\]^-_`", nick[ii]))
return 0;
if (strlen(nick) > nicklen)
return 0;
{
unsigned int n;
+ verify(user);
+
/* mark them as dead, in case anybody cares */
user->dead = 1;
+ /* remove pending adduser commands */
+ wipe_adduser_pending(NULL, user);
+
/* remove user from all channels */
while (user->channels.used > 0)
DelChannelUser(user, user->channels.list[user->channels.used-1]->channel, false, 0);
case 'Q': do_chan_mode(MODE_NOQUITMSGS); break;
case 'T': do_chan_mode(MODE_NOAMSG); break;
case 'O': do_chan_mode(MODE_OPERSONLY); break;
+ case 'Z': do_chan_mode(MODE_SSLONLY); break;
+ case 'z':
+ if (!(flags & MCP_REGISTERED)) {
+ do_chan_mode(MODE_REGISTERED);
+ } else {
+ mod_chanmode_free(change);
+ return NULL;
+ }
+ break;
// uncomment this when ssl is enabled on the network.
-// case 'z': do_chan_mode(MODE_SSLONLY); break;
+// case 'Z': do_chan_mode(MODE_SSLONLY); break;
#undef do_chan_mode
case 'l':
if (add) {
DO_MODE_CHAR(NOQUITMSGS, 'Q');
DO_MODE_CHAR(NOAMSG, 'T');
DO_MODE_CHAR(OPERSONLY, 'O');
- // uncomment this for ssl support
- //DO_MODE_CHAR(SSLONLY, 'z');
+ DO_MODE_CHAR(REGISTERED, 'z');
+ DO_MODE_CHAR(SSLONLY, 'Z');
#undef DO_MODE_CHAR
if (change->modes_clear & channel->modes & MODE_KEY)
mod_chanmode_append(&chbuf, 'k', channel->key);
DO_MODE_CHAR(NOQUITMSGS, 'Q');
DO_MODE_CHAR(NOAMSG, 'T');
DO_MODE_CHAR(OPERSONLY, 'O');
- // uncomment this for ssl support
- //DO_MODE_CHAR(SSLONLY, 'z');
+ DO_MODE_CHAR(REGISTERED, 'z');
+ DO_MODE_CHAR(SSLONLY, 'Z');
#undef DO_MODE_CHAR
if(change->modes_set & MODE_KEY)
mod_chanmode_append(&chbuf, 'k', change->new_key);
DO_MODE_CHAR(NOQUITMSGS, 'Q');
DO_MODE_CHAR(NOAMSG, 'T');
DO_MODE_CHAR(OPERSONLY, 'O');
- // uncomment this for ssl support
- //DO_MODE_CHAR(SSLONLY, 'z');
+ DO_MODE_CHAR(REGISTERED, 'z');
+ DO_MODE_CHAR(SSLONLY, 'Z');
#undef DO_MODE_CHAR
}
if (change->modes_set) {
DO_MODE_CHAR(NOQUITMSGS, 'Q');
DO_MODE_CHAR(NOAMSG, 'T');
DO_MODE_CHAR(OPERSONLY, 'O');
- // uncomment this for ssl support
- //DO_MODE_CHAR(SSLONLY, 'z');
+ DO_MODE_CHAR(REGISTERED, 'z');
+ DO_MODE_CHAR(SSLONLY, 'Z');
#undef DO_MODE_CHAR
switch (change->modes_set & (MODE_KEY|MODE_LIMIT)) {
case MODE_KEY|MODE_LIMIT:
case 'Q': remove |= MODE_NOQUITMSGS; break;
case 'T': remove |= MODE_NOAMSG; break;
case 'O': remove |= MODE_OPERSONLY; break;
+ case 'z': remove |= MODE_REGISTERED; break;
+ case 'Z': remove |= MODE_SSLONLY; break;
}
}