joinbuf_init(&join, acptr, acptr, JOINBUF_TYPE_JOIN, 0, 0);
joinbuf_init(&create, acptr, acptr, JOINBUF_TYPE_CREATE, 0, TStime());
- flags = (chptr->users == 0) ? CHFL_CHANOP : CHFL_DEOPPED;
- if(chptr) joinbuf_join(&join, chptr, flags);
+ flags = (chptr->users == 0) ? CHFL_CHANOP | CHFL_CHANNEL_MANAGER : CHFL_DEOPPED;
+ if(chptr->users) joinbuf_join(&join, chptr, flags);
else joinbuf_join(&create, chptr, flags);
/* Send information to the user. */