Changeset 1130
- Timestamp:
- 01/12/2015 02:53:22 PM (12 years ago)
- Location:
- sites/trunk/common/includes/slack/trac
- Files:
-
- 3 edited
-
comment-handler.php (modified) (5 diffs)
-
ticket.php (modified) (1 diff)
-
trac.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/common/includes/slack/trac/comment-handler.php
r1121 r1130 5 5 class Comment_Handler { 6 6 7 function __construct( Dotorg\Slack\Send $send, array $email_message ) {7 function __construct( \Dotorg\Slack\Send $send, array $email_message ) { 8 8 $this->send = $send; 9 9 $this->lines = $email_message; … … 19 19 20 20 $this->generate_payload(); 21 $this->send->send( $t rac->get_firehose_channel() );21 $this->send->send( $this->trac->get_firehose_channel() ); 22 22 } 23 23 … … 34 34 list( $trac_url, $ticket_id ) = explode( '/ticket/', $ticket_url ); 35 35 36 $trac = Dotorg\Slack\Trac::get( $trac_url );36 $trac = Trac::get( $trac_url ); 37 37 if ( ! $trac ) { 38 38 return false; … … 109 109 110 110 // Everything left is the comment. Remove leading space. 111 $comment = array_map( 'ltrim', $lines);111 $comment = implode( "\n", array_map( 'ltrim', $lines ) ); 112 112 113 113 $this->trac = $trac; … … 141 141 142 142 $comment = $this->format_comment_for_slack(); 143 $main_attachment = $this->changes ? $this->changes : $comment; 143 $main_attachment = $this->changes ? implode( "\n", $this->changes ) : $comment; 144 $pretext = sprintf( '*%s updated <%s|#%s %s>*', $this->author, $this->comment_url, $this->ticket_id, $this->title ); 144 145 $fallback = trim( $pretext, '*' ) . "\n" . $main_attachment; 145 $pretext = sprintf( '*%s updated <%s|#%s %s>*', $this->author, $this->comment_url, $this->ticket_id, $this->title );146 146 147 147 $attachment = array( -
sites/trunk/common/includes/slack/trac/ticket.php
r1121 r1130 73 73 74 74 static function get_ticket_fields( $ticket ) { 75 $new = false !== strpos( get_c lass( $this), 'New_Ticket' );75 $new = false !== strpos( get_called_class(), 'New_Ticket' ); 76 76 77 77 $ticket_fields = array(); -
sites/trunk/common/includes/slack/trac/trac.php
r1121 r1130 103 103 } 104 104 105 if ( preg_match( '~([a-z]+).trac.wordpress.org~', $ url, $match ) ) {105 if ( preg_match( '~([a-z]+).trac.wordpress.org~', $trac, $match ) ) { 106 106 $class = $ns . $match[1]; 107 107 if ( class_exists( $class ) ) {
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)