From e1b05706906879dbfdc39ec3b22cbdda6a7610ec Mon Sep 17 00:00:00 2001 From: zotlabs Date: Sun, 9 Sep 2018 18:28:13 -0700 Subject: [PATCH] assorted fixes --- Zotlabs/Lib/ActivityStreams.php | 24 ++++++++++++++++++------ Zotlabs/Lib/Enotify.php | 2 +- include/text.php | 2 +- 3 files changed, 20 insertions(+), 8 deletions(-) diff --git a/Zotlabs/Lib/ActivityStreams.php b/Zotlabs/Lib/ActivityStreams.php index 93f79df55..e7df125b6 100644 --- a/Zotlabs/Lib/ActivityStreams.php +++ b/Zotlabs/Lib/ActivityStreams.php @@ -100,8 +100,10 @@ class ActivityStreams { $this->tgt['actor'] = $this->get_actor('actor',$this->tgt); $this->parent_id = $this->get_property_obj('inReplyTo'); - - if(! $this->parent_id) { + if(! $this->parent_id) { + $this->parent_id = $this->obj['inReplyTo']; + } + if(! $this->parent_id) { $this->parent_id = $this->obj['id']; } } @@ -243,20 +245,30 @@ class ActivityStreams { */ function fetch_property($url) { + return self::fetch($url); + } + + static function fetch($url) { $redirects = 0; if(! check_siteallowed($url)) { logger('blacklisted: ' . $url); return null; } - + logger('fetch: ' . $url, LOGGER_DEBUG); $x = z_fetch_url($url, true, $redirects, - ['headers' => [ 'Accept: application/activity+json, application/ld+json; profile="https://www.w3.org/ns/activitystreams"' ]]); - if($x['success']) + [ 'headers' => [ 'Accept: application/activity+json, application/ld+json; profile="https://www.w3.org/ns/activitystreams"' ]]); + if($x['success']) { + $y = json_decode($x['body'],true); + logger('returned: ' . json_encode($y,JSON_PRETTY_PRINT|JSON_UNESCAPED_SLASHES)); return json_decode($x['body'], true); - + } + else { + logger('fetch failed: ' . $url); + } return null; } + /** * @brief * diff --git a/Zotlabs/Lib/Enotify.php b/Zotlabs/Lib/Enotify.php index 34459b547..cd5002167 100644 --- a/Zotlabs/Lib/Enotify.php +++ b/Zotlabs/Lib/Enotify.php @@ -806,7 +806,7 @@ class Enotify { else { $itemem_text = (($item['item_thread_top']) ? t('created a new post') - : sprintf( t('commented on %s\'s post'), $item['owner']['xchan_name'])); + : sprintf( t('reacted to %s\'s conversation'), $item['owner']['xchan_name'])); if($item['verb'] === 'Announce') { $itemem_text = sprintf( t('post shared by %s'), $item['owner']['xchan_name']); } diff --git a/include/text.php b/include/text.php index ad5408778..64ba7b3bc 100644 --- a/include/text.php +++ b/include/text.php @@ -1343,7 +1343,7 @@ function preg_heart($x) { $t = ''; for($cnt = 0; $cnt < strlen($x[1]); $cnt ++) - $t .= '<3'; + $t .= '<​3'; $r = str_replace($x[0],$t,$x[0]);