- Publicity: Public Only All
xotcl-chat-procs.tcl
Chat Objects
- Location:
- packages/chat/tcl/xotcl-chat-procs.tcl
- Author:
- Antonio Pisano
Procedures in this file
- chat::Package proc flush_rooms (public)
- chat::Package proc get_user_name (public)
- xo::db::chat_room instproc ban_user (public)
- xo::db::chat_room instproc count_messages (public)
- xo::db::chat_room instproc create_transcript (public)
- xo::db::chat_room instproc delete (public)
- xo::db::chat_room instproc delete_messages (public)
- xo::db::chat_room instproc flush (public)
- xo::db::chat_room instproc grant_creator (public)
- xo::db::chat_room instproc grant_moderator (public)
- xo::db::chat_room instproc grant_user (public)
- xo::db::chat_room instproc post_message (public)
- xo::db::chat_room instproc revoke_moderator (public)
- xo::db::chat_room instproc revoke_user (public)
- xo::db::chat_room instproc save_new (public)
- xo::db::chat_room instproc transcript_messages (public)
- xo::db::chat_room instproc unban_user (public)
- xo::db::chat_transcript instproc save_new (public)
Detailed information
chat::Package proc flush_rooms (public)
chat::Package flush_rooms
Flush every room supposed to be archived and automatically flushed. Meant to be executed in a scheduled procedure.
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
chat::Package proc get_user_name (public)
chat::Package get_user_name -user_id user_id
Retrieves the username supposed to be displayed in the chat UI: aither the screen name or the person name when the former is missing.
- Switches:
- -user_id
(required)- Returns:
- a username
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
xo::db::chat_room instproc ban_user (public)
<instance of xo::db::chat_room> ban_user -party_id party_id
Bans specified user from the chat room
- Switches:
- -party_id
(required)- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
xo::db::chat_room instproc count_messages (public)
<instance of xo::db::chat_room> count_messages
Count messages currently persisted for this chat room.
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
xo::db::chat_room instproc create_transcript (public)
<instance of xo::db::chat_room> create_transcript \ [ -pretty_name pretty_name ] [ -description description ] \ [ -creation_user creation_user ] [ -creation_ip creation_ip ]
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):
- Testcases:
- No testcase defined.
xo::db::chat_room instproc delete (public)
<instance of xo::db::chat_room> delete args [ args... ]
Delete the chat room and all of its transcripts
- Parameters:
- args
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
xo::db::chat_room instproc delete_messages (public)
<instance of xo::db::chat_room> delete_messages
Delete all persisted messages from the chat room.
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
xo::db::chat_room instproc flush (public)
<instance of xo::db::chat_room> flush
Save all currently persisted messages for this chat room as a new transcript and then delete them.
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
xo::db::chat_room instproc grant_creator (public)
<instance of xo::db::chat_room> grant_creator
Grants operative privileges to the chat creator (when available on the chat room object). In detail the permissions to edit, view and delete the chat room and also to create transcripts of it.
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
xo::db::chat_room instproc grant_moderator (public)
<instance of xo::db::chat_room> grant_moderator \ -party_id party_id
Make specified party the chat room moderator
- Switches:
- -party_id
(required)- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
xo::db::chat_room instproc grant_user (public)
<instance of xo::db::chat_room> grant_user -party_id party_id
Grants operative privileges to the specified party. In detail, the permission to read and write for the chat room.
- Switches:
- -party_id
(required)- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
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 ]
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):
- Testcases:
- No testcase defined.
xo::db::chat_room instproc revoke_moderator (public)
<instance of xo::db::chat_room> revoke_moderator \ -party_id party_id
Revoke moderation rights on the chat room for specified party
- Switches:
- -party_id
(required)- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
xo::db::chat_room instproc revoke_user (public)
<instance of xo::db::chat_room> revoke_user -party_id party_id
Revokes operative privileges to the specified party. In detail, the permission to read and write for the chat room.
- Switches:
- -party_id
(required)- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
xo::db::chat_room instproc save_new (public)
<instance of xo::db::chat_room> save_new \ [ -creation_user creation_user ] args [ args... ]
Create a new chat room and make sure its creator is granted the necessary privileges
- Switches:
- -creation_user
(optional)- Parameters:
- args
- Returns:
- new chat room id
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
xo::db::chat_room instproc transcript_messages (public)
<instance of xo::db::chat_room> transcript_messages
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):
- Testcases:
- No testcase defined.
xo::db::chat_room instproc unban_user (public)
<instance of xo::db::chat_room> unban_user -party_id party_id
Lift ban on specified user from the chat room
- Switches:
- -party_id
(required)- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
xo::db::chat_transcript instproc save_new (public)
<instance of xo::db::chat_transcript> save_new args [ args... ]
Save a new transcript, making sure its creator is granted the necessary operative privileges.
- Parameters:
- args
- Returns:
- new transcript id
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.