Making WordPress.org


Ignore:
Timestamp:
04/08/2018 11:43:27 AM (7 years ago)
Author:
ocean90
Message:

Slack/Trac: Add support for attachment notification mails.

See #3526.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/svn.wordpress.org/bin/slack-trac-hook.php

    r3062 r7064  
    2424    $ticket_base_url = $matches[3];
    2525    $ticket = $matches[4];
    26     $type = isset( $matches[5] ) ? 'comment' : 'ticket';
     26    // Attachment notifcations use the ticket URL, check for attachment change line and process mail as comment on match.
     27    $is_attachment = (bool) preg_grep( '/^ \* Attachment "([^"]+)"/', $lines );
     28    $type = ( isset( $matches[5] ) || $is_attachment ) ? 'comment' : 'ticket';
    2729    preg_match( '~^https?://([^.]+)\.trac~i', $ticket_base_url, $matches );
    2830    $trac = $matches[1];
Note: See TracChangeset for help on using the changeset viewer.