#include "msg.h"
#include "numeric.h"
#include "send.h"
+#include "s_auth.h"
#include "s_user.h"
#include <stdlib.h>
cap_ls(struct Client *sptr, const char *caplist)
{
if (IsUnknown(sptr)) /* registration hasn't completed; suspend it... */
- cli_unreg(sptr) |= CLIREG_CAP;
-
+ auth_cap_start(cli_auth(sptr));
return send_caplist(sptr, 0, 0, "LS"); /* send list of capabilities */
}
int neg;
if (IsUnknown(sptr)) /* registration hasn't completed; suspend it... */
- cli_unreg(sptr) |= CLIREG_CAP;
+ auth_cap_start(cli_auth(sptr));
memset(&set, 0, sizeof(set));
memset(&rem, 0, sizeof(rem));
(neg ? HasCap(sptr, cap->cap) : !HasCap(sptr, cap->cap))) /* uh... */
continue;
- if (neg) /* set or clear the active capability... */
+ if (neg) { /* set or clear the active capability... */
+ if (cap->flags & CAPFL_STICKY)
+ continue; /* but don't clear sticky capabilities */
CapClr(cli_active(sptr), cap->cap);
- else
+ } else {
+ if (cap->flags & CAPFL_PROHIBIT)
+ continue; /* and don't set prohibited ones */
CapSet(cli_active(sptr), cap->cap);
+ }
}
return 0;
if (!IsUnknown(sptr)) /* registration has completed... */
return 0; /* so just ignore the message... */
- cli_unreg(sptr) &= ~CLIREG_CAP; /* capability negotiation is now done... */
-
- if (!cli_unreg(sptr)) /* if client is now done... */
- return register_user(sptr, sptr, cli_name(sptr), cli_user(sptr)->username);
-
- return 0; /* Can't do registration yet... */
+ return auth_cap_done(cli_auth(sptr));
}
static int