Making WordPress.org

Changeset 11875


Ignore:
Timestamp:
05/25/2022 12:39:36 AM (3 years ago)
Author:
dd32
Message:

Slack: Announce: Don' try to broadcast messages in private channels to the parent channel.

Some teams have private channels, which are in the format of #team-privatechannel, if there's any whitelisted users for the #team channel this would accidentally broadcast the private message publicly.
This has not been a problem in the past, as most private channels parent channels are also private (such as Security and Infrastructure related groups).

In an ideal world, we'd check to see if the channel status is the same (ie. if the parent channel was also private, we'd broadcast to that) but we don't have that information available in this handler.

See #4747.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/common/includes/slack/announce/lib.php

    r11308 r11875  
    205205    $send->send( $data['channel_id'] );
    206206
     207    // If it was broadcast in a private channel, don't try to broadcast to the public parent channel.
     208    if ( 'privategroup' === $channel ) {
     209        return;
     210    }
     211
    207212    // Broadcast this message as a non-@here to the "parent" channel too.
    208213    $parent_channel = get_parent_channel( $channel );
Note: See TracChangeset for help on using the changeset viewer.