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.27 -r1.28
--- openacs-4/packages/forums/tcl/messages-procs.tcl 17 May 2004 15:15:16 -0000 1.27
+++ openacs-4/packages/forums/tcl/messages-procs.tcl 29 Jun 2004 10:18:30 -0000 1.28
@@ -16,8 +16,9 @@
{-parent_id ""}
{-subject:required}
{-content:required}
- {-html_p "f"}
+ {-format "text/plain"}
{-user_id ""}
+ {-posting_date ""}
} {
create a new message
} {
@@ -30,7 +31,7 @@
set original_message_id $message_id
# Prepare the variables for instantiation
set extra_vars [ns_set create]
- oacs_util::vars_to_ns_set -ns_set $extra_vars -var_list {forum_id message_id parent_id subject content html_p user_id}
+ oacs_util::vars_to_ns_set -ns_set $extra_vars -var_list {forum_id message_id parent_id subject content format user_id}
db_transaction {
set message_id [package_instantiate_object -extra_vars $extra_vars forums_message]
@@ -73,65 +74,80 @@
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: +