Making WordPress.org


Ignore:
Timestamp:
10/24/2019 04:06:42 AM (4 years ago)
Author:
dd32
Message:

Slack: Thread trac-bot ticket responses.

When a ticket is referenced within a thread, trac-bot will no longer send it to the global channel (often wtihout any context).

There's an option to reply in-thread, but also to broadcast to the wider channel, but thought that best to avoid for now.
Unfortunately the slack outgoing-webhook implementation doesn't announce whether the threaded message we're being triggered by was broadcast or not.

Fixes #2555.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/common/includes/slack/send.php

    r1788 r9228  
    101101    }
    102102
    103     function send( $channel ) {
     103    function send( $channel, $thread = false ) {
    104104        if ( $this->testing() ) {
    105105            $this->set_text( "[$channel] " . $this->get_text() );
     
    109109        $payload = $this->get_payload();
    110110        $payload['channel'] = $channel;
     111
     112        if ( $thread ) {
     113            $payload['thread_ts'] = $thread;
     114
     115            // Setting this to true will broacast a threaded reply to the channel too.
     116            // Since outgoing webhooks don't send the broadcast status, this is skipped for now.
     117            // $payload['reply_broadcast'] = true;
     118        }
    111119
    112120        # error_log( print_r( $payload, true ) );
Note: See TracChangeset for help on using the changeset viewer.