aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorMario Vavti <mario@mariovavti.com>2016-03-30 14:31:55 +0200
committerMario Vavti <mario@mariovavti.com>2016-03-30 14:31:55 +0200
commit5462453bf2bde50166c68f90b08d24826dd07ba8 (patch)
tree8951f8c1f38cb9847419fce8874a89325da6fe54 /include
parente4f360505466d4701ea4ac8f8bec18fac5b4c3ec (diff)
downloadvolse-hubzilla-5462453bf2bde50166c68f90b08d24826dd07ba8.tar.gz
volse-hubzilla-5462453bf2bde50166c68f90b08d24826dd07ba8.tar.bz2
volse-hubzilla-5462453bf2bde50166c68f90b08d24826dd07ba8.zip
some work on mod chat
Diffstat (limited to 'include')
-rw-r--r--include/chat.php2
-rw-r--r--include/nav.php4
-rw-r--r--include/widgets.php15
3 files changed, 11 insertions, 10 deletions
diff --git a/include/chat.php b/include/chat.php
index 81c5c5d62..8a5970cca 100644
--- a/include/chat.php
+++ b/include/chat.php
@@ -202,7 +202,7 @@ 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 $sql_extra group by cr_name, cr_id order by cr_name",
+ $r = q("select allow_cid, allow_gid, deny_cid, deny_gid, 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, cr_id order by cr_name",
intval($uid)
);
diff --git a/include/nav.php b/include/nav.php
index 5f630745c..4e9a8ab19 100644
--- a/include/nav.php
+++ b/include/nav.php
@@ -92,10 +92,8 @@ EOT;
$nav['usermenu'][] = Array('photos/' . $channel['channel_address'], t('Photos'), "", t('Your photos'),'photos_nav_btn');
$nav['usermenu'][] = Array('cloud/' . $channel['channel_address'],t('Files'),"",t('Your files'),'cloud_nav_btn');
- require_once('include/chat.php');
- $has_chats = chatroom_list_count(local_channel());
if(! UNO)
- $nav['usermenu'][] = Array('chat/' . $channel['channel_address'] . (($has_chats) ? '' : '/new'), t('Chat'),"",t('Your chatrooms'),'chat_nav_btn');
+ $nav['usermenu'][] = Array('chat/' . $channel['channel_address'], t('Chat'),"",t('Your chatrooms'),'chat_nav_btn');
require_once('include/menu.php');
diff --git a/include/widgets.php b/include/widgets.php
index ac0b6a84f..2aa3dccf1 100644
--- a/include/widgets.php
+++ b/include/widgets.php
@@ -797,12 +797,15 @@ function widget_chatroom_list($arr) {
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(),
- '$nickname' => $a->profile['channel_address'],
- '$items' => $r,
- ));
+
+ if($r) {
+ return replace_macros(get_markup_template('chatroomlist.tpl'), array(
+ '$header' => t('Chat Rooms'),
+ '$baseurl' => z_root(),
+ '$nickname' => $a->profile['channel_address'],
+ '$items' => $r,
+ ));
+ }
}
function widget_bookmarkedchats($arr) {