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

 <instance of xo::db::chat_room[i]> transcript_messages

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

Formats the current content of a chat room as a list of messages formatted so they can be displayed or stored in the transcript.

Returns:
list of formatted messages

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

Testcases:
No testcase defined.
Source code:
set room_id ${:room_id}
set contents [list]
::xo::dc foreach get_archives_messages {
    select msg,
    creation_user,
    to_char(creation_date, 'DD.MM.YYYY hh24:mi:ss') as creation_date
    from chat_msgs
    where room_id = :room_id
    and msg is not null
    order by creation_date
} {
    if {$creation_user > 0} {
        set user_name [::chat::Package get_user_name -user_id $creation_user]
        if {$user_name eq ""} {
            set user_name Unknown
        }
    } else {
        set user_name "system"
    }
    lappend contents "\[$creation_date\] ${user_name}$msg"
}
return $contents
XQL Not present:
Generic, PostgreSQL, Oracle
[ hide source ] | [ make this the default ]
Show another procedure: