- rb_helper_write(authd_helper, "N %x :%s", auth->cid, notice);
+ char buf[BUFSIZE];
+ va_list args;
+
+ va_start(args, fmt);
+ vsnprintf(buf, sizeof(buf), fmt, args);
+ va_end(args);
+
+ /* We send back username and hostname in case ircd wants to overrule our decision.
+ * In the future this may not be the case.
+ * --Elizafox
+ */
+ rb_helper_write(authd_helper, "R %x %c %s %s %s :%s",
+ auth->cid, id != UINT32_MAX ? auth->data[id].provider->letter : '*',
+ auth->username, auth->hostname,
+ data == NULL ? "*" : data, buf);
+
+ if(id != UINT32_MAX)
+ set_provider_done(auth, id);
+
+ cancel_providers(auth);
+}
+
+/* Accept a client and cancel outstanding providers if any */
+void
+accept_client(struct auth_client *auth)
+{
+ rb_helper_write(authd_helper, "A %x %s %s", auth->cid, auth->username, auth->hostname);
+ cancel_providers(auth);