Index: openacs-4/packages/chat/tcl/chat-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/chat/tcl/chat-procs.tcl,v diff -u -N -r1.5 -r1.5.2.1 --- openacs-4/packages/chat/tcl/chat-procs.tcl 14 Mar 2006 12:16:09 -0000 1.5 +++ openacs-4/packages/chat/tcl/chat-procs.tcl 30 Mar 2006 09:15:12 -0000 1.5.2.1 @@ -124,7 +124,7 @@ } { Log chat message to the database. } { - ns_log Notice $msg + # ns_log Notice $msg db_exec_plsql post_message {} } @@ -308,9 +308,10 @@ } { Return display name of this user to use in chat. } { + acs_user::get -user_id $user_id -array user + set name [expr {$user(screen_name) ne "" ? $user(screen_name) : $user(name)}] + return $name - return [db_exec_plsql get_chat_user_name {}] - } ad_proc -public chat_message_post { @@ -327,12 +328,10 @@ set status "pending" } - set chat_msg "[chat_user_name $user_id]$user_id$room_id$message$status" - # Add message to queue. Notify thread responsible for broadcast message to applets. - - nsv_set chat html_message $chat_msg - ns_mutex unlock [nsv_get chat new_message] - + if [catch {chat_post_message_to_db -creation_user $user_id $room_id $message} errmsg] { + ns_log error "chat_post_message_to_db: error: $errmsg" + } + } @@ -368,7 +367,7 @@ set user_name [chat_user_name $user_id] - upvar "$msgs:rowcount" counter + upvar "$msgs:rowcount" counter set chat_messages [nsv_get chat_room $room_id] @@ -419,15 +418,6 @@ db_transaction { set transcript_id [db_exec_plsql create_transcript {}] db_exec_plsql grant_permission {} -# -# db_dml transcript_content { -# update chat_transcripts -# set contents = empty_clob() -# where transcript_id = :transcript_id -# returning contents into :1 -# } -clobs [list $contents] -# } on_error { -# ad_return_complaint 1 "Insert fail: $errmsg" } return $transcript_id @@ -450,26 +440,7 @@ } { Edit chat transcript. } { - db_transaction { - db_exec_plsql edit_transcript { - - } - #db_dml transcript_content { - # update chat_transcripts - # set contents = empty_clob() - # where transcript_id = :transcript_id - # returning contents into :1 - #} -clobs [list $contents] - } - + db_exec_plsql edit_transcript {} } - - - - - - - -