Changeset 9216
- Timestamp:
- 10/21/2019 06:00:38 AM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/common/includes/slack/announce/lib.php
r9121 r9216 110 110 // By sending the channel ID, we can post to private groups. 111 111 $send->send( $data['channel_id'] ); 112 113 // Broadcast this message as a non-@here to the "parent" channel too. 114 list( $parent_channel, ) = explode( '-', $channel, 2 ); 115 if ( 116 // Skip for private groups. 117 'privategroup' === $parent_channel || 118 // If this message was posted in the "parent" channel, nothing to do. 119 $parent_channel === $channel || 120 // Is it an actual channel? Assume that there'll always be at least one whitelisted user for the parent channel 121 ! get_whitelist_for_channel( $parent_channel ) 122 ) { 123 return; 124 } 125 126 $text = $data['text']; 127 // Remove any @here or @channel 128 $text = str_ireplace( [ '@here', '@channel', '@group' ], '', $text ); 129 if ( mb_strlen( $text ) > 103 ) { 130 $text = mb_subsr( $text, 0, 100 ) . '...'; 131 } 132 133 $send->set_text( 'In #' . $channel . ': ' . $text ); 134 $send->send( '#' . $parent_channel ); 135 112 136 } 113 137
Note: See TracChangeset
for help on using the changeset viewer.