id; $token = $thread->lastToken; $chatstyle = verifyparam( "style", "/^\w+$/", ""); header("Location: $webimroot/client.php?thread=$threadid&token=$token".($chatstyle ? "&style=$chatstyle" : "")); exit; } $token = verifyparam( "token", "/^\d{1,8}$/"); $threadid = verifyparam( "thread", "/^\d{1,8}$/"); $thread = Thread::load($threadid, $token); if (! $thread) { die("wrong thread"); } $page = setup_chatview_for_user($thread); $pparam = verifyparam( "act", "/^(mailthread)$/", "default"); if( $pparam == "mailthread" ) { expand("styles/dialogs", getchatstyle(), "mail.tpl"); } else { // Build js application options $page['chatOptions'] = json_encode($page['chat']); // Expand page expand("styles/dialogs", getchatstyle(), "chat.tpl"); } ?>