aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs/Module
diff options
context:
space:
mode:
Diffstat (limited to 'Zotlabs/Module')
-rw-r--r--Zotlabs/Module/Share.php24
-rw-r--r--Zotlabs/Module/Sse_bs.php14
2 files changed, 22 insertions, 16 deletions
diff --git a/Zotlabs/Module/Share.php b/Zotlabs/Module/Share.php
index 248126f7f..ea9313fa8 100644
--- a/Zotlabs/Module/Share.php
+++ b/Zotlabs/Module/Share.php
@@ -65,8 +65,6 @@ 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']))
@@ -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['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'];
diff --git a/Zotlabs/Module/Sse_bs.php b/Zotlabs/Module/Sse_bs.php
index 78adf1859..2e9904cd3 100644
--- a/Zotlabs/Module/Sse_bs.php
+++ b/Zotlabs/Module/Sse_bs.php
@@ -121,12 +121,7 @@ class Sse_bs extends Controller {
$mids = [];
$str = '';
- $mids_all_json = Cache::get('sse_mids_all_' . session_id());
-
- if (!$mids_all_json)
- $mids_all_json = '[]';
-
- $mids_all = json_decode($mids_all_json, true);
+ $mids_all = unserialise(Cache::get('sse_mids_all_' . session_id()));
foreach($arr as $a) {
$mid_str = '\'' . dbesc(unpack_link_id($a)) . '\'';
@@ -137,7 +132,7 @@ class Sse_bs extends Controller {
}
}
- Cache::set('sse_mids_all_' . session_id(), json_encode($mids_all));
+ Cache::set('sse_mids_all_' . session_id(), serialise($mids_all));
if(! self::$uid) {
return;
@@ -448,9 +443,8 @@ class Sse_bs extends Controller {
$sql_extra2 = " AND CASE WHEN verb = '" . ACTIVITY_SHARE . "' THEN owner_xchan ELSE author_xchan END IN (" . self::$xchans . ") ";
$sql_extra3 = '';
- $sse_mids_all_json = Cache::get('sse_mids_all_' . session_id());
- if ($sse_mids_all_json) {
- $sse_mids_all = json_decode($sse_mids_all_json, true);
+ $sse_mids_all = unserialise(Cache::get('sse_mids_all_' . session_id()));
+ if ($sse_mids_all) {
$sql_extra3 = " AND mid NOT IN (" . protect_sprintf(implode(',', $sse_mids_all)) . ") ";
}