aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs/Module/Share.php
diff options
context:
space:
mode:
Diffstat (limited to 'Zotlabs/Module/Share.php')
-rw-r--r--Zotlabs/Module/Share.php34
1 files changed, 23 insertions, 11 deletions
diff --git a/Zotlabs/Module/Share.php b/Zotlabs/Module/Share.php
index 716f7229b..ea9313fa8 100644
--- a/Zotlabs/Module/Share.php
+++ b/Zotlabs/Module/Share.php
@@ -65,9 +65,7 @@ class Share extends \Zotlabs\Web\Controller {
$item = $r[0];
- $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 +76,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'])
);
@@ -96,25 +94,39 @@ class Share extends \Zotlabs\Web\Controller {
else
killme();
-
- $arr['aid'] = $owner_aid;
- $arr['uid'] = $owner_uid;
+ $arr['aid'] = $item['aid'];
+ $arr['uid'] = $item['uid'];
$arr['item_origin'] = 1;
$arr['item_wall'] = $item['item_wall'];
+ $arr['item_private'] = $item['item_private'];
$arr['uuid'] = item_message_id();
$arr['mid'] = z_root() . '/activity/' . $arr['uuid'];
- $arr['parent_mid'] = $item['mid'];
+ $arr['parent_mid'] = $item['parent_mid'];
+ $arr['thr_parent'] = $item['mid'];
+
+ $created = datetime_convert();
+
+ $arr['created'] = $created;
+ $arr['edited'] = $created;
+ $arr['commented'] = $created;
+ $arr['received'] = $created;
+ $arr['changed'] = $created;
+ $arr['item_type'] = ITEM_TYPE_POST;
$mention = '@[zrl=' . $item['author']['xchan_url'] . ']' . $item['author']['xchan_name'] . '[/zrl]';
$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['source_xchan'] = '';
+
+ $arr['obj'] = $item['obj'];
$arr['obj_type'] = $item['obj_type'];
$arr['verb'] = ACTIVITY_SHARE;
+ call_hooks('post_local', $arr);
+
$post = item_store($arr);
$post_id = $post['item_id'];
@@ -123,7 +135,7 @@ class Share extends \Zotlabs\Web\Controller {
call_hooks('post_local_end', $arr);
- info( t('Post repeated') . EOL);
+ // info( t('Post repeated') . EOL);
$r = q("select * from item where id = %d",
intval($post_id)