From: moodler Date: Wed, 5 May 2004 08:19:03 +0000 (+0000) Subject: Hide users in "hidden" chats from students. bug 1308 X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=3120f6f20bf43127c604174a33b62e9add7e5df6;p=moodle.git Hide users in "hidden" chats from students. bug 1308 --- diff --git a/mod/chat/lib.php b/mod/chat/lib.php index 594c5b8171..04bc0eba68 100644 --- a/mod/chat/lib.php +++ b/mod/chat/lib.php @@ -151,8 +151,9 @@ function chat_print_recent_activity($course, $isteacher, $timestart) { return false; } - print_headline(get_string("currentchats", "chat").":"); + $isteacher = isteacher($course->id); + $outputstarted = false; $current = 0; foreach ($chatusers as $chatuser) { if ($current != $chatuser->chatid) { @@ -160,6 +161,13 @@ function chat_print_recent_activity($course, $isteacher, $timestart) { echo "

"; } if ($chat = get_record("chat", "id", $chatuser->chatid)) { + if (!($isteacher or instance_is_visible('chat', $chat))) { // Chat hidden to students + continue; + } + if (!$outputstarted) { + print_headline(get_string("currentchats", "chat").":"); + $outputstarted = true; + } echo "

wwwroot/mod/chat/view.php?c=$chat->id\">$chat->name
"; } $current = $chatuser->chatid;