Index: openacs-4/packages/chat/chat.info
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/chat/chat.info,v
diff -u -r1.7 -r1.7.2.1
--- openacs-4/packages/chat/chat.info 14 Mar 2006 12:16:08 -0000 1.7
+++ openacs-4/packages/chat/chat.info 30 Mar 2006 09:15:12 -0000 1.7.2.1
@@ -7,19 +7,21 @@
ff
-
- David Dao
- Server based chat with an html and java client.
- 2004-10-10
+
+ Peter Alberer
+ Server based chat with an html and ajax client.
+ 2006-03-24OpenACS
- Modified by Agustin.Lopez@uv.es (University of Valencia, Spain).
+ 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
-
+
+
Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/chat/catalog/chat.de_DE.ISO-8859-1.xml'.
Fisheye: No comparison available. Pass `N' to diff?
Index: openacs-4/packages/chat/catalog/chat.en_US.ISO-8859-1.xml
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/chat/catalog/chat.en_US.ISO-8859-1.xml,v
diff -u -r1.1 -r1.1.2.1
--- openacs-4/packages/chat/catalog/chat.en_US.ISO-8859-1.xml 14 Mar 2006 12:16:08 -0000 1.1
+++ openacs-4/packages/chat/catalog/chat.en_US.ISO-8859-1.xml 30 Mar 2006 09:15:12 -0000 1.1.2.1
@@ -1,9 +1,13 @@
-
+
+ ActionsActive
+ active usersAdd moderatorAdd user to room
+ Ajax
+ ajax clientArchiveAre you sure you want to deleteAre you sure you want to revoke chat user privilege of
@@ -12,6 +16,7 @@
BanBan chat read/write privilege forBan user
+ Banned usersChatChat main pageConfirm chat transcript delete
@@ -28,16 +33,23 @@
Create new room failedCreate roomCreate transcript
+ Creation date
+ Current conversation
+ date
+ Raum nach Erstellung des Protokolls deaktivierenDelete all messages in the roomDelete messages
+ Delete messages after creating the transcriptDelete messages failedDelete roomDelete room failedDelete transcriptDelete transcript failedDescriptionEdit
+ Edit RoomEdit transcript
+ exit chat roomExtreme ActionsfromGrant
@@ -47,31 +59,49 @@
Grant userhas entered the roomhas left the room
+ HTMLHTML
+ html client
+ JavaScriptJava
+ Javascriptkey
+ last activityLog off
+ Message
+ Message countmessages inModerated
+ MessageNameNo information available
+ No activeremoveRevokerevokeRevoke moderatorRevoke userAdmin
+ Deactive RoomRoom InformationRoom moderatorsRoom nameRoom no activeRoom not found, Invalid room idSend/Refresh
+ Sending message...There are no rooms availableto
+ ProtocolTranscript name
+ Protocol of
+ Protocol of the messages in roomTranscript preview
+ transcription of all chat messagesTranscripts
+ Available transcripts in room
+ Trascript
+ TrasncriptUnauthorizedUnauthorized privilegeUnban
@@ -84,6 +114,7 @@
ViewView transcriptfor name or email or username limited to
+ <b>Warning</b> The package parameter "DefaultClient" is set to "Ajax" but the package xotcl-core is not installed. Ajax will not work without xotcl-core!YesYou don't have permission to enter this chat roomyour name is
Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/chat/lib/current-messages.adp'.
Fisheye: No comparison available. Pass `N' to diff?
Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/chat/lib/current-messages.tcl'.
Fisheye: No comparison available. Pass `N' to diff?
Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/chat/lib/transcript-view.adp'.
Fisheye: No comparison available. Pass `N' to diff?
Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/chat/lib/transcript-view.tcl'.
Fisheye: No comparison available. Pass `N' to diff?
Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/chat/lib/transcripts.adp'.
Fisheye: No comparison available. Pass `N' to diff?
Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/chat/lib/transcripts.tcl'.
Fisheye: No comparison available. Pass `N' to diff?
Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/chat/lib/transcripts.xql'.
Fisheye: No comparison available. Pass `N' to diff?
Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/chat/tcl/chat-ajax-procs.tcl'.
Fisheye: No comparison available. Pass `N' to diff?
Index: openacs-4/packages/chat/tcl/chat-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/chat/tcl/chat-procs.tcl,v
diff -u -r1.5 -r1.5.2.1
--- openacs-4/packages/chat/tcl/chat-procs.tcl 14 Mar 2006 12:16:09 -0000 1.5
+++ openacs-4/packages/chat/tcl/chat-procs.tcl 30 Mar 2006 09:15:12 -0000 1.5.2.1
@@ -124,7 +124,7 @@
} {
Log chat message to the database.
} {
- ns_log Notice $msg
+ # ns_log Notice $msg
db_exec_plsql post_message {}
}
@@ -308,9 +308,10 @@
} {
Return display name of this user to use in chat.
} {
+ acs_user::get -user_id $user_id -array user
+ set name [expr {$user(screen_name) ne "" ? $user(screen_name) : $user(name)}]
+ return $name
- return [db_exec_plsql get_chat_user_name {}]
-
}
ad_proc -public chat_message_post {
@@ -327,12 +328,10 @@
set status "pending"
}
- set chat_msg "[chat_user_name $user_id]$user_id$room_id$message$status"
- # Add message to queue. Notify thread responsible for broadcast message to applets.
-
- nsv_set chat html_message $chat_msg
- ns_mutex unlock [nsv_get chat new_message]
-
+ if [catch {chat_post_message_to_db -creation_user $user_id $room_id $message} errmsg] {
+ ns_log error "chat_post_message_to_db: error: $errmsg"
+ }
+
}
@@ -368,7 +367,7 @@
set user_name [chat_user_name $user_id]
- upvar "$msgs:rowcount" counter
+ upvar "$msgs:rowcount" counter
set chat_messages [nsv_get chat_room $room_id]
@@ -419,15 +418,6 @@
db_transaction {
set transcript_id [db_exec_plsql create_transcript {}]
db_exec_plsql grant_permission {}
-#
-# db_dml transcript_content {
-# update chat_transcripts
-# set contents = empty_clob()
-# where transcript_id = :transcript_id
-# returning contents into :1
-# } -clobs [list $contents]
-# } on_error {
-# ad_return_complaint 1 "Insert fail: $errmsg"
}
return $transcript_id
@@ -450,26 +440,7 @@
} {
Edit chat transcript.
} {
- db_transaction {
- db_exec_plsql edit_transcript {
-
- }
- #db_dml transcript_content {
- # update chat_transcripts
- # set contents = empty_clob()
- # where transcript_id = :transcript_id
- # returning contents into :1
- #} -clobs [list $contents]
- }
-
+ db_exec_plsql edit_transcript {}
}
-
-
-
-
-
-
-
-
Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/chat/www/ajax-chat-script.adp'.
Fisheye: No comparison available. Pass `N' to diff?
Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/chat/www/ajax-chat-script.tcl'.
Fisheye: No comparison available. Pass `N' to diff?
Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/chat/www/chat-transcript.adp'.
Fisheye: No comparison available. Pass `N' to diff?
Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/chat/www/chat-transcript.tcl'.
Fisheye: No comparison available. Pass `N' to diff?
Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/chat/www/chat-transcripts.adp'.
Fisheye: No comparison available. Pass `N' to diff?
Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/chat/www/chat-transcripts.tcl'.
Fisheye: No comparison available. Pass `N' to diff?
Index: openacs-4/packages/chat/www/chat.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/chat/www/chat.tcl,v
diff -u -r1.5 -r1.5.2.1
--- openacs-4/packages/chat/www/chat.tcl 14 Mar 2006 12:16:09 -0000 1.5
+++ openacs-4/packages/chat/www/chat.tcl 30 Mar 2006 09:15:12 -0000 1.5.2.1
@@ -1,7 +1,7 @@
#/chat/www/chat.tcl
ad_page_contract {
- Decide which template to use HTML or Java.
+ Decide which template to use HTML or AJAX.
@author David Dao (ddao@arsdigita.com)
@creation-date November 22, 2000
@@ -29,18 +29,15 @@
ad_return_complaint 1 "[_ chat.Room_not_found]"
}
-set context_bar [list $room_name]
-
+set context_bar $room_name
set user_id [ad_conn user_id]
-
-set read_p [ad_permission_p $room_id "chat_read"]
-set write_p [ad_permission_p $room_id "chat_write"]
-set ban_p [ad_permission_p $room_id "chat_ban"]
-
+set read_p [permission::permission_p -object_id $room_id -privilege "chat_read"]
+set write_p [permission::permission_p -object_id $room_id -privilege "chat_write"]
+set ban_p [permission::permission_p -object_id $room_id -privilege "chat_ban"]
set moderate_room_p [chat_room_moderate_p $room_id]
if { $moderate_room_p == "t" } {
- set moderator_p [ad_permission_p $room_id "chat_moderator"]
+ set moderator_p [permission::permission_p -object_id $room_id -privilege "chat_moderator"]
} else {
# This is an unmoderate room, therefore everyone is a moderator.
set moderator_p "1"
@@ -54,42 +51,27 @@
# Get chat screen name.
set user_name [chat_user_name $user_id]
-# Determine which template to use for html or java client
-if {$client == "java"} {
- set template_use "java-chat"
- # Get config paramater for applet.
- set width [ad_parameter AppletWidth "" 500]
- set height [ad_parameter AppletHeight "" 400]
-
- set host [ad_parameter ServerHost "" [ns_config "ns/server/[ns_info server]/module/nssock" Hostname]]
- set port [ad_parameter ServerPort "" 8200]
-} else {
- set template_use "html-chat"
+# send message to the database
+if { ![empty_string_p $message] } {
+ chat_message_post $room_id $user_id $message $moderator_p
+}
- chat_message_retrieve msgs $room_id $user_id
-
- if { ![empty_string_p $message] } {
- chat_message_post $room_id $user_id $message $moderator_p
+# Determine which template to use for html or ajax client
+switch $client {
+ "html" {
+ set template_use "html-chat"
+ # forward to ajax if necessary
+ if { ![empty_string_p $message] && [llength [info command ::chat::Chat]] > 0 } {
+ set session_id [ad_conn session_id]
+ ::chat::Chat c1 -volatile -chat_id $room_id -session_id $session_id
+ c1 add_msg $message
+ }
}
-
-
-
+ "ajax" {
+ set template_use "ajax-chat-script"
+ }
}
ad_return_template $template_use
-
-
-
-
-
-
-
-
-
-
-
-
-
-
Index: openacs-4/packages/chat/www/html-chat.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/chat/www/Attic/html-chat.adp,v
diff -u -r1.5 -r1.5.2.1
--- openacs-4/packages/chat/www/html-chat.adp 14 Mar 2006 12:16:09 -0000 1.5
+++ openacs-4/packages/chat/www/html-chat.adp 30 Mar 2006 09:15:12 -0000 1.5.2.1
@@ -2,24 +2,16 @@
@context_bar;noquote@@room_name;noquote@
-[#chat.Log_off#]
+#chat.Log_off#
+#chat.Trascript#
+@richclient.title@
+