public static function get_reply_address($post_id, $user, $site_id = null)
{
if (!$site_id) {
$site_id = get_current_blog_id();
}
$address = self::get_option('bbsub_replyto', false);
if (empty($address)) {
throw new Exception(__('Invalid reply-to address', 'bbsub'));
}
// Append the plus address if it's not already there
if (strpos($address, '+') !== false) {
throw new Exception(__('Invalid reply-to address', 'bbsub'));
}
list($user_part, $host_part) = explode('@', $address);
$user_part .= '+%1$s-%2$d-%3$d-%4$s';
$address = $user_part . '@' . $host_part;
return sprintf($address, $post_id, $site_id, $user->ID, self::get_hash($post_id, $user, $site_id));
}