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

 <instance of xo::db::chat_room[i]> post_message [ -msg msg ] \
    [ -creation_user creation_user ] [ -creation_ip creation_ip ]

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

Post a message in the chat room. This actually means persisting the message in the database, but only if the chat room is configured to be archived.

Switches:
-msg
(optional)
the message
-creation_user
(optional)
the alleged creation user of the persisted message. Won't be set automatically from the connection
-creation_ip
(optional)
the alleged creation IP of the persisted message. Won't be set automatically from the connection

Partial Call Graph (max 5 caller/called nodes):
%3 db_nextval db_nextval (public) xo::db::chat_room instproc post_message xo::db::chat_room instproc post_message xo::db::chat_room instproc post_message->db_nextval

Testcases:
No testcase defined.
Source code:
if {!${:archive_p}} {
    return
}
set room_id ${:room_id}
set message_id [db_nextval acs_object_id_seq]
::xo::dc dml save_message {
    insert into chat_msgs (
                           msg_id,
                           room_id,
                           msg,
                           creation_user,
                           creation_ip,
                           creation_date)
    values (
            :message_id,
            :room_id,
            :msg,
            :creation_user,
            :creation_ip,
            current_timestamp
            )
}
XQL Not present:
Generic, PostgreSQL, Oracle
[ hide source ] | [ make this the default ]
Show another procedure: