aboutsummaryrefslogtreecommitdiffstats
path: root/mod/lockview.php
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 /mod/lockview.php
parente4f360505466d4701ea4ac8f8bec18fac5b4c3ec (diff)
downloadvolse-hubzilla-5462453bf2bde50166c68f90b08d24826dd07ba8.tar.gz
volse-hubzilla-5462453bf2bde50166c68f90b08d24826dd07ba8.tar.bz2
volse-hubzilla-5462453bf2bde50166c68f90b08d24826dd07ba8.zip
some work on mod chat
Diffstat (limited to 'mod/lockview.php')
-rw-r--r--mod/lockview.php30
1 files changed, 25 insertions, 5 deletions
diff --git a/mod/lockview.php b/mod/lockview.php
index 84c16f658..d4a626a11 100644
--- a/mod/lockview.php
+++ b/mod/lockview.php
@@ -14,11 +14,21 @@ function lockview_content(&$a) {
if(! $item_id)
killme();
- if (!in_array($type, array('item','photo','event', 'menu_item')))
+ if (!in_array($type, array('item','photo','event', 'menu_item', 'chatroom')))
killme();
- //we have different naming in in menu_item table
- $id = (($type == 'menu_item') ? 'mitem_id' : 'id');
+ //we have different naming in in menu_item table and chatroom table
+ switch($type) {
+ case 'menu_item':
+ $id = 'mitem_id';
+ break;
+ case 'chatroom':
+ $id = 'cr_id';
+ break;
+ default:
+ $id = 'id';
+ break;
+ }
$r = q("SELECT * FROM %s WHERE $id = %d LIMIT 1",
dbesc($type),
@@ -30,8 +40,18 @@ function lockview_content(&$a) {
$item = $r[0];
- //we have different naming in in menu_item table
- $uid = (($type == 'menu_item') ? $item['mitem_channel_id'] : $item['uid']);
+ //we have different naming in in menu_item table and chatroom table
+ switch($type) {
+ case 'menu_item':
+ $uid = $item['mitem_channel_id'];
+ break;
+ case 'chatroom':
+ $uid = $item['cr_uid'];
+ break;
+ default:
+ $uid = $item['uid'];
+ break;
+ }
if($uid != local_channel()) {
echo '<li>' . t('Remote privacy information not available.') . '</li>';