
--- src/channel.c | 42 +++++++++++++++++++++++++++++------------- 1 files changed, 29 insertions(+), 13 deletions(-) diff --git a/src/channel.c b/src/channel.c index 40c14ae..6e1fe7c 100644 --- a/src/channel.c +++ b/src/channel.c @@ -1237,24 +1237,14 @@ static void channel_modes(aClient *cptr, char *mbuf, char *pbuf, if (chptr->mode.limit) { *mbuf++ = 'l'; - if (IsMember(cptr, chptr) || IsServer(cptr) || IsULine(cptr)) + if (IsMember(cptr, chptr) || IsServer(cptr) || IsULine(cptr) || IsOper(cptr)) ircsprintf(pbuf, "%d", chptr->mode.limit); } - if (*chptr->mode.key) - { - *mbuf++ = 'k'; - if (IsMember(cptr, chptr) || IsServer(cptr) || IsULine(cptr)) - { - if(pbuf[0] != '\0') - strcat(pbuf, " "); - strcat(pbuf, chptr->mode.key); - } - } if (chptr->mode.mode & MODE_JOINRATE) { *mbuf++ = 'j'; - if (IsMember(cptr, chptr) || IsServer(cptr) || IsULine(cptr)) + if (IsMember(cptr, chptr) || IsServer(cptr) || IsULine(cptr) || IsOper(cptr)) { char tmp[16]; if(pbuf[0] != '\0') @@ -1269,6 +1259,24 @@ static void channel_modes(aClient *cptr, char *mbuf, char *pbuf, strcat(pbuf, tmp); } } + if (*chptr->mode.key) + { + *mbuf++ = 'k'; + if (IsMember(cptr, chptr) || IsServer(cptr) || IsULine(cptr)) + { + if(pbuf[0] != '\0') + strcat(pbuf, " "); + strcat(pbuf, chptr->mode.key); + } else + { + if (IsOper(cptr)) + { + if (pbuf[0] != '\0') + strcat(pbuf, " "); + strcat(pbuf, "*"); + } + } + } *mbuf++ = '\0'; return; } @@ -3426,7 +3434,15 @@ int m_topic(aClient *cptr, aClient *sptr, int parc, char *parv[]) sendto_one(sptr, err_str(ERR_CHANOPRIVSNEEDED), me.name, parv[0], chptr->chname); return 0; - } + } else + { + //Can't change topic on -t channels if not opped and banned. + if (!(chptr->mode.mode & MODE_TOPICLIMIT) && is_banned(sptr, chptr, NULL) && !is_chan_op(sptr, chptr)) + { + sendto_one(sptr, err_str(ERR_CHANOPRIVSNEEDED), me.name, parv[0], chptr->chname); + return 0; + } + } } else { -- 1.7.2.5