mirror of
https://codeberg.org/streams/streams.git
synced 2024-09-22 01:35:26 +00:00
Merge branch 'dev' of /home/macgirvin/roadhouse into dev
This commit is contained in:
commit
2a905dace1
3 changed files with 28 additions and 8 deletions
|
@ -131,6 +131,7 @@ class Onepoll {
|
||||||
$url = ((array_key_exists('outbox',$cl)) ? $cl['outbox'] : '');
|
$url = ((array_key_exists('outbox',$cl)) ? $cl['outbox'] : '');
|
||||||
if ($url) {
|
if ($url) {
|
||||||
logger('fetching outbox');
|
logger('fetching outbox');
|
||||||
|
$url = $url . '?date_begin=' . urlencode($last_update);
|
||||||
$obj = new ASCollection($url, $importer, 0, $max);
|
$obj = new ASCollection($url, $importer, 0, $max);
|
||||||
$messages = $obj->get();
|
$messages = $obj->get();
|
||||||
if ($messages) {
|
if ($messages) {
|
||||||
|
|
|
@ -240,16 +240,28 @@ class Activity {
|
||||||
$numpages = $total / App::$pager['itemspage'];
|
$numpages = $total / App::$pager['itemspage'];
|
||||||
$lastpage = (($numpages > intval($numpages)) ? intval($numpages) + 1 : $numpages);
|
$lastpage = (($numpages > intval($numpages)) ? intval($numpages) + 1 : $numpages);
|
||||||
|
|
||||||
$stripped = preg_replace('/([&|\?]page=[0-9]*)/','',$id);
|
$url_parts = parse_url($id);
|
||||||
$stripped = rtrim($stripped,'/');
|
|
||||||
|
|
||||||
$ret['partOf'] = z_root() . '/' . $stripped;
|
$ret['partOf'] = z_root() . '/' . $url_parts['path'];
|
||||||
|
|
||||||
|
$extra_query_args = '';
|
||||||
|
$query_args = null;
|
||||||
|
if (isset($url_parts['query'])) {
|
||||||
|
parse_str($url_parts['query'], $query_args);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (is_array($query_args)) {
|
||||||
|
unset($query_args['page']);
|
||||||
|
foreach ($query_args as $k => $v) {
|
||||||
|
$extra_query_args .= '&' . urlencode($k) . '=' . urlencode($v);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (App::$pager['page'] < $lastpage) {
|
if (App::$pager['page'] < $lastpage) {
|
||||||
$ret['next'] = z_root() . '/' . $stripped . '?page=' . (intval(App::$pager['page']) + 1);
|
$ret['next'] = z_root() . '/' . $url_parts['path'] . '?page=' . (intval(App::$pager['page']) + 1) . $extra_query_args;
|
||||||
}
|
}
|
||||||
if (App::$pager['page'] > 1) {
|
if (App::$pager['page'] > 1) {
|
||||||
$ret['prev'] = z_root() . '/' . $stripped . '?page=' . (intval(App::$pager['page']) - 1);
|
$ret['prev'] = z_root() . '/' . $url_parts['path'] . '?page=' . (intval(App::$pager['page']) - 1) . $extra_query_args;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
|
@ -2192,14 +2192,16 @@ class Libzot {
|
||||||
|
|
||||||
// logger($AS->debug());
|
// logger($AS->debug());
|
||||||
|
|
||||||
$r = q("select hubloc_hash from hubloc where hubloc_id_url = '%s' limit 1",
|
$r = q("select hubloc_hash from hubloc where hubloc_id_url = '%s' or hubloc_hash = '%s' limit 1",
|
||||||
|
dbesc($AS->actor['id']),
|
||||||
dbesc($AS->actor['id'])
|
dbesc($AS->actor['id'])
|
||||||
);
|
);
|
||||||
|
|
||||||
if (! $r) {
|
if (! $r) {
|
||||||
$y = import_author_xchan([ 'url' => $AS->actor['id'] ]);
|
$y = import_author_xchan([ 'url' => $AS->actor['id'] ]);
|
||||||
if ($y) {
|
if ($y) {
|
||||||
$r = q("select hubloc_hash from hubloc where hubloc_id_url = '%s' limit 1",
|
$r = q("select hubloc_hash from hubloc where hubloc_id_url = '%s' or hubloc_hash = '%s' limit 1",
|
||||||
|
dbesc($AS->actor['id']),
|
||||||
dbesc($AS->actor['id'])
|
dbesc($AS->actor['id'])
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -3354,6 +3356,11 @@ class Libzot {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// this site obviously isn't dead because they are trying to communicate with us.
|
||||||
|
q("update site set site_dead = 0 where site_dead = 1 and site_url = '%s' ",
|
||||||
|
dbesc($hub['hubloc_url'])
|
||||||
|
);
|
||||||
|
|
||||||
return $hub['hubloc_url'];
|
return $hub['hubloc_url'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue