diff options
-rw-r--r-- | Zotlabs/Lib/Activity.php | 6 | ||||
-rw-r--r-- | Zotlabs/Lib/ThreadItem.php | 16 | ||||
-rw-r--r-- | Zotlabs/Module/Share.php | 8 | ||||
-rw-r--r-- | boot.php | 3 |
4 files changed, 18 insertions, 15 deletions
diff --git a/Zotlabs/Lib/Activity.php b/Zotlabs/Lib/Activity.php index 835909849..0dfa15aea 100644 --- a/Zotlabs/Lib/Activity.php +++ b/Zotlabs/Lib/Activity.php @@ -1194,7 +1194,7 @@ class Activity { $acts = [ 'http://activitystrea.ms/schema/1.0/post' => 'Create', - 'http://activitystrea.ms/schema/1.0/share' => 'Announce', + //'http://activitystrea.ms/schema/1.0/share' => 'Announce', 'http://activitystrea.ms/schema/1.0/update' => 'Update', 'http://activitystrea.ms/schema/1.0/like' => 'Like', 'http://activitystrea.ms/schema/1.0/favorite' => 'Like', @@ -1206,6 +1206,7 @@ class Activity { 'http://purl.org/zot/activity/attendyes' => 'Accept', 'http://purl.org/zot/activity/attendno' => 'Reject', 'http://purl.org/zot/activity/attendmaybe' => 'TentativeAccept', + 'Announce' => 'Announce', 'Invite' => 'Invite', 'Delete' => 'Delete', 'Undo' => 'Undo' @@ -1242,7 +1243,7 @@ class Activity { $acts = [ 'http://activitystrea.ms/schema/1.0/post' => 'Create', - 'http://activitystrea.ms/schema/1.0/share' => 'Announce', + // 'http://activitystrea.ms/schema/1.0/share' => 'Announce', 'http://activitystrea.ms/schema/1.0/update' => 'Update', 'http://activitystrea.ms/schema/1.0/like' => 'Like', 'http://activitystrea.ms/schema/1.0/favorite' => 'Like', @@ -1254,6 +1255,7 @@ class Activity { 'http://purl.org/zot/activity/attendyes' => 'Accept', 'http://purl.org/zot/activity/attendno' => 'Reject', 'http://purl.org/zot/activity/attendmaybe' => 'TentativeAccept', + 'Announce' => 'Announce', 'Invite' => 'Invite', 'Delete' => 'Delete', 'Undo' => 'Undo' diff --git a/Zotlabs/Lib/ThreadItem.php b/Zotlabs/Lib/ThreadItem.php index 037ddb19e..3cdb59e5f 100644 --- a/Zotlabs/Lib/ThreadItem.php +++ b/Zotlabs/Lib/ThreadItem.php @@ -121,12 +121,14 @@ class ThreadItem { $locktype = 0; } - $shareable = ((($conv->get_profile_owner() == local_channel() && local_channel()) && ($item['item_private'] != 1)) ? true : false); + $shareable = ((($conv->get_profile_owner() == local_channel() && local_channel()) && (intval($item['item_private']) === 0)) ? true : false); // allow an exemption for sharing stuff from your private feeds if($item['author']['xchan_network'] === 'rss') $shareable = true; + $repeatable = ((($conv->get_profile_owner() == local_channel() && local_channel()) && (intval($item['item_private']) === 0) && (in_array($item['author']['xchan_network'], ['zot6', 'activitypub']))) ? true : false); + // @fixme // Have recently added code to properly handle polls in group reshares by redirecting all of the poll responses to the group. // Sharing a poll using a regular embedded share is harder because the poll will need to fork. This is due to comment permissions. @@ -315,13 +317,11 @@ class ThreadItem { $share = []; $embed = []; if ($shareable) { - // This actually turns out not to be possible in some protocol stacks without opening up hundreds of new issues. - // Will allow it only for uri resolvable sources. - if(strpos($item['mid'],'http') === 0) { - //Not yet ready for primetime - //$share = array( t('Repeat This'), t('repeat')); - } - $embed = [t('Share This'), t('share')]; + $embed = [t('Share'), t('share')]; + } + + if ($repeatable) { + $share = [t('Repeat'), t('repeat')]; } $dreport = ''; diff --git a/Zotlabs/Module/Share.php b/Zotlabs/Module/Share.php index 716f7229b..eb22b5802 100644 --- a/Zotlabs/Module/Share.php +++ b/Zotlabs/Module/Share.php @@ -67,7 +67,7 @@ class Share extends \Zotlabs\Web\Controller { $owner_uid = $r[0]['uid']; $owner_aid = $r[0]['aid']; - +/* $can_comment = false; if((array_key_exists('owner',$item)) && intval($item['owner']['abook_self'])) $can_comment = perm_is_allowed($item['uid'],$observer['xchan_hash'],'post_comments'); @@ -78,7 +78,7 @@ class Share extends \Zotlabs\Web\Controller { notice( t('Permission denied') . EOL); killme(); } - +*/ $r = q("select * from xchan where xchan_hash = '%s' limit 1", dbesc($item['owner_xchan']) ); @@ -110,8 +110,8 @@ class Share extends \Zotlabs\Web\Controller { $arr['body'] = sprintf( t('🔁 Repeated %1$s\'s %2$s'), $mention, Activity::activity_obj_mapper($item['obj_type'])); $arr['author_xchan'] = $channel['channel_hash']; - $arr['owner_xchan'] = $item['author_xchan']; - $arr['obj'] = Activity::encode_item($item); + $arr['owner_xchan'] = $item['author_xchan']; + $arr['obj'] = $item['obj']; $arr['obj_type'] = $item['obj_type']; $arr['verb'] = ACTIVITY_SHARE; @@ -517,7 +517,8 @@ define('ACTIVITY_JOIN', NAMESPACE_ACTIVITY_SCHEMA . 'join'); define('ACTIVITY_POST', NAMESPACE_ACTIVITY_SCHEMA . 'post'); define('ACTIVITY_UPDATE', NAMESPACE_ACTIVITY_SCHEMA . 'update'); define('ACTIVITY_TAG', NAMESPACE_ACTIVITY_SCHEMA . 'tag'); -define('ACTIVITY_SHARE', NAMESPACE_ACTIVITY_SCHEMA . 'share'); +define('ACTIVITY_SHARE', 'Announce'); +//define('ACTIVITY_SHARE', NAMESPACE_ACTIVITY_SCHEMA . 'share'); define('ACTIVITY_FAVORITE', NAMESPACE_ACTIVITY_SCHEMA . 'favorite'); define('ACTIVITY_CREATE', NAMESPACE_ACTIVITY_SCHEMA . 'create'); define('ACTIVITY_DELETE', NAMESPACE_ACTIVITY_SCHEMA . 'delete'); |