xo::db::chat_room instproc post_message (public)
<instance of xo::db::chat_room> post_message [ -msg msg ] \ [ -creation_user creation_user ] [ -creation_ip creation_ip ]
Defined in /var/www/openacs.org/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
- 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