From e06d9e97c56d119c35c59ba65c7437a28115e4a0 Mon Sep 17 00:00:00 2001 From: marijus Date: Wed, 12 Feb 2014 21:31:11 +0100 Subject: make chatrooms in /chat/channel visible to observers aswell --- include/chat.php | 6 ++++-- include/widgets.php | 9 ++++++--- 2 files changed, 10 insertions(+), 5 deletions(-) (limited to 'include') diff --git a/include/chat.php b/include/chat.php index fb1d4fe65..5a17230e0 100644 --- a/include/chat.php +++ b/include/chat.php @@ -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; -} \ No newline at end of file +} diff --git a/include/widgets.php b/include/widgets.php index 0151f7c27..7c316410e 100644 --- a/include/widgets.php +++ b/include/widgets.php @@ -578,13 +578,16 @@ function widget_menu_preview($arr) { } function widget_chatroom_list($arr) { + + $a = get_app(); + require_once("include/chat.php"); - $r = chatroom_list(local_user()); - $channel = get_app()->get_channel(); + $r = chatroom_list($a->profile['profile_uid']); + return replace_macros(get_markup_template('chatroomlist.tpl'),array( '$header' => t('Chat Rooms'), '$baseurl' => z_root(), - '$nickname' => $channel['channel_address'], + '$nickname' => $a->profile['channel_address'], '$items' => $r, )); } -- cgit v1.2.3 From 18b2ff9c24d2384f57009d86cab9a3a82d3dc7b8 Mon Sep 17 00:00:00 2001 From: marijus Date: Wed, 12 Feb 2014 21:36:20 +0100 Subject: whitespace --- include/widgets.php | 3 --- 1 file changed, 3 deletions(-) (limited to 'include') diff --git a/include/widgets.php b/include/widgets.php index 7c316410e..3c2333323 100644 --- a/include/widgets.php +++ b/include/widgets.php @@ -578,12 +578,9 @@ function widget_menu_preview($arr) { } function widget_chatroom_list($arr) { - $a = get_app(); - require_once("include/chat.php"); $r = chatroom_list($a->profile['profile_uid']); - return replace_macros(get_markup_template('chatroomlist.tpl'),array( '$header' => t('Chat Rooms'), '$baseurl' => z_root(), -- cgit v1.2.3