Making WordPress.org

Changeset 12761


Ignore:
Timestamp:
07/26/2023 07:13:49 AM (3 years ago)
Author:
dd32
Message:

Slack: Don't send /here broadcasts to parent channels for certain groups, as it causes confusion.

Location:
sites/trunk/common/includes/slack/announce
Files:
2 edited

Legend:

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

    r12738 r12761  
    9696            'sippis',
    9797        ),
     98        'contributor-mentorship' => $wordcamp_central,
    9899        'core' => array_merge( get_committers(), array(
    99100            'amykamala', // @amy kamala on Slack
  • sites/trunk/common/includes/slack/announce/lib.php

    r12738 r12761  
    143143            $root = 'contributor-mentorship';
    144144            break;
    145         case 'contributor': // Such as #contributor-mentorship
    146145        case 'community':
    147146            $root = 'community-team';
     
    173172    }
    174173
    175     // Recurse, in case the parent channel has a parent channel.
    176     // ie. #mentorship-cohort-july-2023 => #contributor-mentorship => #community-team
    177     foreach ( $parent_channels as $parent_channel ) {
    178         $parent_channels = array_merge( $parent_channels, get_parent_channels( $parent_channel ) ?: [] );
    179     }
    180 
    181174    return array_unique( $parent_channels ) ?: false;
    182175}
     
    291284    }
    292285
     286    // Don't send to these parent channels.
     287    $dont_send_to = [
     288        'contributor-mentorship',
     289    ];
     290
    293291    $text = $data['text'];
    294292    // Remove any @here or @channel
     
    299297
    300298    foreach ( $parent_channels as $parent_channel ) {
     299        if ( in_array( $parent_channel, $dont_send_to, true ) ) {
     300            continue;
     301        }
     302
    301303        $send->set_text( 'In #' . $channel . ': ' . $text );
    302304        $send->send( '#' . $parent_channel );
Note: See TracChangeset for help on using the changeset viewer.