make chatrooms in /chat/channel visible to observers aswell

This commit is contained in:
marijus
2014-02-12 21:31:11 +01:00
parent e47035f85a
commit e06d9e97c5
2 changed files with 10 additions and 5 deletions

View File

@@ -173,10 +173,12 @@ function chatroom_leave($observer_xchan,$room_id,$client) {
function chatroom_list($uid) {
require_once('include/security.php');
$sql_extra = permissions_sql($uid);
$r = q("select cr_name, cr_id, count(cp_id) as cr_inroom from chatroom left join chatpresence on cr_id = cp_room where cr_uid = %d group by cr_name order by cr_name",
$r = q("select cr_name, cr_id, count(cp_id) as cr_inroom from chatroom left join chatpresence on cr_id = cp_room where cr_uid = %d $sql_extra group by cr_name order by cr_name",
intval($uid)
);
return $r;
}
}