Making WordPress.org


Ignore:
Timestamp:
08/29/2019 06:25:06 PM (6 years ago)
Author:
coreymckrill
Message:

Slack: Remove the /deputies command and related user list

This command is no longer used, since there is now a Communities Deputies
member group managed through the Slack interface.

File:
1 edited

Legend:

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

    r8068 r9121  
    8484    }
    8585
    86     if ( $data['command'] === '/deputies' ) {
    87         $pingable_deputies = get_pingable_wordcamp_deputies();
     86    if ( ! is_user_whitelisted( $user, $channel ) ) {
     87        show_authorization( $user, $channel );
     88        return;
     89    }
    8890
    89         if ( ! in_array( $user, $pingable_deputies, true ) ) {
    90             return;
    91         }
     91    $command = 'channel';
     92    if ( $data['command'] === '/here' ) {
     93        $command = 'here';
     94    } elseif ( $channel === 'privategroup' ) {
     95        // @channel and @group are interchangeable, but still.
     96        $command = 'group';
     97    }
    9298
    93         // TODO: Note that pinging users by `@username` is deprecated, and we have WordPress.org usernames in the above list.
    94         // This should be upadted to ping users by the `<@U.....>` format.
    95 
    96         $text = sprintf( "*/deputies:* %s\n_(CC: %s)_", $data['text'], '@' . implode( ', @', $pingable_deputies ) );
    97     } else {
    98         if ( ! is_user_whitelisted( $user, $channel ) ) {
    99             show_authorization( $user, $channel );
    100             return;
    101         }
    102 
    103         $command = 'channel';
    104         if ( $data['command'] === '/here' ) {
    105             $command = 'here';
    106         } elseif ( $channel === 'privategroup' ) {
    107             // @channel and @group are interchangeable, but still.
    108             $command = 'group';
    109         }
    110 
    111         $text = sprintf( "<!%s> %s", $command, $data['text'] );
    112     }
     99    $text = sprintf( "<!%s> %s", $command, $data['text'] );
    113100
    114101    $send = new Send( \Dotorg\Slack\Send\WEBHOOK );
Note: See TracChangeset for help on using the changeset viewer.