Rev 15082 | Rev 15144 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed
!if $wims_user!=supervisor
!bound user within $wims_user,$livingfile default $wims_user
!else
!bound user within $ulist,$livingfile default $empty
!endif
!if $user=$empty
!reset job
!changeto var.proc
!endif
!bound job2 within newmsg,$empty default $empty
!if $cf_preview!=$empty
job2=newmsg
!endif
ltfile=!sh cd $wims_home/log/classes/$wims_class/tchat; if [ -e $user.old1 ]; then ls $user.old*; fi;
nbfile=!linecnt $ltfile
!if $save!=$empty and $desc!=$empty and $cf_preview=$empty
desc=!detag $desc
desc=!char 1 to $msg_limit of $desc
dt=!char 1 to 14 of $wims_now
rcnt=!recordcnt wimshome/log/classes/$wims_class/tchat/$user
!if $rcnt>=$msg_recordlimit
!increase nbfile
!sh mv $wims_home/log/classes/$wims_class/tchat/$user $wims_home/log/classes/$wims_class/tchat/$(user).old$nbfile;
!endif
!appendfile wimshome/log/classes/$wims_class/tchat/$user :$wims_user $dt\
$desc
!reset job2 desc save
!endif
!if $nbfile=0
lastmsg=!recordcnt wimshome/log/classes/$wims_class/tchat/$user
nbmsg=$[min($msg_numberlimit,$lastmsg)]
!else
nbmsg=$msg_numberlimit
!endif
!if $wims_user=supervisor
!if . isin $user
n=!text select 0123456789 in $user
name_title=!nosubst $(livingname_$n)
!else
po=!positionof item $user in $ulist
username=$(nlist[$po])
name_title=$name_tchatwith $username
!endif
!else
username=Participant
!if . isin $user
n=!text select 0123456789 in $user
name_title=!nosubst $(livingname_$n)
!else
name_title=$name_ownliving
!endif
otherliving=!listcomplement $user in $livingfile,$wims_user
!endif
ses=!replace internal _ by , in $wims_session
ses=!item 1 of $ses
!setdef wims_opentchat=$user in wimshome/sessions/$ses/var.stat
!! ------- build of userpage supervisor can look
!! userpage can't be view in living (only in individual tchat) : todo ?
!if $wims_user=supervisor and $user isitemof $wims_connectedlogin and . notin $user
!readproc script/getsession.proc $user
!endif
!! ------ build of list of users
!if . isin $user
living=!text select 0123456789 in $user
!if $(livingusers_$living)!=all
listnameusers=$empty
!for u in $(livingusers_$living)
po=!positionof item $u in $ulist
!if $u!=supervisor and $u!=$wims_user and $po!=$empty
listnameusers=!append item $(nlist[$po]) to $listnameusers
!endif
!next u
!if $listnameusers!=$empty
listnameusers=, $name_yourself $name_and $listnameusers
!else
listnameusers=$name_and $name_yourself
!endif
!endif
!else
!if $wims_user=supervisor
po=!positionof item $user in $ulist
listnameusers=$name_and $(nlist[$po])
!else
listnameusers=$name_and $name_yourself
!endif
!endif
!! ------- manage of autorefresh
!if $job2!=newmsg
!if $wims_user=supervisor
autorefresh=yes
!else
lastauth=!record -1 of wimshome/log/classes/$wims_class/tchat/$user
lastauth=!line 1 of $lastauth
lastauth=!word 1 of $lastauth
!if $lastauth=$wims_user or $user!=$wims_user
autorefresh=yes
!else
!if $mautorefresh=1
autorefresh=yes
!else
autorefresh=no
!endif
!endif
!endif
!if $autorefresh=yes
!let rd=!randint 111111,999999
local_html_header=<META HTTP-EQUIV="Refresh" CONTENT="$(tchat_refreshtiming);wims.cgi?session=$wims_session&+module=adm/class/tchat&+serial=$rd&+job=$job&+user=$user">
!endif
!endif