aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs/Lib
diff options
context:
space:
mode:
Diffstat (limited to 'Zotlabs/Lib')
-rw-r--r--Zotlabs/Lib/Activity.php12
-rw-r--r--Zotlabs/Lib/Enotify.php17
-rw-r--r--Zotlabs/Lib/LDSignatures.php6
3 files changed, 21 insertions, 14 deletions
diff --git a/Zotlabs/Lib/Activity.php b/Zotlabs/Lib/Activity.php
index 8168e7354..0808228a6 100644
--- a/Zotlabs/Lib/Activity.php
+++ b/Zotlabs/Lib/Activity.php
@@ -361,7 +361,7 @@ class Activity {
switch($t['type']) {
case 'Hashtag':
- $ret[] = [ 'ttype' => TERM_HASHTAG, 'url' => $t['href'], 'term' => escape_tags((substr($t['name'],0,1) === '#') ? substr($t['name'],1) : $t['name']) ];
+ $ret[] = [ 'ttype' => TERM_HASHTAG, 'url' => ((isset($t['href'])) ? $t['href'] : $t['id']), 'term' => escape_tags((substr($t['name'],0,1) === '#') ? substr($t['name'],1) : $t['name']) ];
break;
case 'Mention':
@@ -392,9 +392,9 @@ class Activity {
foreach($item['term'] as $t) {
switch($t['ttype']) {
case TERM_HASHTAG:
- // An id is required so if we don't have a url in the taxonomy, ignore it and keep going.
+ // href is required so if we don't have a url in the taxonomy, ignore it and keep going.
if($t['url']) {
- $ret[] = [ 'id' => $t['url'], 'name' => '#' . $t['term'] ];
+ $ret[] = [ 'type' => 'Hashtag', 'href' => $t['url'], 'name' => '#' . $t['term'] ];
}
break;
@@ -1769,14 +1769,14 @@ class Activity {
}
foreach($ptr as $vurl) {
if(strpos($s['body'],$vurl['href']) === false) {
- $s['body'] .= "\n\n" . '[zmg]' . $vurl['href'] . '[/zmg]';
+ $s['body'] .= '[zmg]' . $vurl['href'] . '[/zmg]' . "\n\n" . $s['body'];
break;
}
}
}
elseif(is_string($act->obj['url'])) {
if(strpos($s['body'],$act->obj['url']) === false) {
- $s['body'] .= "\n\n" . '[zmg]' . $act->obj['url'] . '[/zmg]';
+ $s['body'] .= '[zmg]' . $act->obj['url'] . '[/zmg]' . "\n\n" . $s['body'];
}
}
}
@@ -2025,7 +2025,7 @@ class Activity {
}
$a = new ActivityStreams($n);
- logger($a->debug());
+ //logger($a->debug());
if(! $a->is_valid()) {
break;
diff --git a/Zotlabs/Lib/Enotify.php b/Zotlabs/Lib/Enotify.php
index a7082f45a..92a488f67 100644
--- a/Zotlabs/Lib/Enotify.php
+++ b/Zotlabs/Lib/Enotify.php
@@ -807,6 +807,11 @@ class Enotify {
$itemem_text = (($item['item_thread_top'])
? t('created a new post')
: sprintf( t('commented on %s\'s post'), $item['owner']['xchan_name']));
+
+ if($item['verb'] === ACTIVITY_SHARE) {
+ $itemem_text = sprintf( t('repeated %s\'s post'), $item['author']['xchan_name']);
+ }
+
}
$edit = false;
@@ -825,12 +830,14 @@ class Enotify {
// convert this logic into a json array just like the system notifications
+ $who = (($item['verb'] === ACTIVITY_SHARE) ? 'owner' : 'author');
+
$x = array(
'notify_link' => $item['llink'],
- 'name' => $item['author']['xchan_name'],
- 'addr' => (($item['author']['xchan_addr']) ? $item['author']['xchan_addr'] : $item['author']['xchan_url']),
- 'url' => $item['author']['xchan_url'],
- 'photo' => $item['author']['xchan_photo_s'],
+ 'name' => $item[$who]['xchan_name'],
+ 'addr' => (($item[$who]['xchan_addr']) ? $item[$who]['xchan_addr'] : $item[$who]['xchan_url']),
+ 'url' => $item[$who]['xchan_url'],
+ 'photo' => $item[$who]['xchan_photo_s'],
'when' => relative_date(($edit)? $item['edited'] : $item['created']),
'class' => (intval($item['item_unseen']) ? 'notify-unseen' : 'notify-seen'),
'b64mid' => ((in_array($item['verb'], [ACTIVITY_LIKE, ACTIVITY_DISLIKE])) ? 'b64.' . base64url_encode($item['thr_parent']) : 'b64.' . base64url_encode($item['mid'])),
@@ -838,7 +845,7 @@ class Enotify {
'thread_top' => (($item['item_thread_top']) ? true : false),
'message' => strip_tags(bbcode($itemem_text)),
// these are for the superblock addon
- 'hash' => $item['author']['xchan_hash'],
+ 'hash' => $item[$who]['xchan_hash'],
'uid' => local_channel(),
'display' => true
);
diff --git a/Zotlabs/Lib/LDSignatures.php b/Zotlabs/Lib/LDSignatures.php
index 6d7127cde..b13c4cf4a 100644
--- a/Zotlabs/Lib/LDSignatures.php
+++ b/Zotlabs/Lib/LDSignatures.php
@@ -29,7 +29,7 @@ class LDSignatures {
$options = [
'type' => 'RsaSignature2017',
'nonce' => random_string(64),
- 'creator' => z_root() . '/channel/' . $channel['channel_address'] . '/public_key_pem',
+ 'creator' => z_root() . '/channel/' . $channel['channel_address'],
'created' => datetime_convert('UTC','UTC', 'now', 'Y-m-d\Th:i:s\Z')
];
@@ -124,7 +124,7 @@ class LDSignatures {
'meDataType' => $data_type,
'meEncoding' => $encoding,
'meAlgorithm' => $algorithm,
- 'meCreator' => z_root() . '/channel/' . $channel['channel_address'] . '/public_key_pem',
+ 'meCreator' => z_root() . '/channel/' . $channel['channel_address'],
'meSignatureValue' => $signature
]);
@@ -132,4 +132,4 @@ class LDSignatures {
-} \ No newline at end of file
+}