chanroles: ENCAP GRANT should work under the assumption that we want to zero out

this makes setting new roles on a user much easier as we're just setting the roles they
should be having, instead of having to try to revoke roles we don't necessarily know
about.
This commit is contained in:
William Pitcock 2011-07-06 15:04:45 -05:00
parent ae79dab6ae
commit 460b6d9fb2

View file

@ -68,8 +68,8 @@ me_grant(struct Client *client_p, struct Client *source_p, int parc, const char
if (!(msptr = find_channel_membership(chptr, target_p))) if (!(msptr = find_channel_membership(chptr, target_p)))
return 0; return 0;
/* Unset */ /* unset all chanroles as we're setting new ones */
RemoveChanRole(msptr, CHANROLE_UNSET); msptr->roles = 0;
t = LOCAL_COPY(parv[3]); t = LOCAL_COPY(parv[3]);
for (s = rb_strtok_r(t, " ", &p); s; s = rb_strtok_r(NULL, " ", &p)) for (s = rb_strtok_r(t, " ", &p); s; s = rb_strtok_r(NULL, " ", &p))