Index: openacs-4/packages/chat/tcl/chat-ajax-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/chat/tcl/chat-ajax-procs.tcl,v diff -u -r1.3 -r1.4 --- openacs-4/packages/chat/tcl/chat-ajax-procs.tcl 26 Oct 2006 11:11:20 -0000 1.3 +++ openacs-4/packages/chat/tcl/chat-ajax-procs.tcl 30 Oct 2006 14:42:09 -0000 1.4 @@ -66,24 +66,55 @@ " - } + } - Chat instproc render2 {-chat_id } { my orderby time set result "" - + set msg_true "f" + + db_1row room_info { select room.maximal_participants as maxp from chat_rooms as room where room.room_id = :chat_id - } - - + } + foreach child [my children] { set msg [$child msg] + set msg_all "" + + for {set i 0} {$i < [llength $msg]} {incr i 1} { + set word [lindex $msg $i] + + + for {set j 0} {$j < [llength $word]} {incr j 1} { + if { [string range $word $j $j] eq "h" } { + set aux [expr $j+1] + if { [string range $word $aux [expr $aux+5] ] eq "ttp://" } { + set url [lindex $msg $i] + lappend msg_all $i + set msg_true "t" + + } + } else { + if { [string range $word $j $j] eq "w" } { + set aux [expr $j+1] + if { [string range $word $aux [expr $aux+1] ] eq "ww" } { + set url [lindex $msg $i] + lappend msg_all $i + set msg_true "t" + + } + } + } + } + } + set user_id [$child user_id] set color [$child color] + + set timelong [clock format [$child time]] set timeshort [clock format [$child time] -format {[%H:%M:%S]}] @@ -94,6 +125,7 @@ and user_id = :user_id } + if { $info > 0 } { db_1row room_info { select alias as alias @@ -102,19 +134,88 @@ and user_id = :user_id } set userlink [my user_link2 -user_id $user_id -color $color -alias $alias] + + if {$msg_true eq "t"} { + + append result "
$userlink:" + + append result "
\n" + } else { + append result " " \ + "$userlink:" \ "
\n" + } + } + if {$info eq 0} { set userlink [my user_link -user_id $user_id -color $color] - append result " " \ "$userlink:" \ - "
\n" - } + + if {$msg_true eq "t"} { + + append result " " \ - "$userlink:" + + append result "
\n" + } else { + + append result " " \ + "$userlink:" \ + "
\n" + } } - - + } return $result } " \ + "