Class ::chat::Package

::chat::Package[i] create ...

Defined in

Class Relations

  • class: ::xotcl::Class[i]
  • superclass: ::xotcl::Object[i]
::xotcl::Class create ::chat::Package \
     -superclass ::xotcl::Object

Methods (to be applied on the object)

  • flush_rooms (scripted, public)

     chat::Package[i] flush_rooms

    Flush every room supposed to be archived and automatically flushed. Meant to be executed in a scheduled procedure.

    Testcases:
    No testcase defined.
    foreach room_id [::xo::dc list get_rooms {
        select room_id from chat_rooms
        where archive_p = 't' and auto_flush_p = 't'
    }] {
        set room [::xo::db::Class get_instance_from_db -id $room_id]
        $room flush
    }
  • get_user_name (scripted, public)

     chat::Package[i] 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

    Testcases:
    No testcase defined.
    set name [acs_user::get_user_info -user_id $user_id -element screen_name]
    if {$name eq ""} {
        set name [person::name -person_id $user_id]
    }
    return $name