diff options
Diffstat (limited to 'contrib/m_change.c')
-rw-r--r-- | contrib/m_change.c | 36 |
1 files changed, 21 insertions, 15 deletions
diff --git a/contrib/m_change.c b/contrib/m_change.c index b81b137..2719858 100644 --- a/contrib/m_change.c +++ b/contrib/m_change.c @@ -41,7 +41,7 @@ #include "channel_mode.h" -static void +static int mo_chgident(struct Client *client_p, struct Client *source_p, int parc, char *parv[]) { @@ -51,7 +51,7 @@ mo_chgident(struct Client *client_p, struct Client *source_p, { sendto_one(source_p, form_str(ERR_NOPRIVS), me.name, source_p->name, "CHGIDENT"); - return; + return 0; } if (EmptyString(parv[2])) @@ -60,7 +60,7 @@ mo_chgident(struct Client *client_p, struct Client *source_p, target_p = source_p; if (!IsClient(target_p)) - return; + return 0; } else { target_p = hash_find_client(parv[1]); @@ -69,15 +69,15 @@ mo_chgident(struct Client *client_p, struct Client *source_p, { sendto_one(source_p, form_str(ERR_NOSUCHNICK), me.name, source_p->name, parv[1]); - return; + return 0; } } - if (strlen(parv[2]) > USERLEN || !*parv[2] || !valid_username(parv[2])) + if (strlen(parv[2]) > USERLEN || !*parv[2] || !valid_username(parv[2], 1)) { sendto_one(source_p, ":%s NOTICE %s :Invalid username", me.name, source_p->name); - return; + return 0; } if (IsUserHostIp(target_p)) @@ -105,9 +105,11 @@ mo_chgident(struct Client *client_p, struct Client *source_p, clear_ban_cache_client(target_p); } + + return 0; } -static void +static int mo_chghost(struct Client *client_p, struct Client *source_p, int parc, char *parv[]) { @@ -117,7 +119,7 @@ mo_chghost(struct Client *client_p, struct Client *source_p, { sendto_one(source_p, form_str(ERR_NOPRIVS), me.name, source_p->name, "CHGHOST"); - return; + return 0; } if (EmptyString(parv[2])) @@ -126,7 +128,7 @@ mo_chghost(struct Client *client_p, struct Client *source_p, target_p = source_p; if (!IsClient(target_p)) - return; + return 0; } else { target_p = hash_find_client(parv[1]); @@ -135,7 +137,7 @@ mo_chghost(struct Client *client_p, struct Client *source_p, { sendto_one(source_p, form_str(ERR_NOSUCHNICK), me.name, source_p->name, parv[1]); - return; + return 0; } } @@ -143,7 +145,7 @@ mo_chghost(struct Client *client_p, struct Client *source_p, { sendto_one(source_p, ":%s NOTICE %s :Invalid hostname", me.name, source_p->name); - return; + return 0; } if (IsUserHostIp(target_p)) @@ -171,9 +173,11 @@ mo_chghost(struct Client *client_p, struct Client *source_p, me.name, target_p->name, target_p->username, target_p->host); clear_ban_cache_client(target_p); } + + return 0; } -static void +static int mo_chgname(struct Client *client_p, struct Client *source_p, int parc, char *parv[]) { @@ -183,7 +187,7 @@ mo_chgname(struct Client *client_p, struct Client *source_p, { sendto_one(source_p, form_str(ERR_NOPRIVS), me.name, source_p->name, "CHGNAME"); - return; + return 0; } if (EmptyString(parv[2])) @@ -195,14 +199,14 @@ mo_chgname(struct Client *client_p, struct Client *source_p, { sendto_one(source_p, form_str(ERR_NOSUCHNICK), me.name, source_p->name, parv[1]); - return; + return 0; } if (strlen(parv[2]) > REALLEN || !*parv[2]) { sendto_one(source_p, ":%s NOTICE %s :Invalid realname", me.name, source_p->name); - return; + return 0; } if (parc > 3 && MyClient(source_p)) @@ -223,6 +227,8 @@ mo_chgname(struct Client *client_p, struct Client *source_p, if (MyClient(target_p) && IsClient(source_p)) sendto_one(target_p, ":%s NOTICE %s :Your realname is now [%s]", me.name, target_p->name, target_p->info); + + return 0; } static struct Message chgident_msgtab = { |