aboutsummaryrefslogtreecommitdiffstats
path: root/mod/lockview.php
diff options
context:
space:
mode:
authorPaolo Tacconi <p.tacconi@giunti.it>2016-04-15 09:22:27 +0200
committerPaolo Tacconi <p.tacconi@giunti.it>2016-04-15 09:22:27 +0200
commitc38c79d71c8ef70ef649f83e322f1984b75ee2dd (patch)
tree958fcd22f04546f40b6ac68bb58cfe1a1b1fb7f6 /mod/lockview.php
parent1806da0851dd5cf5978b19d12783ae3101a11257 (diff)
parent45a854762b451dafb882bc56efce054b64420627 (diff)
downloadvolse-hubzilla-c38c79d71c8ef70ef649f83e322f1984b75ee2dd.tar.gz
volse-hubzilla-c38c79d71c8ef70ef649f83e322f1984b75ee2dd.tar.bz2
volse-hubzilla-c38c79d71c8ef70ef649f83e322f1984b75ee2dd.zip
Merge branch 'redmatrix-master'
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>';