Index: openacs-4/packages/chat/tcl/chat-procs-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/chat/tcl/chat-procs-postgresql.xql,v diff -u -r1.6 -r1.7 --- openacs-4/packages/chat/tcl/chat-procs-postgresql.xql 19 Nov 2007 01:14:16 -0000 1.6 +++ openacs-4/packages/chat/tcl/chat-procs-postgresql.xql 7 Aug 2017 23:48:07 -0000 1.7 @@ -1,225 +1,36 @@ - postgresql7.1 - - - select chat_room__new ( - NULL, - :pretty_name, - :description, - :moderated_p, - :active_p, - :archive_p, - :auto_flush_p, - :auto_transcript_p, - :context_id, - now(), - :creation_user, - :creation_ip, - 'chat_room' - ) - - + postgresql7.1 + + + select count(*) from chat_msgs + where room_id = :room_id + + + + + select chat_room__delete_all_msgs(:room_id) + + - - - -- Automatic grant room privilege to creator of the room (must not be null). - begin - if :creation_user <> '' - then - perform acs_permission__grant_permission(:room_id, :creation_user, 'chat_room_edit'); - perform acs_permission__grant_permission(:room_id, :creation_user, 'chat_room_view'); - perform acs_permission__grant_permission(:room_id, :creation_user, 'chat_room_delete'); - perform acs_permission__grant_permission(:room_id, :creation_user, 'chat_transcript_create'); + + + select chat_transcript__del(:transcript_id) + + - end if; - return 0; - end; + + + select chat_room__message_post(:room_id, :msg, :creation_user, :creation_ip) + + + + + select chat_room__del(:room_id) + + - - - - - - select chat_room__name (:room_id) from dual; - - - - - - - select person__name(:user_id); - - - - - - - begin - perform acs_permission__grant_permission(:room_id, :party_id, 'chat_write'); - perform acs_permission__grant_permission(:room_id, :party_id, 'chat_read'); - return 0; - end; - - - - - - - begin - perform acs_permission__revoke_permission(:room_id, :party_id, 'chat_write'); - perform acs_permission__revoke_permission(:room_id, :party_id, 'chat_read'); - return 0; - end; - - - - - - begin - perform acs_permission__grant_permission(:room_id, :party_id, 'chat_ban'); - return 0; - end; - - - - - - - begin - perform acs_permission__revoke_permission(:room_id, :party_id, 'chat_ban'); - return 0; - end; - - - - - - begin - perform acs_permission__grant_permission(:room_id, :party_id, 'chat_room_moderate'); - return 0; - end; - - - - - - begin - perform acs_permission__revoke_permission(:room_id, :party_id, 'chat_room_moderate'); - return 0; - end; - - - - - - - begin - perform chat_room__edit ( - :room_id, - :pretty_name, - :description, - :moderated_p, - :active_p, - :archive_p, - :auto_flush_p, - :auto_transcript_p - ); - return 0; - end; - - - - - - - select chat_room__message_count(:room_id); - - - - - - - begin - perform chat_room__delete_all_msgs(:room_id); - return 0; - end; - - - - - - - select chat_transcript__new ( - :pretty_name, - :contents, - :description, - :room_id, - :context_id, - now(), - :creation_user, - :creation_ip, - 'chat_transcript' - ) - - - - - - - begin - -- Automatic grant transcript privilege to creator of the transcript (must not be null). - if :creation_user is not null - then - perform acs_permission__grant_permission(:transcript_id, :creation_user, 'chat_transcript_edit'); - perform acs_permission__grant_permission(:transcript_id, :creation_user, 'chat_transcript_view'); - perform acs_permission__grant_permission(:transcript_id, :creation_user, 'chat_transcript_delete'); - end if; - return 0; - end; - - - - - - - begin - perform chat_transcript__del(:transcript_id); - return 0; - end; - - - - - - - select chat_room__message_post (:room_id, :msg, :creation_user, :creation_ip); - - - - - - select chat_room__del(:room_id); - - - - - - - - begin - perform chat_transcript__edit ( - :transcript_id, - :pretty_name, - :contents, - :description); - return 0; - end; - - - -