Index: openacs-4/packages/chat/chat.info =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/chat/chat.info,v diff -u -r1.17 -r1.17.2.1 --- openacs-4/packages/chat/chat.info 27 Apr 2015 07:12:55 -0000 1.17 +++ openacs-4/packages/chat/chat.info 28 Oct 2016 18:57:36 -0000 1.17.2.1 @@ -6,29 +6,31 @@ Chats f f + f + t - + Peter Alberer Server based chat with an html and ajax client. - 2015-04-25 + 2016-10-27 OpenACS Adapted by Peter Alberer 2006/03/25 to allow java and ajax to coexist. Adapted by Tekne 2006/03/01 to replace JAVA server with AJAX; make use of generalized chat class from xotcl-core. 0 - + - - - - - - + + + + + + Index: openacs-4/packages/chat/sql/oracle/chat-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/chat/sql/oracle/chat-create.sql,v diff -u -r1.4 -r1.4.6.1 --- openacs-4/packages/chat/sql/oracle/chat-create.sql 19 Nov 2007 01:14:15 -0000 1.4 +++ openacs-4/packages/chat/sql/oracle/chat-create.sql 28 Oct 2016 18:57:36 -0000 1.4.6.1 @@ -148,7 +148,14 @@ check (auto_flush_p in ('t', 'f')), auto_transcript_p char(1) default 'f' constraint chat_rooms_auto_transcript_ck - check (auto_transcript_p in ('t', 'f')) + check (auto_transcript_p in ('t', 'f')), + login_messages_p char(1) default 't' + constraint chat_rooms_login_messages_ck + check (login_messages_p in ('t', 'f')), + + logout_messages_p char(1) default 't' + constraint chat_rooms_logout_messages_ck + check (logout_messages_p in ('t', 'f')) ); declare @@ -245,6 +252,8 @@ archive_p in chat_rooms.archive_p%TYPE default 'f', auto_flush_p in chat_rooms.auto_flush_p%TYPE default 't', auto_transcript_p in chat_rooms.auto_transcript_p%TYPE default 'f', + login_messages_p in chat_rooms.login_messages_p%TYPE default 't', + logout_messages_p in chat_rooms.logout_messages_p%TYPE default 't', context_id in acs_objects.context_id%TYPE default null, creation_date in acs_objects.creation_date%TYPE default sysdate, creation_user in acs_objects.creation_user%TYPE default null, @@ -341,6 +350,8 @@ archive_p in chat_rooms.archive_p%TYPE default 'f', auto_flush_p in chat_rooms.auto_flush_p%TYPE default 't', auto_transcript_p in chat_rooms.auto_transcript_p%TYPE default 'f', + login_messages_p in chat_rooms.login_messages_p%TYPE default 't', + logout_messages_p in chat_rooms.logout_messages_p%TYPE default 't', context_id in acs_objects.context_id%TYPE default null, creation_date in acs_objects.creation_date%TYPE default sysdate, creation_user in acs_objects.creation_user%TYPE default null, @@ -366,7 +377,9 @@ active_p, archive_p, auto_flush_p, - auto_transcript_p) + auto_transcript_p, + login_messages_p, + logout_messages_p) values ( v_room_id, chat_room.new.pretty_name, @@ -375,7 +388,9 @@ chat_room.new.active_p, chat_room.new.archive_p, chat_room.new.auto_flush_p, - chat_room.new.auto_transcript_p); + chat_room.new.auto_transcript_p, + chat_room.new.login_messages_p, + chat_room.new.logout_messages_p); return v_room_id; end new; Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/chat/sql/oracle/upgrade/upgrade-5.0d10-5.0d11.sql'. Fisheye: No comparison available. Pass `N' to diff? Index: openacs-4/packages/chat/sql/postgresql/chat-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/chat/sql/postgresql/chat-create.sql,v diff -u -r1.8.2.1 -r1.8.2.2 --- openacs-4/packages/chat/sql/postgresql/chat-create.sql 20 Jun 2016 09:00:22 -0000 1.8.2.1 +++ openacs-4/packages/chat/sql/postgresql/chat-create.sql 28 Oct 2016 18:57:36 -0000 1.8.2.2 @@ -206,7 +206,10 @@ -- flush the rooms messages every night at 00:05 auto_flush_p boolean default 't', -- automatically create a transcript after flushing the room - auto_transcript_p boolean default 'f' + auto_transcript_p boolean default 'f', + -- allow to set wether we want login/logout messages or not + login_messages_p boolean default 't', + logout_messages_p boolean default 't' ); @@ -341,12 +344,13 @@ --------------------------------- - -- added -select define_function_args('chat_room__new','room_id,pretty_name,description,moderated_p,active_p,archive_p,auto_flush_p,auto_transcript_p,context_id,creation_date,creation_user,creation_ip,object_type'); +select define_function_args( + 'chat_room__new', + 'room_id,pretty_name,description,moderated_p,active_p,archive_p,auto_flush_p,auto_transcript_p,login_messages_p,logout_messages_p,context_id,creation_date,creation_user,creation_ip,object_type'); -- --- procedure chat_room__new/13 +-- procedure chat_room__new/15 -- CREATE OR REPLACE FUNCTION chat_room__new( p_room_id integer, @@ -357,6 +361,8 @@ p_archive_p boolean, p_auto_flush_p boolean, p_auto_transcript_p boolean, + p_login_messages_p boolean, + p_logout_messages_p boolean, p_context_id integer, p_creation_date timestamptz, p_creation_user integer, @@ -375,10 +381,29 @@ p_context_id ); - insert into chat_rooms - (room_id, pretty_name, description, moderated_p, active_p, archive_p, auto_flush_p, auto_transcript_p) - values - (v_room_id, p_pretty_name, p_description, p_moderated_p, p_active_p, p_archive_p, p_auto_flush_p, p_auto_transcript_p); + insert into chat_rooms ( + room_id, + pretty_name, + description, + moderated_p, + active_p, + archive_p, + auto_flush_p, + auto_transcript_p, + login_messages_p, + logout_messages_p + ) values ( + v_room_id, + p_pretty_name, + p_description, + p_moderated_p, + p_active_p, + p_archive_p, + p_auto_flush_p, + p_auto_transcript_p, + p_login_messages_p, + p_logout_messages_p + ); return v_room_id; @@ -387,8 +412,6 @@ - - --------------------------------- @@ -576,7 +599,7 @@ select define_function_args('chat_room__edit','room_id,pretty_name,description,moderated_p,active_p,archive_p,auto_flush_p,auto_transcript_p'); -- --- procedure chat_room__edit/8 +-- procedure chat_room__edit/10 -- CREATE OR REPLACE FUNCTION chat_room__edit( p_room_id integer, @@ -586,21 +609,25 @@ p_active_p boolean, p_archive_p boolean, p_auto_flush_p boolean, - p_auto_transcript_p boolean + p_auto_transcript_p boolean, + p_login_messages_p boolean, + p_logout_messages_p boolean ) RETURNS integer AS $$ DECLARE BEGIN update chat_rooms set - pretty_name = p_pretty_name, - description = p_description, - moderated_p = p_moderated_p, - active_p = p_active_p, - archive_p = p_archive_p, - auto_flush_p = p_auto_flush_p, - auto_transcript_p = p_auto_transcript_p + pretty_name = p_pretty_name, + description = p_description, + moderated_p = p_moderated_p, + active_p = p_active_p, + archive_p = p_archive_p, + auto_flush_p = p_auto_flush_p, + login_messages_p = p_login_messages_p, + logout_messages_p = p_logout_messages_p where room_id = p_room_id; + return 0; END; $$ LANGUAGE plpgsql; Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/chat/sql/postgresql/upgrade/upgrade-5.0d10-5.0d11.sql'. Fisheye: No comparison available. Pass `N' to diff? 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.12.2.1 -r1.12.2.2 --- openacs-4/packages/chat/tcl/chat-ajax-procs.tcl 20 Jun 2016 08:40:23 -0000 1.12.2.1 +++ openacs-4/packages/chat/tcl/chat-ajax-procs.tcl 28 Oct 2016 18:57:36 -0000 1.12.2.2 @@ -8,8 +8,18 @@ } namespace eval ::chat { - ::xo::ChatClass Chat -superclass ::xo::Chat + ::xo::ChatClass Chat -superclass ::xo::Chat + Chat instproc init {} { + my instvar chat_id login_messages_p logout_messages_p + xo::dc 1row get_options " + select login_messages_p, + logout_messages_p + from chat_rooms + where room_id = :chat_id" + next + } + Chat instproc render {} { my orderby time set result "" @@ -57,8 +67,6 @@ // register the data sources (for sending messages, receiving updates) var pushMessage = registerDataConnection(pushReceiver, '$path/ajax/chat?m=get_new&$context', false); var pullUpdates = registerDataConnection(updateReceiver, '$path/ajax/chat?m=get_updates&$context', true); - // register an update function to refresh the data sources every 5 seconds - var updateInterval = setInterval(updateDataConnections,5000);