/*
* mr_pass - registration message handler
*/
-int m_pass(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
+int mr_pass(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
{
const char* password = parc > 1 ? parv[1] : 0;
if (EmptyString(password))
return need_more_params(cptr, "PASS");
- ircd_strncpy(cptr->passwd, password, PASSWDLEN);
+ /* TODO: For protocol negotiation */
+#if 0
+ if (ircd_strcmp(password,"PROT")==0) {
+ /* Do something here */
+ }
+#endif
+ ircd_strncpy(cli_passwd(cptr), password, PASSWDLEN);
return 0;
}
if (!MyConnect(sptr) || (!IsUnknown(cptr) && !IsHandshake(cptr)))
{
- sendto_one(cptr, err_str(ERR_ALREADYREGISTRED), me.name, parv[0]);
+ sendto_one(cptr, err_str(ERR_ALREADYREGISTRED), me.name, parv[0]); /* XXX DEAD */
return 0;
}
+ if (ircd_strcmp("PROTO",password)) {
+ proto_send_supported(sptr);
+ return 0;
+ }
ircd_strncpy(cptr->passwd, password, PASSWDLEN);
return 0;
}