Index: openacs-4/packages/xotcl-core/tcl/chat-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xotcl-core/tcl/Attic/chat-procs.tcl,v diff -u -r1.3 -r1.4 --- openacs-4/packages/xotcl-core/tcl/chat-procs.tcl 30 Mar 2006 00:35:19 -0000 1.3 +++ openacs-4/packages/xotcl-core/tcl/chat-procs.tcl 31 Mar 2006 07:56:21 -0000 1.4 @@ -138,13 +138,22 @@ } else { [my info class] instvar colors ns_log notice "getting colors of [my info class] = [info exists colors]" - set color [lindex $colors [expr { [nsv_get $array-color idx] % [llength $colors]-1 }]] + set color [lindex $colors [expr { [nsv_get $array-color idx] % [llength $colors] }]] my set user_color $color nsv_set $array-color $user_id $color nsv_incr $array-color idx } } + Chat instproc user_color { user_id } { + my instvar array + if { ![nsv_exists $array-color $user_id] } { + ns_log Notice "Warning: Cannot find user color for chat ($array-color $user_id)!" + return [lindex [[my info class] set colors] 0] + } + return [nsv_get $array-color $user_id] + } + Chat instproc login {} { my instvar array user_id now # was the user already active? @@ -163,7 +172,7 @@ #set name [chat_user_name $user_id] set url "/shared/community-member?user%5fid=$user_id" if { $color eq "" } { - set color [my set user_color $user_id] + set color [my user_color $user_id] } set creator "$name" } else { @@ -223,7 +232,7 @@ ChatClass method init {} { my set colors [list #006400 #0000ff #b8860b #bdb76b #8b0000] - ns_log notice "colors of [self] = [my set colors]" + #ns_log notice "colors of [self] = [my set colors]" } }