diff options
author | Joel Uckelman <uckelman@nomic.net> | 2012-02-27 05:55:37 +0100 |
---|---|---|
committer | Joel Uckelman <uckelman@nomic.net> | 2012-02-27 05:55:37 +0100 |
commit | 796258546e1c62f2f09b50ca352fe34f5b345f7a (patch) | |
tree | e0ff5ed681e895782c1d2387297bf70046840ea9 | |
parent | e66b736aa6c2e00643b9b061d7064c7991503390 (diff) |
Use new build_email_subject implementation for outgoing mail.
-rw-r--r-- | src/PhpBB3ToMailman.php | 23 |
1 files 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, |