diff --git a/mod/chat/chatd.php b/mod/chat/chatd.php
index 729e8dcfcc8..f8557eac401 100755
--- a/mod/chat/chatd.php
+++ b/mod/chat/chatd.php
@@ -23,8 +23,9 @@ echo 'Moodle chat daemon v1.0 on PHP '.$phpversion." (\$Id$)\n\n";
/// $CFG variables are now defined in database by chat/lib.php
-$_SERVER['PHP_SELF'] = 'dummy';
-$_SERVER['SERVER_NAME'] = 'dummy';
+$_SERVER['PHP_SELF'] = 'dummy';
+$_SERVER['SERVER_NAME'] = 'dummy';
+$_SERVER['HTTP_USER_AGENT'] = 'dummy';
include('../../config.php');
include('lib.php');
@@ -221,7 +222,7 @@ class ChatDaemon {
static $str;
$info = &$this->sets_info[$sessionid];
- $oldlang = chat_language_override($info['lang']);
+ chat_force_language($info['lang']);
$timenow = time();
@@ -274,7 +275,7 @@ class ChatDaemon {
echo fullname($userinfo['user'])."
";
echo "$str->idle: ".format_time($lastping, $str)." ";
echo ''.$str->beep."\n";
+ '&chat_sid='.$sessionid.'">'.$str->beep."\n";
echo "