Changeset 1788 for sites/trunk/common/includes/slack/announce/lib.php
- Timestamp:
- 07/26/2015 07:07:47 PM (10 years ago)
- File:
-
- 1 edited
-
sites/trunk/common/includes/slack/announce/lib.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/common/includes/slack/announce/lib.php
r1738 r1788 67 67 } 68 68 69 if ( ! is_user_whitelisted( $user, $channel ) ) { 70 return; 69 if ( $data['command'] === '/committers' ) { 70 $committers = get_committers(); 71 if ( ! in_array( $user, $committers, true ) ) { 72 return; 73 } 74 75 $text = sprintf( "*@committers:* %s\n_(cc: %s)_", $data['text'], '@' . implode( ', @', $committers ) ); 76 } else { 77 if ( ! is_user_whitelisted( $user, $channel ) ) { 78 return; 79 } 80 81 $command = 'channel'; 82 if ( $data['command'] === '/here' ) { 83 $command = 'here'; 84 } elseif ( $channel === 'privategroup' ) { 85 // @channel and @group are interchangeable, but still. 86 $command = 'group'; 87 } 88 89 $text = sprintf( "<!%s> %s", $command, $data['text'] ); 71 90 } 72 91 73 92 $send = new Send( \Dotorg\Slack\Send\WEBHOOK ); 74 93 $send->set_username( $user ); 75 76 $command = 'channel'; 77 if ( $data['command'] === '/here' ) { 78 $command = 'here'; 79 } elseif ( $channel === 'privategroup' ) { 80 // @channel and @group are interchangeable, but still. 81 $command = 'group'; 82 } 83 84 $send->set_text( sprintf( "<!%s> %s", $command, $data['text'] ) ); 94 $send->set_text( $text ); 85 95 86 96 $get_avatar = __NAMESPACE__ . '\\' . 'get_avatar';
Note: See TracChangeset
for help on using the changeset viewer.