Index: openacs-4/packages/chat/tcl/xotcl-chat-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/chat/tcl/Attic/xotcl-chat-procs.tcl,v diff -u -r1.1.2.5 -r1.1.2.6 --- openacs-4/packages/chat/tcl/xotcl-chat-procs.tcl 15 Mar 2019 16:11:10 -0000 1.1.2.5 +++ openacs-4/packages/chat/tcl/xotcl-chat-procs.tcl 13 May 2019 10:02:55 -0000 1.1.2.6 @@ -161,7 +161,7 @@ ::xo::db::chat_room instproc save_new {} { if {![info exists :context_id]} { - set :context_id [expr {[ns_conn isconnected] ? [ad_conn package_id] : ""}] + set :context_id ${:package_id} } ::xo::dc transaction { set room_id [next] @@ -240,7 +240,11 @@ and msg is not null order by creation_date } { - set user_name [expr {$creation_user > 0 ? [chat_user_name $creation_user] : "system"}] + if {$creation_user > 0} { + set user_name [::chat::Package get_user_name -user_id $creation_user] + } else { + set user_name "system" + } lappend contents "\[$creation_date\] ${user_name}: $msg" } if {[llength $contents] > 0} { @@ -281,7 +285,7 @@ ::xo::db::chat_transcript instproc save_new {} { if {![info exists :context_id]} { - set :context_id [expr {[ns_conn isconnected] ? [ad_conn package_id] : ""}] + set :context_id ${:package_id} } ::xo::dc transaction { set transcript_id [next]