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.31.2.1 -r1.31.2.2 --- openacs-4/packages/forums/tcl/messages-procs.tcl 25 May 2006 02:49:11 -0000 1.31.2.1 +++ openacs-4/packages/forums/tcl/messages-procs.tcl 20 Nov 2006 20:00:25 -0000 1.31.2.2 @@ -44,7 +44,7 @@ get -message_id $message_id -array message if {[info exists message(state)] && [string equal $message(state) approved]} { - do_notifications -message_id $message_id + do_notifications -message_id $message_id -user_id $user_id } } on_error { @@ -73,13 +73,24 @@ ad_proc -public forum::message::do_notifications { {-message_id:required} + {-user_id ""} } { # Select all the important information forum::message::get -message_id $message_id -array message set forum_id $message(forum_id) set url "[ad_url][db_string select_forums_package_url {}]" + set useScreenNameP [parameter::get -parameter "UseScreenNameP" -default 0] + if {($useScreenNameP == 0) && ($user_id != 0)} { + if {[empty_string_p $user_id]} { + set user_id [ad_conn user_id] + } + } else { + set user_id [party::get_by_email -email [ad_parameter -package_id [ad_acs_kernel_id] HostAdministrator]] + } + set notif_user $user_id + set attachments [attachments::get_attachments -object_id $message(message_id)] set message_text [ad_html_text_convert -from $message(format) -to text/plain -- $message(content)] @@ -88,7 +99,11 @@ 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" + if {$useScreenNameP == 0} { + append html_version "Author: $message(user_name)
\n" + } else { + append html_version "Author: $message(screen_name)
\n" + } append html_version "Posted: $message(posting_date)
" append html_version "\n
\n" append html_version $message_html @@ -111,8 +126,13 @@ set text_version "" append text_version " Forum: $message(forum_name) -Thread: $message(root_message_id) -Author: $message(user_name) +Thread: $message(root_message_id)\n" + if {$useScreenNameP == 0} { + append text_version "Author: $message(user_name)" + } else { + append text_version "Author: $message(screen_name)" + } + append text_version " Posted: $message(posting_date) ---------------------------------- $message_text