From 3120f6f20bf43127c604174a33b62e9add7e5df6 Mon Sep 17 00:00:00 2001
From: moodler
Date: Wed, 5 May 2004 08:19:03 +0000
Subject: [PATCH] Hide users in "hidden" chats from students. bug 1308
---
mod/chat/lib.php | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
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;
--
2.39.5