xo::db::chat_room instproc create_transcript (public)

 <instance of xo::db::chat_room[i]> create_transcript \
    [ -pretty_name pretty_name ] [ -description description ] \
    [ -creation_user creation_user ] [ -creation_ip creation_ip ]

Defined in packages/chat/tcl/xotcl-chat-procs.tcl

Creates a new transcript of all current chat room messages.

Switches:
-pretty_name
(optional)
-description
(optional)
-creation_user
(optional)
-creation_ip
(optional)
Returns:
transcript_id of the new transcript or 0 when no messages were in the chat room.

Partial Call Graph (max 5 caller/called nodes):
%3

Testcases:
No testcase defined.
Source code:
if {![info exists pretty_name]} {
    set today [clock format [clock seconds] -format "%d.%m.%Y"]
    set pretty_name "#chat.transcript_of_date# $today"
}
if {![info exists description]} {
    set description "#chat.automatically_created_transcript#"
}
if {![info exists creation_user]} {
    set creation_user ${:creation_user}
}

set contents [:transcript_messages]
if {[llength $contents] > 0} {
    set t [::xo::db::chat_transcript new  -creation_user $creation_user  -creation_ip $creation_ip  -pretty_name $pretty_name  -description $description  -package_id ${:package_id}  -room_id ${:room_id}  -contents [join $contents \n]]
    $t save_new
    return [$t set transcript_id]
} else {
    return 0
}
XQL Not present:
Generic, PostgreSQL, Oracle
[ hide source ] | [ make this the default ]
Show another procedure: