Changeset 1787
- Timestamp:
- 07/26/2015 06:55:54 PM (9 years ago)
- Location:
- sites/trunk/api.wordpress.org/public_html/dotorg/slack
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/api.wordpress.org/public_html/dotorg/slack/announce.php
r1737 r1787 27 27 } 28 28 29 if ( $_POST['token'] !== WEBHOOK_TOKEN && $_POST['token'] !== WEBHOOK_TOKEN_ALT ) { 30 return; 29 $i = 0; 30 // WEBHOOK_TOKEN_1, WEBHOOK_TOKEN_2, etc. 31 while ( defined( __NAMESPACE__ . '\\WEBHOOK_TOKEN_' . ++$i ) ) { 32 if ( constant( __NAMESPACE__ . '\\WEBHOOK_TOKEN_' . $i ) === $_POST['token'] ) { 33 run( $_POST ); 34 } 31 35 } 32 36 33 run( $_POST ); 37 } 34 38 35 } -
sites/trunk/api.wordpress.org/public_html/dotorg/slack/committers.php
r1613 r1787 11 11 } 12 12 13 // These should be Slack usernames. 14 switch ( $_POST['channel_name'] ) { 15 case 'bbpress' : 16 case 'buddypress' : 17 case 'glotpress' : 18 return; 19 default: 20 $committers = array( 21 'westi', 'azaozz', 'nb', 'josephscott', 'dd32', 'nacin', 'koop', 'duck_', 22 'helen', 'sergey', 'ocean90', 'wonderboymusic', 'drew', 'mark', 'johnbillion', 23 'kovshenin', 'jorbin', 'boone', 'jeremyfelt', 'pento', 'obenland', 'iseulde', 24 'westonruter', 25 ); 26 break; 27 } 13 echo json_encode( array( 14 'username' => 'wordpressdotorg', 15 'link_names' => 1, 16 'text' => sprintf( '@%s: Use the `/committers` command.', $_POST['user_name'] ), 17 ) ); 28 18 29 if ( in_array( $_POST['user_name'], $committers, true ) ) { 30 $notify = array_diff( $committers, array( $_POST['user_name'] ) ); 31 $notify = '(cc: @' . implode( ' @', $notify ) . ')'; 32 echo json_encode( array( 'text' => $notify, 'username' => $_POST['user_name'], 'link_names' => 1 ) ); 33 } 19 exit;
Note: See TracChangeset
for help on using the changeset viewer.