aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Zotlabs/Lib/Activity.php21
-rw-r--r--Zotlabs/Lib/ActivityStreams.php31
-rw-r--r--Zotlabs/Web/HTTPSig.php4
-rw-r--r--view/tpl/navbar_default.tpl2
4 files changed, 44 insertions, 14 deletions
diff --git a/Zotlabs/Lib/Activity.php b/Zotlabs/Lib/Activity.php
index dbf7f7b46..23ba89462 100644
--- a/Zotlabs/Lib/Activity.php
+++ b/Zotlabs/Lib/Activity.php
@@ -50,6 +50,25 @@ class Activity {
}
+ public static function fetch_local($url, $portable_id) {
+ $sql_extra = item_permissions_sql(0, $portable_id);
+ $item_normal = item_normal();
+
+ // Find the original object
+ $j = q(
+ "select *, id as item_id from item where mid = '%s' and item_wall = 1 $item_normal $sql_extra",
+ dbesc($url)
+ );
+ if ($j) {
+ xchan_query($j, true);
+ $items = fetch_post_tags($j);
+ }
+ if ($items) {
+ return self::encode_item(array_shift($items), true);
+ }
+ return false;
+ }
+
static function fetch($url, $channel = null) {
$redirects = 0;
if (!check_siteallowed($url)) {
@@ -2962,7 +2981,6 @@ class Activity {
}*/
}
else {
-
$allowed = true;
// reject public stream comments that weren't sent by the conversation owner
@@ -3180,7 +3198,6 @@ class Activity {
// TODO: not implemented
// self::rewrite_mentions($item);
-
$r = q("select id, created, edited from item where mid = '%s' and uid = %d limit 1",
dbesc($item['mid']),
intval($item['uid'])
diff --git a/Zotlabs/Lib/ActivityStreams.php b/Zotlabs/Lib/ActivityStreams.php
index f07f99ac3..1f10ac027 100644
--- a/Zotlabs/Lib/ActivityStreams.php
+++ b/Zotlabs/Lib/ActivityStreams.php
@@ -14,6 +14,7 @@ class ActivityStreams {
public $meta = null;
public $valid = false;
public $deleted = false;
+ public $portable_id = null;
public $id = '';
public $parent_id = '';
public $type = '';
@@ -35,12 +36,13 @@ class ActivityStreams {
*
* @param string $string
*/
- function __construct($string) {
+ function __construct($string, $portable_id = null) {
if(!$string)
return;
$this->raw = $string;
+ $this->portable_id = $portable_id;
if (is_array($string)) {
$this->data = $string;
@@ -123,13 +125,14 @@ class ActivityStreams {
$this->parent_id = $this->get_property_obj('inReplyTo');
- if ((!$this->parent_id) && is_array($this->obj) && isset($this->obj['inReplyTo'])) {
+ if (!$this->parent_id && is_array($this->obj) && isset($this->obj['inReplyTo'])) {
$this->parent_id = $this->obj['inReplyTo'];
}
- if ((!$this->parent_id) && is_array($this->obj) && isset($this->obj['id'])) {
+ if (!$this->parent_id && is_array($this->obj) && isset($this->obj['id'])) {
$this->parent_id = $this->obj['id'];
}
+
}
}
@@ -302,12 +305,22 @@ class ActivityStreams {
* @return NULL|mixed
*/
- function fetch_property($url) {
- return self::fetch($url);
- }
-
- static function fetch($url, $channel = null) {
- return Activity::fetch($url, $channel);
+ function fetch_property($url, $channel = null) {
+ if (str_starts_with($url, z_root() . '/item/')) {
+ $x = Activity::fetch_local($url, $this->portable_id ?? '');
+ logger('local: ' . print_r($x,true));
+ }
+ if (!$x) {
+ $x = Activity::fetch($url, $channel);
+ if ($x === null && strpos($url, '/channel/')) {
+ // look for other nomadic channels which might be alive
+ $zf = Zotfinger::exec($url, $channel);
+
+ $url = $zf['signature']['signer'];
+ $x = Activity::fetch($url, $channel);
+ }
+ }
+ return $x;
}
static function is_an_actor($s) {
diff --git a/Zotlabs/Web/HTTPSig.php b/Zotlabs/Web/HTTPSig.php
index 2f04003ab..531b18649 100644
--- a/Zotlabs/Web/HTTPSig.php
+++ b/Zotlabs/Web/HTTPSig.php
@@ -4,7 +4,7 @@ namespace Zotlabs\Web;
use DateTime;
use DateTimeZone;
-use Zotlabs\Lib\ActivityStreams;
+use Zotlabs\Lib\Activity;
use Zotlabs\Lib\Crypto;
use Zotlabs\Lib\Keyutils;
use Zotlabs\Lib\Webfinger;
@@ -324,7 +324,7 @@ class HTTPSig {
}
// The record wasn't in cache. Fetch it now.
- $r = ActivityStreams::fetch($id);
+ $r = Activity::fetch($id);
$signatureAlgorithm = EMPTY_STR;
if ($r) {
diff --git a/view/tpl/navbar_default.tpl b/view/tpl/navbar_default.tpl
index c0bcd02c2..ea8723e8b 100644
--- a/view/tpl/navbar_default.tpl
+++ b/view/tpl/navbar_default.tpl
@@ -187,7 +187,7 @@
{{if $name}}
<img src="{{$thumb}}" class="menu-img-3">
<div class="p-1">
- <div class="fn text-truncate">{{$name}}</div>
+ <div class="fw-bold text-truncate">{{$name}}</div>
<div class="text-muted text-truncate">{{$sitelocation}}</div>
</div>
{{/if}}