From d4a6aa7801d7bad862436990418a7aba34ddef1f Mon Sep 17 00:00:00 2001 From: zotlabs Date: Mon, 10 Feb 2020 15:34:33 -0800 Subject: this allows polls to federate from hubzilla to zap, though still a remaining issue with voting --- Zotlabs/Lib/Activity.php | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'Zotlabs/Lib') 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 ])); -- cgit v1.2.3