0xff, 0xff, 0xff, 0xff, 0xff, 0xff
};
-void _init(void) {
+static void relayfinishinit(int, void *);
+
+void relayfinishinit(int hooknum, void *arg) {
sstring *s;
+ deregisterhook(HOOK_CHANSERV_DBLOADED, relayfinishinit);
+
registercontrolhelpcmd("checkhashpass", NO_RELAY, 3, csa_docheckhashpass, "Usage: checkhashpass <username> <digest> ?junk?");
registercontrolhelpcmd("settempemail", NO_RELAY, 2, csa_dosettempemail, "Usage: settempemail <userid> <email address>");
registercontrolhelpcmd("setemail", NO_RELAY, 3, csa_dosetemail, "Usage: setmail <userid> <timestamp> <email address>");
freesstring(s);
}
+void _init(void) {
+ registerhook(HOOK_CHANSERV_DBLOADED, relayfinishinit);
+
+ if(chanservdb_ready)
+ relayfinishinit(HOOK_CHANSERV_DBLOADED, NULL);
+}
+
void _fini(void) {
deregistercontrolcmd("checkhashpass", csa_docheckhashpass);
deregistercontrolcmd("settempemail", csa_dosettempemail);
if(createaccountsecret_ok)
deregistercontrolcmd("createaccount", csa_docreateaccount);
+
+ deregisterhook(HOOK_CHANSERV_DBLOADED, relayfinishinit);
}
int csa_docheckhashpass(void *source, int cargc, char **cargv) {
error_password = "passwordlong";
} else if(r == QM_PWTOWEAK) {
error_password = "passwordweak";
+ } else if(r == QM_PWINVALID) {
+ error_password = "passwordinvalid";
} else if(r != -1) {
error_password = "passwordunknown";
}
cs_log(sender,"SETEMAIL OK username %s email %s",rup->username, rup->email->content);
csdb_updateuser(rup);
- sendemail(rup);
controlreply(sender, "SETEMAIL TRUE");
return CMD_ERROR;
}
- rcp = cs_addchan(cip, sender, rup, founder, QCFLAG_JOINED | QCFLAG_AUTOOP | QCFLAG_BITCH | QCFLAG_FORCETOPIC | QCFLAG_PROTECT | QCFLAG_TOPICSAVE, type);
+ rcp = cs_addchan(cip, sender, rup, founder, QCFLAG_JOINED | QCFLAG_AUTOOP | QCFLAG_BITCH | QCFLAG_FORCETOPIC | QCFLAG_PROTECT | QCFLAG_TOPICSAVE, CHANMODE_NOCTCP | CHANMODE_DELJOINS | CHANMODE_MODNOAUTH | CHANMODE_NONOTICE | CHANMODE_NOEXTMSG | CHANMODE_SINGLETARG | CHANMODE_TOPICLIMIT | CHANMODE_NOQUITMSG, 0, type);
if(!rcp) {
controlreply(sender, "ADDCHAN FALSE alreadyregistered");
return CMD_ERROR;