- Timestamp:
- 02/02/2019 01:57:09 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/common/includes/slack/trac/commit-handler.php
r8180 r8181 36 36 37 37 protected function generate_payload() { 38 $author = $this->svnlook( 'author' );39 $log = Commit::format_commit_for_slack( $this->trac, $this->svnlook( 'log' ) );40 41 $url = $this->trac->get_commit_template( $this->rev );38 $author = $this->svnlook( 'author' ); 39 $log = Commit::format_commit_for_slack( $this->trac, $this->svnlook( 'log' ) ); 40 $date = $this->svnlook( 'date' ); 41 $url = $this->trac->get_commit_template( $this->rev ); 42 42 $revision = 'r' . $this->rev; 43 44 43 $username = $this->trac->get_commit_username(); 45 44 $icon = $this->trac->get_icon(); 46 45 $color = $this->trac->get_color(); 47 46 47 $title = "$username $revision"; 48 48 $text = "*$username <$url|$revision> by $author*\n$log"; 49 49 $fallback = "$username $revision by $author"; … … 52 52 $this->send->set_icon( $icon ); 53 53 $this->send->add_attachment( array( 54 'color' => $color, 55 'text' => $text, 56 'fallback' => $fallback, 57 'mrkdwn_in' => array( 'text' ), 54 'title' => $title, 55 'title_link' => $url, 56 'author_name' => $author, 57 'author_icon' => sprintf( 'https://wordpress.org/grav-redirect.php?user=%s&s=32', $author ), 58 'color' => $color, 59 'text' => $text, 60 'fallback' => $fallback, 61 'mrkdwn_in' => array( 'text' ), 62 'ts' => $date, 63 'footer' => sprintf( '<%s|%s>', $this->trac->get_url(), $this->trac->get_name() ), 64 'footer_icon' => sprintf( '%s/chrome/common/trac.ico', $this->trac->get_url() ), 58 65 ) ); 59 66 } … … 72 79 } 73 80 81 if ( $subcommand === 'date' ) { 82 // Convert output to timestamp. 83 $command = 'date --date "$( ' . $command . ' )" +%s'; 84 } 85 74 86 exec( $command, $output, $return_var ); 75 87 if ( $return_var === 0 ) {
Note: See TracChangeset
for help on using the changeset viewer.