Skip to content

Commit

Permalink
Revert "Add "Message-ID" email header to outgoing reply-by-emails."
Browse files Browse the repository at this point in the history
This reverts commit bce67d5.
  • Loading branch information
r-a-y committed Jun 12, 2014
1 parent 9a70786 commit 0b21361
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 30 deletions.
33 changes: 6 additions & 27 deletions bp-rbe-core.php
Expand Up @@ -280,17 +280,6 @@ public function wp_mail_filter( $args ) {
// Don't like this? there's a filter for that!
$querystring = apply_filters( 'bp_rbe_encode_querystring', bp_rbe_encode( array( 'string' => $querystring ) ), $querystring );

// Set the 'Message-Id' header
// This is used to enable message threading in email clients
if ( ! empty( $listener->reply_to_id ) ) {
$reply_to_id = $listener->reply_to_id;
} elseif ( ! empty( $listener->secondary_item_id ) ) {
$reply_to_id = $listener->secondary_item_id;
} else {
$reply_to_id = $listener->item_id;
}
$args['headers'] .= 'Message-ID: <' . md5( $querystring . $reply_to_id ) . '@' . esc_url( $_SERVER['SERVER_NAME'] ) . '>' . PHP_EOL;

// Inject the querystring into the email address
$args['headers'] .= 'Reply-To: ' . bp_rbe_inject_qs_in_email( $querystring ) . PHP_EOL;

Expand Down Expand Up @@ -360,11 +349,6 @@ public function activity_listener( $item ) {
break;
}

// reply-to id fallback
if ( empty( $this->listener->reply_to_id ) ) {
$this->listener->reply_to_id = ! empty( $this->listener->secondary_item_id ) ? $this->listener->secondary_item_id : $this->listener->item_id;
}

}

/**
Expand Down Expand Up @@ -405,9 +389,6 @@ public function group_forum_listener( $post_id ) {
// @see BP_Reply_By_Email::get_temporary_variables()
// @see BP_Reply_By_Email::set_group_id()
$this->listener->secondary_item_id = bp_get_current_group_id();

// reply-to ID
$this->listener->reply_to_id = $post_id;
}

/**
Expand All @@ -422,10 +403,9 @@ public function message_listener( $item ) {

$this->listener = new stdClass;

$this->listener->component = $bp->messages->id;
$this->listener->item_id = $item->thread_id;
$this->listener->user_id = $item->sender_id;
$this->listener->reply_to_id = $item->id;
$this->listener->component = $bp->messages->id;
$this->listener->item_id = $item->thread_id;
$this->listener->user_id = $item->sender_id;
}

/**
Expand All @@ -447,9 +427,8 @@ public function message_listener( $item ) {
public function bbp_listener( $reply_id, $topic_id ) {
$this->listener = new stdClass;

$this->listener->component = 'bbpress';
$this->listener->item_id = $topic_id;
$this->listener->reply_to_id = $reply_id;
$this->listener->component = 'bbpress';
$this->listener->item_id = $topic_id;
}

/**
Expand Down Expand Up @@ -708,4 +687,4 @@ public function disable_non_rbe_notice( $retval, $args ) {

return $retval;
}
}
}
3 changes: 0 additions & 3 deletions includes/bp-rbe-extend-bbpress.php
Expand Up @@ -121,9 +121,6 @@ public function extend_activity_listener( $listener, $item ) {
// setup our secondary item ID, which is the topic ID
$listener->secondary_item_id = $item->secondary_item_id;

// setup reply-to ID, which is the post ID
$listener->reply_to_id = $item->secondary_item_id;

// if activity type is a bbPress reply, we need to grab the topic ID manually
if ( $item->type == $this->activity_type ) {
global $bp;
Expand Down

1 comment on commit 0b21361

@r-a-y
Copy link
Owner Author

@r-a-y r-a-y commented on 0b21361 Jun 12, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to do further testing with the "Message-ID", "In-Reply-To" and "References" email headers.

Please sign in to comment.