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.23 -r1.24 --- openacs-4/packages/forums/tcl/messages-procs.tcl 7 Nov 2003 17:43:33 -0000 1.23 +++ openacs-4/packages/forums/tcl/messages-procs.tcl 17 Dec 2003 15:45:30 -0000 1.24 @@ -39,7 +39,8 @@ if {[info exists message(state)] && [string equal $message(state) approved]} { do_notifications -message_id $message_id } - } on_error { + } on_error { + db_abort_transaction # Check to see if the message with a message_id matching the @@ -273,3 +274,29 @@ return $sort_filter } + +ad_proc -public forum::message::initial_message { + {-forum_id {}} + {-parent {}} + {-message:required} +} { + Create an array with values initialised for a new message. +} { + upvar $message init_msg + + if { [empty_string_p $forum_id] && [empty_string_p $parent] } { + return -code error [_ forums.lt_You_either_have_to] + } + + if { ![empty_string_p $parent] } { + upvar $parent parent_msg + + set init_msg(parent_id) $parent_msg(message_id) + set init_msg(forum_id) $parent_msg(forum_id) + set init_msg(subject) \ + [forum::format::reply_subject $parent_msg(subject)] + } else { + set init_msg(forum_id) $forum_id + set init_msg(parent_id) "" + } +}