Changeset 1788
- Timestamp:
- 07/26/2015 07:07:47 PM (9 years ago)
- Location:
- sites/trunk/common/includes/slack
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/common/includes/slack/announce/config.php
r1766 r1788 87 87 ); 88 88 } 89 90 function get_committers() { 91 return array( 92 'dd32', 'nacin', 'mark', 'helen', 'azaozz', 'westi', 93 'nb', 'sergey', 'ocean90', 'wonderboymusic', 'drew', 'johnbillion', 94 'jorbin', 'boone', 'jeremyfelt', 'pento', 'obenland', 'iseulde', 95 'westonruter', 96 ); 97 } 98 -
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'; -
sites/trunk/common/includes/slack/send.php
r1121 r1788 77 77 'username' => $this->get_username(), 78 78 'attachments' => $this->get_attachments(), 79 'link_names' => 1, 79 80 ); 80 81
Note: See TracChangeset
for help on using the changeset viewer.