chanroles: grant initial set of flags to people added to a channel with CHFL_CHANOP.
this allows us to, later on, add a hook that will enable us to disable channel ops entirely without causing permissions revocation.
This commit is contained in:
parent
6d8ec56083
commit
ae79dab6ae
2 changed files with 6 additions and 1 deletions
|
@ -197,6 +197,8 @@ typedef int (*ExtbanFunc)(const char *data, struct Client *client_p,
|
||||||
#define CHANROLE_MODE 0x010 /* Can change modes */
|
#define CHANROLE_MODE 0x010 /* Can change modes */
|
||||||
#define CHANROLE_TOPIC 0x020 /* Can change topic */
|
#define CHANROLE_TOPIC 0x020 /* Can change topic */
|
||||||
|
|
||||||
|
#define CHANROLE_INITIAL (CHANROLE_KICK | CHANROLE_STATUS | CHANROLE_GRANT | CHANROLE_MODE | CHANROLE_TOPIC)
|
||||||
|
|
||||||
#define SecretChannel(x) ((x) && ((x)->mode.mode & MODE_SECRET))
|
#define SecretChannel(x) ((x) && ((x)->mode.mode & MODE_SECRET))
|
||||||
#define HiddenChannel(x) ((x) && ((x)->mode.mode & MODE_PRIVATE))
|
#define HiddenChannel(x) ((x) && ((x)->mode.mode & MODE_PRIVATE))
|
||||||
#define PubChannel(x) ((!x) || ((x)->mode.mode &\
|
#define PubChannel(x) ((!x) || ((x)->mode.mode &\
|
||||||
|
|
|
@ -237,6 +237,9 @@ add_user_to_channel(struct Channel *chptr, struct Client *client_p, int flags)
|
||||||
msptr->flags = flags;
|
msptr->flags = flags;
|
||||||
|
|
||||||
/* Default to no chanroles until services says we're something else */
|
/* Default to no chanroles until services says we're something else */
|
||||||
|
if (flags == CHFL_CHANOP)
|
||||||
|
msptr->roles = CHANROLE_INITIAL;
|
||||||
|
else
|
||||||
msptr->roles = CHANROLE_UNSET;
|
msptr->roles = CHANROLE_UNSET;
|
||||||
|
|
||||||
rb_dlinkAdd(msptr, &msptr->usernode, &client_p->user->channel);
|
rb_dlinkAdd(msptr, &msptr->usernode, &client_p->user->channel);
|
||||||
|
|
Loading…
Reference in a new issue