Index: openacs-4/packages/forums/tcl/messages-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/forums/tcl/messages-procs.tcl,v diff -u -r1.24.2.2 -r1.24.2.3 --- openacs-4/packages/forums/tcl/messages-procs.tcl 22 Jun 2004 16:53:43 -0000 1.24.2.2 +++ openacs-4/packages/forums/tcl/messages-procs.tcl 25 Jun 2004 15:34:08 -0000 1.24.2.3 @@ -18,6 +18,7 @@ {-content:required} {-format "text/plain"} {-user_id ""} + {-posting_date ""} } { create a new message } { @@ -73,58 +74,73 @@ set forum_id $message(forum_id) set url "[ad_url][db_string select_forums_package_url {}]" - set new_content "" - append new_content "Forum: $message(forum_name)
\n" - append new_content "Thread: $message(root_subject)
\n" - append new_content "Author: $message(user_name)
\n" - append new_content "\n
\n" - append new_content $message(content) - append new_content "

-------------------
" + set attachments [attachments::get_attachments -object_id $message(message_id)] + if {$message(html_p) == "t"} { + set message_html $message(content) + set message_text [ad_html_text_convert -from html -to text $message(content)] + } else { + set message_text $message(content) + set message_html [ad_html_text_convert -from text -to html $message(content)] + } - # send text for now. - set new_content [ad_html_to_text -- $new_content] - set html_version $new_content + set html_version "" + append html_version "Forum: $message(forum_name)
\n" + append html_version "Thread: $message(root_subject)
\n" + append html_version "Author: $message(user_name)
\n" + append html_version "Posted: $message(posting_date)
" + append html_version "\n
\n" + append html_version $message_html + append html_version "

" - set text_version "" - - append text_version "Forum: $message(forum_name) -Thread: $message(root_subject) -Author: $message(user_name) ($message(user_email))\n\n" + if {[llength $attachments] > 0} { + append html_version "Attachments: +

" - if { [string compare $message(format) "text/plain"] != 0 } { - append text_version [ad_html_to_text -- $message(content)] - } else { - append text_version [wrap_string $message(content)] - } - append text_version "\n\n-- + } + + set html_version $html_version + + set text_version "" + append text_version " +Forum: $message(forum_name) +Thread: $message(root_message_id) +Author: $message(user_name) +Posted: $message(posting_date) +---------------------------------- +$message_text +--------------------------------- To post a reply to this email or view this message go to: ${url}message-view?message_id=$message(root_message_id) -" - set new_content $text_version - ns_log debug "forums: requesting a notification forum $message(forum_name) subject $message(subject)" - - +To view Forum $message(forum_name) go to: +${url}forum-view?forum_id=$message(forum_id) +" # Do the notification for the forum notification::new \ -type_id [notification::type::get_type_id \ -short_name forums_forum_notif] \ -object_id $message(forum_id) \ -response_id $message(message_id) \ - -notif_user $message(user_id) \ - -notif_subject $message(subject) \ - -notif_text $new_content + -notif_subject "\[$message(forum_name)\] $message(subject)" \ + -notif_text $text_version \ + -notif_html $html_version + # Eventually we need notification for the root message too notification::new \ -type_id [notification::type::get_type_id \ -short_name forums_message_notif] \ -object_id $message(root_message_id) \ -response_id $message(message_id) \ - -notif_user $message(user_id) \ - -notif_subject $message(subject) \ - -notif_text $new_content + -notif_subject "\[$message(forum_name)\] $message(subject)" \ + -notif_text $text_version \ + -notif_html $html_version } ad_proc -public forum::message::edit {