From: moodler Date: Mon, 23 Aug 2004 14:40:53 +0000 (+0000) Subject: Miscellaneous fixes from the PJ man X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=fbabbd235b209b5ff74858dcb5d020cef7eb3084;p=moodle.git Miscellaneous fixes from the PJ man --- diff --git a/mod/chat/chatd.php b/mod/chat/chatd.php index 4b13452ab6..ebdeb9f5e6 100755 --- a/mod/chat/chatd.php +++ b/mod/chat/chatd.php @@ -78,7 +78,7 @@ class ChatDaemon { // This will set it just fine for bookkeeping purposes. if($now - $this->sets_info[$sessionid]['lastinfocommit'] > $this->live_data_update_threshold) { // commit to permanent storage - trace('Committing volatile lastmessageping for session '.$sessionid); + // trace('Committing volatile lastmessageping for session '.$sessionid); $this->sets_info[$sessionid]['lastinfocommit'] = $now; update_record('chat_users', $this->sets_info[$sessionid]['chatuser']); } @@ -151,6 +151,9 @@ class ChatDaemon { } echo ''; + // About 2K of HTML comments to force browsers to render the HTML + echo $GLOBALS['CHAT_DUMMY_DATA']; + echo "\n\n"; chat_language_restore($oldlang); @@ -221,31 +224,7 @@ class ChatDaemon { break; case CHAT_SIDEKICK_USERS: - /* - //$x = pusers($this->sets_info[$sessionid]['chatid'], $this->sets_info[$sessionid]['groupid']); - //$x = "Lalalala! ".time().""; - - $header = "HTTP/1.1 200 OK\n"; - $header .= "Connection: close\n"; - $header .= "Date: ".date('r')."\n"; - $header .= "Server: Moodle\n"; - $header .= "Content-Type: text/html\n"; - $header .= "Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT\n"; - $header .= "Cache-Control: no-cache, must-revalidate\n"; - $header .= "Expires: Wed, 4 Oct 1978 09:32:45 GMT\n"; - //$header .= "Refresh: 3; url=http://$CFG->chat_serverhost:$CFG->chat_serverport?win=users&". - // "chat_sid=".$sessionid."&groupid=".$this->sets_info[$sessionid]['groupid']."\n"; - $header .= "\n"; - - $x = $header.$x; -*/ - -/* - trace('Outputting user list('.strlen($x).' chars)'); - //trace($x); - - chat_socket_write($handle, $x); -*/ + // A request to paint a user window $content = $this->get_user_window($sessionid); diff --git a/mod/chat/gui_sockets/index.php b/mod/chat/gui_sockets/index.php index 4d19d0a59a..2b5783d506 100644 --- a/mod/chat/gui_sockets/index.php +++ b/mod/chat/gui_sockets/index.php @@ -1,26 +1,26 @@ course)) { - error("Could not find the course this belongs to!"); + if (!$course = get_record('course', 'id', $chat->course)) { + error('Could not find the course this belongs to!'); } - if (!$cm = get_coursemodule_from_instance("chat", $chat->id, $course->id)) { - error("Course Module ID was incorrect"); + if (!$cm = get_coursemodule_from_instance('chat', $chat->id, $course->id)) { + error('Course Module ID was incorrect'); } require_login($course->id); if (isguest()) { - error("Guest does not have access to chat rooms"); + error('Guest does not have access to chat rooms'); } /// Check to see if groups are being used here @@ -67,7 +67,7 @@ require_once('../../../config.php'); chat_serverhost:$CFG->chat_serverport?win=users&$params"; ?>" name="users" scrolling="auto" marginwidth="5" marginheight="5"> - diff --git a/mod/chat/lib.php b/mod/chat/lib.php index c3d430ad52..2bba3c2d51 100644 --- a/mod/chat/lib.php +++ b/mod/chat/lib.php @@ -46,6 +46,8 @@ $CHAT_HTMLHEAD_MSGINPUT = "Message Input\n\nbody\" OnLoad=\"document.f.arsc_message.focus();document.f.arsc_message.select();\">"; +// Dummy data that gets output to the browser as needed, in order to make it show output +$CHAT_DUMMY_DATA = "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n"; function chat_add_instance($chat) { /// Given an object containing all the necessary data,