aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorMario Vavti <mario@mariovavti.com>2024-10-09 18:17:37 +0200
committerMario Vavti <mario@mariovavti.com>2024-10-09 18:17:37 +0200
commit45c0091d3d5ce1aae1f4915dfd4c15865a011fe1 (patch)
tree8a9c4dd92ca86a3ee0fec353de9b80f49aef3a2a /include
parent75184355d02007593d978a13b7e57514e6b08f63 (diff)
downloadvolse-hubzilla-45c0091d3d5ce1aae1f4915dfd4c15865a011fe1.tar.gz
volse-hubzilla-45c0091d3d5ce1aae1f4915dfd4c15865a011fe1.tar.bz2
volse-hubzilla-45c0091d3d5ce1aae1f4915dfd4c15865a011fe1.zip
more work on porting containers from streams
Diffstat (limited to 'include')
-rw-r--r--include/items.php30
-rw-r--r--include/network.php2
2 files changed, 23 insertions, 9 deletions
diff --git a/include/items.php b/include/items.php
index fa699148a..60f5cbe9c 100644
--- a/include/items.php
+++ b/include/items.php
@@ -525,7 +525,7 @@ function post_activity_item($arr, $allow_code = false, $deliver = true, $channel
$post = item_store($arr, $allow_code, $deliver, $addAndSync);
-hz_syslog('xxx: ' . print_r($post, true));
+ hz_syslog('post_activity_item: ' . print_r($post['item_id'], true));
if (!$post['success']) {
return $ret;
@@ -3395,6 +3395,9 @@ function start_delivery_chain($channel, $item, $item_id, $parent, $group = false
if ($post_id) {
Master::Summon([ 'Notifier','tgroup',$post_id ]);
+ if (!empty($post['approval_id'])) {
+ Master::Summon(['Notifier', 'tgroup', $post['approval_id']]);
+ }
}
q("update channel set channel_lastpost = '%s' where channel_id = %d",
@@ -5181,10 +5184,12 @@ function addToCollectionAndSync($ret) {
$channel = channelx_by_n($ret['item']['uid']);
if ($channel && $channel['channel_hash'] === $ret['item']['owner_xchan']) {
$items = [$ret['item']];
+
if ((int)$items[0]['item_blocked'] === ITEM_MODERATED
|| (int)$items[0]['item_unpublished'] || (int)$items[0]['item_delayed']) {
return $ret;
}
+
xchan_query($items);
$items = fetch_post_tags($items);
$sync_items = [];
@@ -5192,16 +5197,16 @@ function addToCollectionAndSync($ret) {
if (!in_array($ret['item']['verb'], ['Add', 'Remove'])) {
- $newObj = Activity::build_packet(Activity::encode_activity($items[0]), $channel, false);
- $approval = Activity::addToCollection($channel, $newObj, $ret['item']['parent_mid'], $ret['item'], deliver: false);
-//hz_syslog(print_r($approval, true));
+ $new_obj = Activity::build_packet(Activity::encode_activity($items[0]), $channel, false);
+ $approval = Activity::addToCollection($channel, $new_obj, $ret['item']['parent_mid'], $ret['item'], deliver: false);
+
if ($approval['success']) {
$ret['approval_id'] = $approval['item_id'];
$ret['approval'] = $approval['activity'];
- $addItems = [$approval['activity']];
- xchan_query($addItems);
- $addItems = fetch_post_tags($addItems);
- $sync_items[] = encode_item($addItems[0], true);
+ $add_items = [$approval['activity']];
+ xchan_query($add_items);
+ $add_items = fetch_post_tags($add_items);
+ $sync_items[] = encode_item($add_items[0], true);
}
}
@@ -5227,3 +5232,12 @@ function addToCollectionAndSync($ret) {
return $ret;
}
+
+function reverse_activity_mid($string) {
+ return str_replace(z_root() . '/activity/', z_root() . '/item/', $string);
+}
+
+function set_activity_mid($string) {
+ return str_replace(z_root() . '/item/', z_root() . '/activity/', $string);
+}
+
diff --git a/include/network.php b/include/network.php
index b3a3d715c..0a78c144b 100644
--- a/include/network.php
+++ b/include/network.php
@@ -1488,7 +1488,7 @@ function do_delivery($deliveries, $force = false) {
$interval = Config::Get('queueworker', 'queue_interval', 500000);
- $deliveries_per_process = intval(Config::Get('system','delivery_batch_count'));
+// $deliveries_per_process = intval(Config::Get('system','delivery_batch_count'));
if($deliveries_per_process <= 0)
$deliveries_per_process = 1;