%3 ::xotcl::Object ::xotcl::Object ::chat::Package ::chat::Package → flush_rooms → get_user_name ::chat::Package->::xotcl::Object

Class ::chat::Package

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

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.

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

    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

    Partial Call Graph (max 5 caller/called nodes):
    %3 acs_user::get_user_info acs_user::get_user_info (public) person::name person::name (public) chat::Package proc get_user_name chat::Package proc get_user_name chat::Package proc get_user_name->acs_user::get_user_info chat::Package proc get_user_name->person::name

    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