diff --git a/include/channel.h b/include/channel.h index 12caaaf1..43054819 100644 --- a/include/channel.h +++ b/include/channel.h @@ -197,6 +197,8 @@ typedef int (*ExtbanFunc)(const char *data, struct Client *client_p, #define CHANROLE_MODE 0x010 /* Can change modes */ #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 HiddenChannel(x) ((x) && ((x)->mode.mode & MODE_PRIVATE)) #define PubChannel(x) ((!x) || ((x)->mode.mode &\ diff --git a/src/channel.c b/src/channel.c index 5a0c53de..6455fd54 100644 --- a/src/channel.c +++ b/src/channel.c @@ -237,7 +237,10 @@ add_user_to_channel(struct Channel *chptr, struct Client *client_p, int flags) msptr->flags = flags; /* Default to no chanroles until services says we're something else */ - msptr->roles = CHANROLE_UNSET; + if (flags == CHFL_CHANOP) + msptr->roles = CHANROLE_INITIAL; + else + msptr->roles = CHANROLE_UNSET; rb_dlinkAdd(msptr, &msptr->usernode, &client_p->user->channel); rb_dlinkAdd(msptr, &msptr->channode, &chptr->members);