aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs
diff options
context:
space:
mode:
authorMario <mario@mariovavti.com>2020-02-11 07:55:34 +0100
committerMario <mario@mariovavti.com>2020-02-11 07:55:34 +0100
commit95476cf33cf7c7971e018f9136d1c64dfc901d17 (patch)
treeb689e76e7eae9c7e339916048b7c5623b96a4b7d /Zotlabs
parenta39d436f9f46138db623ee3c9ddef2c501ea8bd2 (diff)
parentbf7c96807a50433b7241ddf6df9e01d4ef11f43d (diff)
downloadvolse-hubzilla-95476cf33cf7c7971e018f9136d1c64dfc901d17.tar.gz
volse-hubzilla-95476cf33cf7c7971e018f9136d1c64dfc901d17.tar.bz2
volse-hubzilla-95476cf33cf7c7971e018f9136d1c64dfc901d17.zip
Merge branch 'dev' into 'dev'
this allows polls to federate from hubzilla to zap, though still a remaining issue with voting See merge request hubzilla/core!1830
Diffstat (limited to 'Zotlabs')
-rw-r--r--Zotlabs/Daemon/Notifier.php12
-rw-r--r--Zotlabs/Lib/Activity.php11
-rw-r--r--Zotlabs/Lib/Libzot.php1
-rw-r--r--Zotlabs/Module/Item.php6
4 files changed, 26 insertions, 4 deletions
diff --git a/Zotlabs/Daemon/Notifier.php b/Zotlabs/Daemon/Notifier.php
index 1d0be10d9..00c6fb077 100644
--- a/Zotlabs/Daemon/Notifier.php
+++ b/Zotlabs/Daemon/Notifier.php
@@ -3,6 +3,7 @@
namespace Zotlabs\Daemon;
use Zotlabs\Lib\Libzot;
+use Zotlabs\Lib\Activity;
require_once('include/queue_fn.php');
require_once('include/html2plain.php');
@@ -366,9 +367,18 @@ class Notifier {
$activity = json_decode($m,true);
}
else {
- $activity = \Zotlabs\Lib\Activity::encode_activity($target_item);
+ $activity = array_merge(['@context' => [
+ ACTIVITYSTREAMS_JSONLD_REV,
+ 'https://w3id.org/security/v1',
+ z_root() . ZOT_APSCHEMA_REV
+ ]], Activity::encode_activity($target_item)
+ );
}
+ logger('target_item: ' . print_r($target_item,true), LOGGER_DEBUG);
+ logger('encoded: ' . print_r($activity,true), LOGGER_DEBUG);
+
+
// Send comments to the owner to re-deliver to everybody in the conversation
// We only do this if the item in question originated on this site. This prevents looping.
// To clarify, a site accepting a new comment is responsible for sending it to the owner for relay.
diff --git a/Zotlabs/Lib/Activity.php b/Zotlabs/Lib/Activity.php
index 5a406beb7..1ac3135db 100644
--- a/Zotlabs/Lib/Activity.php
+++ b/Zotlabs/Lib/Activity.php
@@ -592,8 +592,15 @@ class Activity {
}
}
-
- $ret['id'] = ((strpos($i['mid'],'http') === 0) ? $i['mid'] : z_root() . '/activity/' . urlencode($i['mid']));
+ if (strpos($i['mid'],z_root() . '/item/') !== false) {
+ $ret['id'] = str_replace('/item/','/activity/',$i['mid']);
+ }
+ elseif (strpos($i['mid'],z_root() . '/event/') !== false) {
+ $ret['id'] = str_replace('/event/','/activity/',$i['mid']);
+ }
+ else {
+ $ret['id'] = ((strpos($i['mid'],'http') === 0) ? $i['mid'] : z_root() . '/activity/' . urlencode($i['mid']));
+ }
if($i['title'])
$ret['name'] = html2plain(bbcode($i['title'], [ 'cache' => true ]));
diff --git a/Zotlabs/Lib/Libzot.php b/Zotlabs/Lib/Libzot.php
index d64421926..42e706754 100644
--- a/Zotlabs/Lib/Libzot.php
+++ b/Zotlabs/Lib/Libzot.php
@@ -1617,6 +1617,7 @@ class Libzot {
dbesc($arr['parent_mid']),
intval($channel['channel_id'])
);
+
if(! $r) {
$DR->update('comment parent not found');
$result[] = $DR->get();
diff --git a/Zotlabs/Module/Item.php b/Zotlabs/Module/Item.php
index e55192c7f..dbcbe5d22 100644
--- a/Zotlabs/Module/Item.php
+++ b/Zotlabs/Module/Item.php
@@ -976,7 +976,11 @@ class Item extends Controller {
$plink = z_root() . '/channel/' . $channel['channel_address'] . '/?f=&mid=' . gen_link_id($mid);
$plink = substr($plink,0,190);
}
-
+
+ if ($datarray['obj']) {
+ $datarray['obj']['id'] = $mid;
+ }
+
$datarray['aid'] = $channel['channel_account_id'];
$datarray['uid'] = $profile_uid;
$datarray['uuid'] = $uuid;