mirror of
https://codeberg.org/streams/streams.git
synced 2024-09-22 04:35:24 +00:00
Merge branch 'dev' of /home/macgirvin/z into dev
This commit is contained in:
commit
7d928f655c
7 changed files with 159 additions and 32 deletions
|
@ -556,8 +556,8 @@ class Notifier {
|
|||
}
|
||||
}
|
||||
if (! $found_localhost) {
|
||||
$localhub = q("select hubloc.*, site.site_crypto, site.site_flags from hubloc left join site on site_url = hubloc_url
|
||||
where hubloc_id_url = '%s' and hubloc_error = 0 and hubloc_deleted = 0 and ( site_dead = 0 OR site_dead is null ) ",
|
||||
$localhub = q("select hubloc.*, site.site_crypto, site.site_flags, site.site_dead from hubloc
|
||||
left join site on site_url = hubloc_url where hubloc_id_url = '%s' and hubloc_error = 0 and hubloc_deleted = 0 ",
|
||||
dbesc(z_root() . '/channel/sys')
|
||||
);
|
||||
if ($localhub) {
|
||||
|
@ -583,8 +583,13 @@ class Notifier {
|
|||
$keys = []; // array of keys to check uniquness for zot hubs
|
||||
$urls = []; // array of urls to check uniqueness of hubs from other networks
|
||||
$hub_env = []; // per-hub envelope so we don't broadcast the entire envelope to all
|
||||
$dead = []; // known dead hubs - report them as undeliverable
|
||||
|
||||
foreach ($hubs as $hub) {
|
||||
if (intval($hub['site_dead'])) {
|
||||
$dead[] = $hub;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (self::$env_recips) {
|
||||
foreach (self::$env_recips as $er) {
|
||||
|
@ -720,9 +725,31 @@ class Notifier {
|
|||
do_delivery(self::$deliveries);
|
||||
}
|
||||
|
||||
if ($dead) {
|
||||
foreach ($dead as $deceased) {
|
||||
if (is_array($target_item) && (! $target_item['item_deleted']) && (! get_config('system','disable_dreport'))) {
|
||||
q("insert into dreport ( dreport_mid, dreport_site, dreport_recip, dreport_name, dreport_result, dreport_time, dreport_xchan, dreport_queue )
|
||||
values ( '%s', '%s','%s','%s','%s','%s','%s','%s' ) ",
|
||||
dbesc($target_item['mid']),
|
||||
dbesc($deceased['hubloc_host']),
|
||||
dbesc($deceased['hubloc_host']),
|
||||
dbesc($deceased['hubloc_host']),
|
||||
dbesc('undeliverable/unresponsive site'),
|
||||
dbesc(datetime_convert()),
|
||||
dbesc(self::$channel['channel_hash']),
|
||||
dbesc(new_uuid())
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
call_hooks('notifier_end',$target_item);
|
||||
|
||||
logger('notifer: complete.');
|
||||
|
||||
|
||||
|
||||
|
||||
return;
|
||||
|
||||
}
|
||||
|
|
|
@ -221,6 +221,41 @@ class AccessList {
|
|||
$pager_sql = sprintf(" LIMIT %d OFFSET %d ", intval($records), intval($start));
|
||||
}
|
||||
|
||||
// process virtual groups
|
||||
if (strpos($gid,':') === 0) {
|
||||
$vg = substr($gid,1);
|
||||
switch ($vg) {
|
||||
case '1':
|
||||
$sql_extra = EMPTY_STR;
|
||||
break;
|
||||
case '2':
|
||||
$sql_extra = " and xchan_network = 'zot6' ";
|
||||
break;
|
||||
case '3':
|
||||
$sql_extra = " and xchan_network = 'activitypub' ";
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
if ($total) {
|
||||
$r = q("SELECT count(*) FROM abook left join xchan on xchan_hash = abook_xchan WHERE abook_channel = %d and xchan_deleted = 0 and abook_self = 0 and abook_blocked = 0 and abook_pending = 0 $sql_extra ORDER BY xchan_name ASC $pager_sql",
|
||||
intval($uid)
|
||||
);
|
||||
return ($r) ? $r[0]['total'] : false;
|
||||
}
|
||||
|
||||
$r = q("SELECT * FROM abook left join xchan on xchan_hash = abook_xchan
|
||||
WHERE abook_channel = %d and xchan_deleted = 0 and abook_self = 0 and abook_blocked = 0 and abook_pending = 0 $sql_extra ORDER BY xchan_name ASC $pager_sql",
|
||||
intval($uid)
|
||||
);
|
||||
if ($r) {
|
||||
for($x = 0; $x < count($r); $x ++) {
|
||||
$r[$x]['xchan'] = $r[$x]['abook_xchan'];
|
||||
}
|
||||
}
|
||||
return $r;
|
||||
}
|
||||
|
||||
if (intval($gid)) {
|
||||
if ($total) {
|
||||
$r = q("SELECT count(xchan) as total FROM pgrp_member
|
||||
|
|
|
@ -139,6 +139,12 @@ class Inbox extends Controller {
|
|||
dbesc(datetime_convert()),
|
||||
dbesc($observer_hash)
|
||||
);
|
||||
$m = parse_url($observer_hash);
|
||||
if ($m['scheme'] && $m['host']) {
|
||||
$test = q("update site set site_dead = 0 where site_dead = 1 and site_url = '%s' ",
|
||||
dbesc($m['scheme'] . '://' . $m['host'])
|
||||
);
|
||||
}
|
||||
|
||||
if ($is_public) {
|
||||
|
||||
|
|
|
@ -67,7 +67,7 @@ class Stream extends Controller {
|
|||
$datequery = ((x($_GET,'dend') && is_a_date_arg($_GET['dend'])) ? notags($_GET['dend']) : '');
|
||||
$datequery2 = ((x($_GET,'dbegin') && is_a_date_arg($_GET['dbegin'])) ? notags($_GET['dbegin']) : '');
|
||||
$static = ((x($_GET,'static')) ? intval($_GET['static']) : 0);
|
||||
$gid = ((x($_GET,'gid')) ? intval($_GET['gid']) : 0);
|
||||
$gid = ((x($_GET,'gid')) ? $_REQUEST['gid'] : 0);
|
||||
$category = ((x($_REQUEST,'cat')) ? $_REQUEST['cat'] : '');
|
||||
$hashtags = ((x($_REQUEST,'tag')) ? $_REQUEST['tag'] : '');
|
||||
$verb = ((x($_REQUEST,'verb')) ? $_REQUEST['verb'] : '');
|
||||
|
@ -110,18 +110,41 @@ class Stream extends Controller {
|
|||
}
|
||||
|
||||
// filter by collection (e.g. group)
|
||||
|
||||
|
||||
$vg = false;
|
||||
|
||||
if ($gid) {
|
||||
$r = q("SELECT * FROM pgrp WHERE id = %d AND uid = %d LIMIT 1",
|
||||
intval($gid),
|
||||
intval(local_channel())
|
||||
);
|
||||
if (! $r) {
|
||||
if ($update) {
|
||||
killme();
|
||||
if (strpos($gid,':') === 0) {
|
||||
$g = substr($gid,1);
|
||||
switch ($g) {
|
||||
case '1':
|
||||
$r = [ 'hash' => 'connections:' . $channel['channel_hash'] ];
|
||||
$vg = t('Connections');
|
||||
break;
|
||||
case '2':
|
||||
$r = [ 'hash' => 'zot:' . $channel['channel_hash'] ];
|
||||
$vg = t('Zot');
|
||||
break;
|
||||
case '3':
|
||||
$r = [ 'hash' => 'activitypub:' . $channel['channel_hash'] ];
|
||||
$vg = t('ActivityPub');
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
else {
|
||||
$r = q("SELECT * FROM pgrp WHERE id = %d AND uid = %d LIMIT 1",
|
||||
intval($gid),
|
||||
intval(local_channel())
|
||||
);
|
||||
if (! $r) {
|
||||
if ($update) {
|
||||
killme();
|
||||
}
|
||||
notice( t('Access list not found') . EOL );
|
||||
goaway(z_root() . '/stream');
|
||||
}
|
||||
notice( t('Access list not found') . EOL );
|
||||
goaway(z_root() . '/stream');
|
||||
}
|
||||
|
||||
$group = $gid;
|
||||
|
@ -257,12 +280,15 @@ class Stream extends Controller {
|
|||
$item_thread_top = '';
|
||||
|
||||
$sql_extra = " AND item.parent IN ( SELECT DISTINCT parent FROM item WHERE true $sql_options AND (( author_xchan IN ( $contact_str ) OR owner_xchan in ( $contact_str )) or allow_gid like '" . protect_sprintf('%<' . dbesc($group_hash) . '>%') . "' ) and id = parent $item_normal ) ";
|
||||
|
||||
|
||||
if (! $vg) {
|
||||
$x = AccessList::rec_byhash(local_channel(), $group_hash);
|
||||
}
|
||||
|
||||
$x = AccessList::rec_byhash(local_channel(), $group_hash);
|
||||
|
||||
if ($x) {
|
||||
if ($x || $vg) {
|
||||
$title = replace_macros(get_markup_template("section_title.tpl"),array(
|
||||
'$title' => sprintf( t('Access list: %s'), $x['gname'])
|
||||
'$title' => sprintf( t('Access list: %s'), (($vg) ? $vg : $x['gname']))
|
||||
));
|
||||
}
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
namespace Zotlabs\Widget;
|
||||
|
||||
use App;
|
||||
|
||||
use Zotlabs\Lib\Apps;
|
||||
|
||||
class Activity_filter {
|
||||
|
||||
|
@ -85,19 +85,51 @@ class Activity_filter {
|
|||
intval(local_channel())
|
||||
);
|
||||
|
||||
if($groups) {
|
||||
foreach($groups as $g) {
|
||||
if(x($_GET,'gid')) {
|
||||
$group_active = (($_GET['gid'] == $g['id']) ? 'active' : '');
|
||||
$filter_active = 'group';
|
||||
if($groups || Apps::system_app_installed(local_channel(),'Virtual Lists')) {
|
||||
if ($groups) {
|
||||
foreach($groups as $g) {
|
||||
if(x($_GET,'gid')) {
|
||||
$group_active = (($_GET['gid'] == $g['id']) ? 'active' : '');
|
||||
$filter_active = 'group';
|
||||
}
|
||||
$gsub[] = [
|
||||
'label' => $g['gname'],
|
||||
'icon' => '',
|
||||
'url' => z_root() . '/' . $cmd . '/?f=&gid=' . $g['id'],
|
||||
'sel' => $group_active,
|
||||
'title' => sprintf(t('Show posts related to the %s access list'), $g['gname'])
|
||||
];
|
||||
}
|
||||
}
|
||||
if (Apps::system_app_installed(local_channel(),'Virtual Lists')) {
|
||||
foreach ([ ':1', ':2', ':3' ] as $l) {
|
||||
switch ($l) {
|
||||
case ':1':
|
||||
$gname = t('Connections');
|
||||
break;
|
||||
case ':2':
|
||||
$gname = t('Zot');
|
||||
break;
|
||||
case ':3':
|
||||
$gname = t('ActivityPub');
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
if(x($_GET,'gid')) {
|
||||
$group_active = (($_GET['gid'] == $l) ? 'active' : '');
|
||||
$filter_active = 'group';
|
||||
}
|
||||
|
||||
$gsub[] = [
|
||||
'label' => $gname,
|
||||
'icon' => '',
|
||||
'url' => z_root() . '/' . $cmd . '/?f=&gid=' . $l,
|
||||
'sel' => $group_active,
|
||||
'title' => sprintf(t('Show posts related to the %s access list'), $gname)
|
||||
];
|
||||
}
|
||||
$gsub[] = [
|
||||
'label' => $g['gname'],
|
||||
'icon' => '',
|
||||
'url' => z_root() . '/' . $cmd . '/?f=&gid=' . $g['id'],
|
||||
'sel' => $group_active,
|
||||
'title' => sprintf(t('Show posts related to the %s access list'), $g['gname'])
|
||||
];
|
||||
}
|
||||
$tabs[] = [
|
||||
'id' => 'privacy_groups',
|
||||
|
|
2
boot.php
2
boot.php
|
@ -16,7 +16,7 @@ use Zotlabs\Daemon\Run;
|
|||
* @brief This file defines some global constants and includes the central App class.
|
||||
*/
|
||||
|
||||
define ( 'STD_VERSION', '20.10.06' );
|
||||
define ( 'STD_VERSION', '20.10.14' );
|
||||
define ( 'ZOT_REVISION', '6.0' );
|
||||
|
||||
define ( 'DB_UPDATE_VERSION', 1243 );
|
||||
|
|
|
@ -4,7 +4,8 @@
|
|||
|
||||
|
||||
var bParam_uid = {{$uid}};
|
||||
var bParam_gid = {{$gid}};
|
||||
// lists can be either type string (virtual lists) or integer (normal accesslists)
|
||||
var bParam_gid = "{{$gid}}";
|
||||
var bParam_cid = {{$cid}};
|
||||
var bParam_cmin = {{$cmin}};
|
||||
var bParam_cmax = {{$cmax}};
|
||||
|
|
Loading…
Reference in a new issue