Index: openacs-4/packages/chat/www/room.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/chat/www/room.tcl,v diff -u -r1.13 -r1.14 --- openacs-4/packages/chat/www/room.tcl 18 Jan 2019 17:14:36 -0000 1.13 +++ openacs-4/packages/chat/www/room.tcl 3 Sep 2024 15:37:36 -0000 1.14 @@ -5,13 +5,12 @@ @creation-date November 15, 2000 @cvs-id $Id$ } { - room_id:naturalnum,notnull + room_id:object_type(chat_room) } -properties { context_bar:onevalue pretty_name:onevalue description:onevalue archive_p:onevalue - moderated_p:onevalue active_p:onevalue room_view_p:onevalue room_edit_p:onevalue @@ -25,6 +24,7 @@ transcript_create_p:onevalue transcript_edit_p:onevalue transcript_view_p:onevalue + avatar_p:onevalue moderators:multirow users_allow:multirow users_ban:multirow @@ -36,47 +36,47 @@ ### # Get all available permission of this user on this room. ### -set room_view_p [permission::permission_p -object_id $room_id -privilege chat_room_view] -set room_edit_p [permission::permission_p -object_id $room_id -privilege chat_room_edit] -set room_delete_p [permission::permission_p -object_id $room_id -privilege chat_room_delete] -set user_ban_p [permission::permission_p -object_id $room_id -privilege chat_user_ban] -set user_unban_p [permission::permission_p -object_id $room_id -privilege chat_user_unban] -set user_grant_p [permission::permission_p -object_id $room_id -privilege chat_user_grant] -set user_revoke_p [permission::permission_p -object_id $room_id -privilege chat_user_revoke] -set moderator_grant_p [permission::permission_p -object_id $room_id -privilege chat_moderator_grant] -set moderator_revoke_p [permission::permission_p -object_id $room_id -privilege chat_moderator_revoke] +set room_view_p [permission::permission_p -object_id $room_id -privilege chat_room_view] +set room_edit_p [permission::permission_p -object_id $room_id -privilege chat_room_edit] +set room_delete_p [permission::permission_p -object_id $room_id -privilege chat_room_delete] +set user_ban_p [permission::permission_p -object_id $room_id -privilege chat_user_ban] +set user_unban_p [permission::permission_p -object_id $room_id -privilege chat_user_unban] +set user_grant_p [permission::permission_p -object_id $room_id -privilege chat_user_grant] +set user_revoke_p [permission::permission_p -object_id $room_id -privilege chat_user_revoke] +set moderator_grant_p [permission::permission_p -object_id $room_id -privilege chat_moderator_grant] +set moderator_revoke_p [permission::permission_p -object_id $room_id -privilege chat_moderator_revoke] set transcript_create_p [permission::permission_p -object_id $room_id -privilege chat_transcript_create] ### # Get room basic information. ### -chat_room_get -room_id $room_id -array r -set pretty_name $r(pretty_name) -set description $r(description) -set moderated_p $r(moderated_p) -set active_p $r(active_p) -set archive_p $r(archive_p) -set auto_flush_p $r(auto_flush_p) -set auto_transcript_p $r(auto_transcript_p) -set login_messages_p $r(login_messages_p) -set logout_messages_p $r(logout_messages_p) -set messages_time_window $r(messages_time_window) +set r [::xo::db::Class get_instance_from_db -id $room_id] +set pretty_name [$r set pretty_name] +set description [$r set description] +set active_p [$r set active_p] +set archive_p [$r set archive_p] +set auto_flush_p [$r set auto_flush_p] +set auto_transcript_p [$r set auto_transcript_p] +set login_messages_p [$r set login_messages_p] +set logout_messages_p [$r set logout_messages_p] +set messages_time_window [$r set messages_time_window] +set avatar_p [$r set avatar_p] # prettify flags foreach property { - moderated_p active_p archive_p auto_flush_p auto_transcript_p login_messages_p logout_messages_p + avatar_p } { set $property [expr {[set $property] eq "t" ? [_ acs-kernel.common_yes] : [_ acs-kernel.common_no] }] } # get db-message count -set message_count [chat_message_count $room_id] +set message_count [$r count_messages] # List user ban from chat db_multirow -extend {name email unban_url unban_text} banned_users list_user_ban {} {