Show mode parameters when an IRCOp does MODE #channel, that is:

for a channel they are not in, if they have the channel:see:mode:remote
permission. This permission is included in all operclasses by default,
just like how this is already the case for channel:see:mode:remotebanlist
and other related permissions.

Reported by alice.
pull/49/head
Bram Matthys 7 months ago
parent bfcde12338
commit 8fae1d9306
No known key found for this signature in database
GPG Key ID: BF8116B163EAAE98

@ -614,14 +614,17 @@ Cmode_t get_extmode_bitbychar(char m)
*/
void channel_modes(Client *client, char *mbuf, char *pbuf, size_t mbuf_size, size_t pbuf_size, Channel *channel, int hide_local_modes)
{
int ismember = 0;
int show_mode_parameters = 0;
Cmode *cm;
if (!mbuf_size || !pbuf_size)
return;
if (!client || IsMember(client, channel) || IsServer(client) || IsMe(client) || IsULine(client))
ismember = 1;
if (!client || IsMember(client, channel) || IsServer(client) || IsMe(client) || IsULine(client) ||
ValidatePermissionsForPath("channel:see:mode:remote",client,NULL,channel,NULL))
{
show_mode_parameters = 1;
}
*pbuf = '\0';
strlcpy(mbuf, "+", mbuf_size);
@ -637,7 +640,7 @@ void channel_modes(Client *client, char *mbuf, char *pbuf, size_t mbuf_size, siz
if (mbuf_size)
strlcat_letter(mbuf, flag, mbuf_size);
if (cm->paracount && ismember)
if (cm->paracount && show_mode_parameters)
{
strlcat(pbuf, cm_getparameter(channel, flag), pbuf_size);
strlcat(pbuf, " ", pbuf_size);

Loading…
Cancel
Save