mirror of
https://codeberg.org/streams/streams.git
synced 2024-09-20 00:55:19 +00:00
Merge branch 'dev' of /home/macgirvin/z into dev
This commit is contained in:
commit
96c5b7b93e
3 changed files with 28 additions and 8 deletions
|
@ -131,6 +131,7 @@ class Onepoll {
|
|||
$url = ((array_key_exists('outbox',$cl)) ? $cl['outbox'] : '');
|
||||
if ($url) {
|
||||
logger('fetching outbox');
|
||||
$url = $url . '?date_begin=' . urlencode($last_update);
|
||||
$obj = new ASCollection($url, $importer, 0, $max);
|
||||
$messages = $obj->get();
|
||||
if ($messages) {
|
||||
|
|
|
@ -240,16 +240,28 @@ class Activity {
|
|||
$numpages = $total / App::$pager['itemspage'];
|
||||
$lastpage = (($numpages > intval($numpages)) ? intval($numpages) + 1 : $numpages);
|
||||
|
||||
$stripped = preg_replace('/([&|\?]page=[0-9]*)/','',$id);
|
||||
$stripped = rtrim($stripped,'/');
|
||||
$url_parts = parse_url($id);
|
||||
|
||||
$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) {
|
||||
$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) {
|
||||
$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 {
|
||||
|
|
|
@ -2192,14 +2192,16 @@ class Libzot {
|
|||
|
||||
// logger($AS->debug());
|
||||
|
||||
$r = q("select hubloc_hash from hubloc where hubloc_id_url = '%s' limit 1",
|
||||
dbesc($AS->actor['id'])
|
||||
$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'])
|
||||
);
|
||||
|
||||
if (! $r) {
|
||||
$y = import_author_xchan([ 'url' => $AS->actor['id'] ]);
|
||||
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'])
|
||||
);
|
||||
}
|
||||
|
@ -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'];
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue