From 796258546e1c62f2f09b50ca352fe34f5b345f7a Mon Sep 17 00:00:00 2001 From: Joel Uckelman Date: Mon, 27 Feb 2012 05:55:37 +0100 Subject: Use new build_email_subject implementation for outgoing mail. --- src/PhpBB3ToMailman.php | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/src/PhpBB3ToMailman.php b/src/PhpBB3ToMailman.php index 9e90b28..2ef3c73 100644 --- a/src/PhpBB3ToMailman.php +++ b/src/PhpBB3ToMailman.php @@ -62,12 +62,24 @@ class PhpBB3ToMailman { $userName = $user->data['username']; $userEmail = $user->data['user_email']; - + $sender = 'forum-bridge@vassalengine.org'; - - $subject = html_entity_decode( - '[' . $post_data['forum_name'] . '] ' . $post_data['post_subject'], - ENT_QUOTES + + # determine if we are a reply + $is_reply = $mode == 'reply' || $mode == 'quote'; + if (!$is_reply) { + $firstId = $data['topic_first_post_id']; + $firstMessageId = $this->bridge->getMessageId($firstId); + if ($firstMessageId) { + $is_reply = true; + } + } + + $subject = build_email_subject( + '[' . html_entity_decode($post_data['forum_name'], ENT_QUOTES) . ']', + html_entity_decode($post_data['post_subject'], ENT_QUOTES), + $is_reply, + $mode == 'edit' ); $time = null; @@ -114,7 +126,6 @@ class PhpBB3ToMailman { $to, $sender, $subject, - $mode == 'edit', $time, $messageId, $forumURL, -- cgit v1.2.1