diff --git a/Zotlabs/Lib/Activity.php b/Zotlabs/Lib/Activity.php
index 4c856f336..13090338c 100644
--- a/Zotlabs/Lib/Activity.php
+++ b/Zotlabs/Lib/Activity.php
@@ -2280,18 +2280,20 @@ class Activity {
if (! $n) {
break;
}
- $a = new ActivityStreams($n);
+ // set client flag to convert objects to implied activities
+ $a = new ActivityStreams($n,null,true);
if ($a->type === 'Announce' && is_array($a->obj)
&& array_key_exists('object',$a->obj) && array_key_exists('actor',$a->obj)) {
// This is a relayed/forwarded Activity (as opposed to a shared/boosted object)
// Reparse the encapsulated Activity and use that instead
logger('relayed activity',LOGGER_DEBUG);
- $a = new ActivityStreams($a->obj);
+ $a = new ActivityStreams($a->obj,null,true);
}
logger($a->debug());
if (! $a->is_valid()) {
+ logger('not a valid activity');
break;
}
if (is_array($a->actor) && array_key_exists('id',$a->actor)) {
@@ -2300,7 +2302,7 @@ class Activity {
$item = null;
- switch($a->type) {
+ switch ($a->type) {
case 'Create':
case 'Update':
case 'Like':
diff --git a/Zotlabs/Lib/Libzot.php b/Zotlabs/Lib/Libzot.php
index 1ea965880..20c23d48a 100644
--- a/Zotlabs/Lib/Libzot.php
+++ b/Zotlabs/Lib/Libzot.php
@@ -1050,7 +1050,7 @@ class Libzot {
}
if (! is_array($x)) {
- btlogger('failed communication - no useful response: ' . $x);
+ logger('no useful response: ' . $x);
}
if ($x) {
diff --git a/Zotlabs/Module/Display.php b/Zotlabs/Module/Display.php
index 89504c6e3..ef7cc68d0 100644
--- a/Zotlabs/Module/Display.php
+++ b/Zotlabs/Module/Display.php
@@ -122,7 +122,7 @@ class Display extends Controller {
// \App::$poi = $x[0];
}
- //if the item is to be moderated redirect to /moderate
+ // if the item is to be moderated redirect to /moderate
if($target_item['item_blocked'] == ITEM_MODERATED) {
goaway(z_root() . '/moderate/' . $target_item['id']);
}
@@ -283,42 +283,21 @@ class Display extends Controller {
}
if($r === null) {
-
- // in case somebody turned off public access to sys channel content using permissions
- // make that content unsearchable by ensuring the owner uid can't match
-
- if(! perm_is_allowed($sysid,$observer_hash,'view_stream'))
- $sysid = 0;
-
- $r = q("SELECT item.id as item_id from item
- WHERE mid = '%s'
- AND (((( item.allow_cid = '' AND item.allow_gid = '' AND item.deny_cid = ''
- AND item.deny_gid = '' AND item_private = 0 )
- and uid in ( " . stream_perms_api_uids(($observer_hash) ? (PERMS_NETWORK|PERMS_PUBLIC) : PERMS_PUBLIC) . " ))
- OR uid = %d )
- $sql_extra )
- $item_normal
- limit 1",
- dbesc($target_item['parent_mid']),
- intval($sysid)
+ $r = q("SELECT item.id as item_id from item WHERE mid = '%s' $sql_extra $item_normal limit 1",
+ dbesc($target_item['parent_mid'])
);
}
}
- elseif($update && !$load) {
+ elseif ($update && !$load) {
$r = null;
require_once('include/channel.php');
$sys = get_sys_channel();
$sysid = $sys['channel_id'];
- if(local_channel()) {
- $r = q("SELECT item.parent AS item_id from item
- WHERE uid = %d
- and parent_mid = '%s'
- $item_normal_update
- $simple_update
- limit 1",
+ if (local_channel()) {
+ $r = q("SELECT item.parent AS item_id from item WHERE uid = %d and parent_mid = '%s' $item_normal_update $simple_update limit 1",
intval(local_channel()),
dbesc($target_item['parent_mid'])
);
@@ -328,22 +307,8 @@ class Display extends Controller {
}
if(! $r) {
- // in case somebody turned off public access to sys channel content using permissions
- // make that content unsearchable by ensuring the owner_xchan can't match
- if(! perm_is_allowed($sysid,$observer_hash,'view_stream'))
- $sysid = 0;
- $r = q("SELECT item.parent AS item_id from item
- WHERE parent_mid = '%s'
- AND (((( item.allow_cid = '' AND item.allow_gid = '' AND item.deny_cid = ''
- AND item.deny_gid = '' AND item_private = 0 )
- and uid in ( " . stream_perms_api_uids(($observer_hash) ? (PERMS_NETWORK|PERMS_PUBLIC) : PERMS_PUBLIC) . " ))
- OR uid = %d )
- $sql_extra )
- $item_normal_update
- $simple_update
- limit 1",
- dbesc($target_item['parent_mid']),
- intval($sysid)
+ $r = q("SELECT item.parent AS item_id from item WHERE parent_mid = '%s' $sql_extra $item_normal_update $simple_update limit 1",
+ dbesc($target_item['parent_mid'])
);
}
$_SESSION['loadtime'] = datetime_convert();
@@ -370,7 +335,6 @@ class Display extends Controller {
$items = array();
}
-
switch($module_format) {
case 'html':
diff --git a/Zotlabs/Module/Manage.php b/Zotlabs/Module/Manage.php
index 64b09fc74..48164194f 100644
--- a/Zotlabs/Module/Manage.php
+++ b/Zotlabs/Module/Manage.php
@@ -181,10 +181,10 @@ class Manage extends Controller {
'$msg_selected' => t('Current Channel'),
'$selected' => local_channel(),
'$desc' => t('Switch to one of your channels by selecting it.'),
- '$msg_default' => t('Default Channel'),
+ '$msg_default' => t('Default Login Channel'),
'$msg_make_default' => t('Make Default'),
'$msg_include' => t('Add to menu'),
- '$msg_no_include' => t('Remove from menu'),
+ '$msg_no_include' => t('Add to menu'),
'$create' => $create,
'$all_channels' => $channels,
'$mail_format' => t('%d new messages'),
diff --git a/Zotlabs/Module/Pubstream.php b/Zotlabs/Module/Pubstream.php
index 9a7076b76..bd2df9484 100644
--- a/Zotlabs/Module/Pubstream.php
+++ b/Zotlabs/Module/Pubstream.php
@@ -88,11 +88,6 @@ class Pubstream extends Controller {
$o .= status_editor($a,$x);
$o .= '';
}
-
-
-
-
-
if(! $update && !$load) {
@@ -162,7 +157,7 @@ class Pubstream extends Controller {
require_once('include/security.php');
if($site_firehose) {
- $uids = " and item.uid in ( " . stream_perms_api_uids(PERMS_PUBLIC) . " ) and item_private = 0 and item_wall = 1 ";
+ $uids = " and item_private = 0 and item_wall = 1 ";
}
else {
$sys = get_sys_channel();
diff --git a/Zotlabs/Module/Search.php b/Zotlabs/Module/Search.php
index 1858bf813..ecac0c99c 100644
--- a/Zotlabs/Module/Search.php
+++ b/Zotlabs/Module/Search.php
@@ -163,36 +163,23 @@ class Search extends \Zotlabs\Web\Controller {
$itemspage = get_pconfig(local_channel(),'system','itemspage');
App::set_pager_itemspage(((intval($itemspage)) ? $itemspage : 20));
$pager_sql = sprintf(" LIMIT %d OFFSET %d ", intval(\App::$pager['itemspage']), intval(\App::$pager['start']));
-
- // in case somebody turned off public access to sys channel content with permissions
-
- if (! perm_is_allowed($sys['channel_id'],$observer_hash,'view_stream'))
- $sys['xchan_hash'] .= 'disabled';
-
+
if ($load) {
$r = null;
if (local_channel()) {
- $r = q("SELECT mid, MAX(id) as item_id from item
- WHERE ((( item.allow_cid = '' AND item.allow_gid = '' AND item.deny_cid = '' AND item.deny_gid = '' AND item_private = 0 )
- OR ( item.uid = %d )) OR item.owner_xchan = '%s' )
+ $r = q("SELECT mid, MAX(id) as item_id from item where uid = %d
$item_normal
$sql_extra
group by mid, created order by created desc $pager_sql ",
- intval(local_channel()),
- dbesc($sys['xchan_hash'])
+ intval(local_channel())
);
}
if ($r === null) {
- $r = q("SELECT mid, MAX(id) as item_id from item
- WHERE (((( item.allow_cid = '' AND item.allow_gid = '' AND item.deny_cid = ''
- AND item.deny_gid = '' AND item_private = 0 )
- and owner_xchan in ( " . stream_perms_xchans(($observer) ? (PERMS_NETWORK|PERMS_PUBLIC) : PERMS_PUBLIC) . " ))
- $pub_sql ) OR owner_xchan = '%s')
+ $r = q("SELECT mid, MAX(id) as item_id from item $pub_sql
$item_normal
$sql_extra
- group by mid, created order by created desc $pager_sql",
- dbesc($sys['xchan_hash'])
+ group by mid, created order by created desc $pager_sql"
);
}
if ($r) {
diff --git a/Zotlabs/Module/Settings/Channel.php b/Zotlabs/Module/Settings/Channel.php
index 12b1cb3d9..89685d235 100644
--- a/Zotlabs/Module/Settings/Channel.php
+++ b/Zotlabs/Module/Settings/Channel.php
@@ -512,7 +512,7 @@ class Channel {
$autoperms = '';
}
- $hyperdrive = [ 'hyperdrive', t('Enable hyperdrive'), ((get_pconfig(local_channel(),'system','hyperdrive',true)) ? 1 : 0), t('Import public third-party conversations in which your connections participate.'), $yes_no ];
+ $hyperdrive = [ 'hyperdrive', t('Friend-of-friend conversations'), ((get_pconfig(local_channel(),'system','hyperdrive',true)) ? 1 : 0), t('Import public third-party conversations in which your connections participate.'), $yes_no ];
if (get_config('system','activitypub')) {
$apconfig = true;
diff --git a/Zotlabs/Module/Siteinfo.php b/Zotlabs/Module/Siteinfo.php
index 144ec2ef0..f03365824 100644
--- a/Zotlabs/Module/Siteinfo.php
+++ b/Zotlabs/Module/Siteinfo.php
@@ -2,6 +2,7 @@
namespace Zotlabs\Module;
use Zotlabs\Lib\System;
+use Zotlabs\Lib\Config;
use Zotlabs\Web\Controller;
class Siteinfo extends Controller {
@@ -15,11 +16,9 @@ class Siteinfo extends Controller {
function get() {
- if(! get_config('system','activitypub')) {
- $federated = [ 'zot6' ];
- }
- else {
- $federated = [ 'zot6','activitypub' ];
+ $federated = 'Zot6';
+ if (Config::get('system','activitypub')) {
+ $federated .= ', ActivityPub';
}
@@ -41,8 +40,8 @@ class Siteinfo extends Controller {
'$transport_link' => 'https://zotlabs.com',
'$ebs' => System::ebs(),
- '$additional_text' => t('Additional federated transport protocols:'),
- '$additional_fed' => implode(', ',array_unique($federated)),
+ '$additional_text' => t('Federated transport protocols:'),
+ '$additional_fed' => $federated,
'$prj_version' => ((get_config('system','hidden_version_siteinfo')) ? '' : sprintf( t('Version %s'), System::get_project_version())),
'$prj_linktxt' => t('Project homepage'),
'$prj_srctxt' => t('Developer homepage'),
diff --git a/boot.php b/boot.php
index 057331f01..23b8fb055 100755
--- a/boot.php
+++ b/boot.php
@@ -48,7 +48,7 @@ require_once('include/items.php');
-define ( 'STD_VERSION', '19.10.5' );
+define ( 'STD_VERSION', '19.10.9' );
define ( 'ZOT_REVISION', '6.0' );
define ( 'DB_UPDATE_VERSION', 1236 );
diff --git a/include/nav.php b/include/nav.php
index bc24bd66f..ee1c9d871 100644
--- a/include/nav.php
+++ b/include/nav.php
@@ -31,9 +31,8 @@ function nav($template = 'default') {
);
if(! $_SESSION['delegate']) {
- $chans = q("select channel_name, channel_id from channel left join pconfig on channel_id = pconfig.uid where channel_account_id = %d and channel_removed = 0 and pconfig.cat = 'system' and pconfig.k = 'include_in_menu' and pconfig.v = '1' and channel_id != %d order by channel_name ",
- intval(get_account_id()),
- intval(local_channel())
+ $chans = q("select channel_name, channel_id from channel left join pconfig on channel_id = pconfig.uid where channel_account_id = %d and channel_removed = 0 and pconfig.cat = 'system' and pconfig.k = 'include_in_menu' and pconfig.v = '1' order by channel_name ",
+ intval(get_account_id())
);
}
diff --git a/include/network.php b/include/network.php
index d841eb6d4..bc05c80b8 100644
--- a/include/network.php
+++ b/include/network.php
@@ -1632,6 +1632,10 @@ function get_site_info() {
}
}
+ $protocols = [ 'zot' ];
+ if (get_config('system','activitypub')) {
+ $protocols[] = 'activitypub';
+ }
$data = [
'url' => z_root(),
@@ -1642,6 +1646,7 @@ function get_site_info() {
'addon_version' => defined('ADDON_VERSION') ? ADDON_VERSION : 'unknown',
'server_role' => System::get_server_role(),
'commit' => $commit,
+ 'protocols' => $protocols,
'plugins' => $visible_plugins,
'register_policy' => $register_policy[get_config('system','register_policy')],
'invitation_only' => (bool) intval(get_config('system','invitation_only')),
diff --git a/include/security.php b/include/security.php
index 0f5bd2da3..de5a1ab8c 100644
--- a/include/security.php
+++ b/include/security.php
@@ -684,103 +684,3 @@ function get_security_ids($channel_id, $ob_hash) {
return $ret;
}
-
-
-// This is used to determine which uid have posts which are visible to the logged in user (from the API) for the
-// public_timeline, and we can use this in a community page by making
-// $perms = (PERMS_NETWORK|PERMS_PUBLIC) unless logged in.
-// Collect uids of everybody on this site who has opened their posts to everybody on this site (or greater visibility)
-// We always include yourself if logged in because you can always see your own posts
-// resolving granular permissions for the observer against every person and every post on the site
-// will likely be too expensive.
-// Returns a string list of comma separated channel_ids suitable for direct inclusion in a SQL query
-
-function stream_perms_api_uids($perms = NULL, $limit = 0, $rand = 0 ) {
- $perms = is_null($perms) ? (PERMS_SITE|PERMS_NETWORK|PERMS_PUBLIC) : $perms;
-
- $ret = array();
- $limit_sql = (($limit) ? " LIMIT " . intval($limit) . " " : '');
- $random_sql = (($rand) ? " ORDER BY " . db_getfunc('RAND') . " " : '');
- if(local_channel())
- $ret[] = local_channel();
- $x = q("select uid, v from pconfig where cat = 'perm_limits' and k = 'view_stream' ");
- if($x) {
- $y = [];
- foreach($x as $xv) {
- if(intval($xv['v']) & $perms) {
- $y[] = $xv;
- }
- }
- if($y) {
- $ids = ids_to_querystr($y,'uid');
- $r = q("select channel_id from channel where channel_id in ( $ids ) and ( channel_pageflags & %d ) = 0 and channel_system = 0 and channel_removed = 0 $random_sql $limit_sql ",
- intval(PAGE_ADULT|PAGE_CENSORED)
- );
- if($r) {
- foreach($r as $rr)
- if(! in_array($rr['channel_id'], $ret))
- $ret[] = $rr['channel_id'];
- }
- }
- }
-
- $str = '';
- if($ret) {
- foreach($ret as $rr) {
- if($str)
- $str .= ',';
- $str .= intval($rr);
- }
- }
- else
- $str = "''";
-
- logger('stream_perms_api_uids: ' . $str, LOGGER_DEBUG);
-
- return $str;
-}
-
-function stream_perms_xchans($perms = NULL ) {
- $perms = is_null($perms) ? (PERMS_SITE|PERMS_NETWORK|PERMS_PUBLIC) : $perms;
-
- $ret = array();
- if(local_channel())
- $ret[] = get_observer_hash();
-
- $x = q("select uid, v from pconfig where cat = 'perm_limits' and k = 'view_stream' ");
- if($x) {
- $y = [];
- foreach($x as $xv) {
- if(intval($xv['v']) & $perms) {
- $y[] = $xv;
- }
- }
- if($y) {
- $ids = ids_to_querystr($y,'uid');
-
- $r = q("select channel_hash from channel where channel_id in ( $ids ) and ( channel_pageflags & %d ) = 0 and channel_system = 0 and channel_removed = 0 ",
- intval(PAGE_ADULT|PAGE_CENSORED)
- );
-
- if($r) {
- foreach($r as $rr)
- if(! in_array($rr['channel_hash'], $ret))
- $ret[] = $rr['channel_hash'];
- }
- }
- }
- $str = '';
- if($ret) {
- foreach($ret as $rr) {
- if($str)
- $str .= ',';
- $str .= "'" . dbesc($rr) . "'";
- }
- }
- else
- $str = "''";
-
- logger('stream_perms_xchans: ' . $str, LOGGER_DEBUG);
-
- return $str;
-}
diff --git a/include/taxonomy.php b/include/taxonomy.php
index 920475bc8..ba5d97b40 100644
--- a/include/taxonomy.php
+++ b/include/taxonomy.php
@@ -336,7 +336,7 @@ function pub_tagadelic($net,$site,$limit,$recent,$safemode,$type) {
$count = intval($limit);
if($site) {
- $uids = " and item.uid in ( " . stream_perms_api_uids(PERMS_PUBLIC) . " ) and item_private = 0 and item_wall = 1 ";
+ $uids = " and item_private = 0 and item_wall = 1 ";
}
else {
$sys = get_sys_channel();
diff --git a/view/js/acl.js b/view/js/acl.js
index 730b515a0..9415113dd 100644
--- a/view/js/acl.js
+++ b/view/js/acl.js
@@ -207,7 +207,7 @@ ACL.prototype.on_button_hide = function(event) {
ACL.prototype.set_allow = function(itemid) {
type = itemid[0];
- id = itemid.substr(1);
+ id = decodeURIComponent(itemid.substr(1));
switch(type) {
case "g":
if (that.allow_gid.indexOf(id)<0) {
@@ -231,7 +231,7 @@ ACL.prototype.set_allow = function(itemid) {
ACL.prototype.set_deny = function(itemid) {
type = itemid[0];
- id = itemid.substr(1);
+ id = decodeURIComponent(itemid.substr(1));
switch(type) {
case "g":
if (that.deny_gid.indexOf(id)<0) {
@@ -310,8 +310,12 @@ ACL.prototype.update_view = function(value) {
else {
that.list.show(); //show acl-list
+ datasrc2src('#acl-list-content .list-group-item img[data-src]');
that.info.hide(); //hide acl-info
that.update_select('custom');
+ if(typeof value === 'undefined') {
+ value = 'custom';
+ }
/* jot acl */
if(that.allow_gid.length === 0 && that.allow_cid.length === 0 && that.deny_gid.length === 0 && that.deny_cid.length === 0 && value === 'custom') {
@@ -334,7 +338,7 @@ ACL.prototype.update_view = function(value) {
$("#acl-list-content .acl-list-item").each(function() {
itemid = $(this).attr('id');
type = itemid[0];
- id = itemid.substr(1);
+ id = decodeURIComponent(itemid.substr(1));
btshow = $(this).children(".acl-button-show").removeClass("btn-success").addClass("btn-outline-success");
bthide = $(this).children(".acl-button-hide").removeClass("btn-danger").addClass("btn-outline-danger");
diff --git a/view/tpl/channel.tpl b/view/tpl/channel.tpl
index b4bef83f3..70317e178 100755
--- a/view/tpl/channel.tpl
+++ b/view/tpl/channel.tpl
@@ -49,7 +49,7 @@
{{/if}}
{{if $channel.include_in_menu}}
-
{{else}}