aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs
diff options
context:
space:
mode:
authorMario <mario@mariovavti.com>2022-02-13 16:53:43 +0000
committerMario <mario@mariovavti.com>2022-02-13 16:53:43 +0000
commit4b06bc552f04fc78545a450343cc59e236791a66 (patch)
treee6cd93b353647ed17c59516133614b8ef1923fe5 /Zotlabs
parentd45e8e4d20645d860aee033ec6dab4c7c433d609 (diff)
downloadvolse-hubzilla-4b06bc552f04fc78545a450343cc59e236791a66.tar.gz
volse-hubzilla-4b06bc552f04fc78545a450343cc59e236791a66.tar.bz2
volse-hubzilla-4b06bc552f04fc78545a450343cc59e236791a66.zip
add inbound support for quoteUrl
Diffstat (limited to 'Zotlabs')
-rw-r--r--Zotlabs/Lib/Activity.php38
1 files changed, 38 insertions, 0 deletions
diff --git a/Zotlabs/Lib/Activity.php b/Zotlabs/Lib/Activity.php
index 464306c24..fe5ee0ec7 100644
--- a/Zotlabs/Lib/Activity.php
+++ b/Zotlabs/Lib/Activity.php
@@ -2335,6 +2335,16 @@ class Activity {
$s['summary'] = self::bb_content($content, 'summary');
$s['body'] = ((self::bb_content($content, 'bbcode') && (!$response_activity)) ? self::bb_content($content, 'bbcode') : self::bb_content($content, 'content'));
+ if (isset($act->obj['quoteUrl'])) {
+ $quote_bbcode = self::get_quote_bbcode($act->obj['quoteUrl']);
+
+ if ($s['body']) {
+ $s['body'] .= "\r\n\r\n";
+ }
+
+ $s['body'] .= $quote_bbcode;
+ }
+
$s['verb'] = self::activity_decode_mapper($act->type);
// Mastodon does not provide update timestamps when updating poll tallies which means race conditions may occur here.
@@ -3797,4 +3807,32 @@ class Activity {
return $ret;
}
+
+ static function get_quote_bbcode($url) {
+
+ $ret = '';
+
+ $a = self::fetch($url);
+ if ($a) {
+ $act = new ActivityStreams($a);
+
+ if ($act->is_valid()) {
+ $content = self::get_content($act->obj);
+
+ $ret .= "[share author='" . urlencode($act->actor['name']) .
+ "' profile='" . $act->actor['id'] .
+ "' avatar='" . $act->actor['icon']['url'] .
+ "' link='" . $act->obj['id'] .
+ "' auth='" . ((is_matrix_url($act->actor['id'])) ? 'true' : 'false') .
+ "' posted='" . $act->obj['published'] .
+ "' message_id='" . $act->obj['id'] .
+ "']";
+ $ret .= self::bb_content($content, 'content');
+ $ret .= '[/share]';
+ }
+ }
+
+ return $ret;
+ }
+
}