break;
             }
             if (empty($message_data['author_id']) || false === strpos(',' . $current_user->muted_users . ',', ',' . $message_data['author_id'] . ',')) {
                 $message_data['body'] = $badword->filterString($message_data['body']);
                 $message_data['actor_nickname'] = $actor_nickname;
                 $msg_array[] = $message_data;
             }
         }
         if (!empty($msg_array)) {
             $xml_data['chat_message'] = $msg_array;
         }
         unset($msg_array);
     }
     if (!empty($full_request)) {
         // Collect full data
         $xml_data['category'] = $category->getTree($current_user->id, $session->_s_room_id);
         unset($xml_data['category'][0]);
         // Root element not needed; get flat data
     }
 }
 // Get new invitations
 $invitations = $invitation->getNewInvitations($current_user->id, true);
 if (!empty($invitations)) {
     $xml_data['invitation'] = $invitations;
 }
 unset($invitations);
 // "Message timestamp" preference
 if (!empty($pref_timestamp) && $current_user->show_message_time != 'y') {
     $current_user->show_message_time = 'y';
     $current_user->_db_updateObj($current_user->id);
 } elseif (empty($pref_timestamp) && $current_user->show_message_time != 'n') {
 *    You should have received a copy of the GNU General Public License
 *    along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
if (!isset($recursion)) {
    $recursion = 1;
}
$invitations_arrived = 0;
$messages_arrived = 0;
$categories_tree = array();
if (!empty($current_user->id)) {
    $xmlwriter->setHeaderMessage('OK');
    $xmlwriter->setHeaderStatus(0);
    // Get room structure
    _pcpin_loadClass('category');
    $category = new PCPIN_Category($session);
    $categories_tree = $category->getTree($current_user->id, 0, !empty($recursion));
    // Are there any invitations or abuse reports?
    if (!empty($current_user->id)) {
        _pcpin_loadClass('invitation');
        $invitation = new PCPIN_Invitation($session);
        $invitations = $invitation->getNewInvitations($current_user->id, true);
        $invitations_arrived = !empty($invitations) ? 1 : 0;
        unset($invitations);
        _pcpin_loadClass('message');
        $msg = new PCPIN_Message($session);
        $messages = $msg->getNewMessages($session->_s_user_id);
        if (!empty($messages)) {
            $messages_arrived = 1;
        }
    }
}