Support for message delivering via uri-id

This commit is contained in:
Michael 2021-02-14 14:24:48 +00:00
commit 6e1483545e
10 changed files with 95 additions and 56 deletions

View file

@ -216,10 +216,10 @@ function events_post(App $a)
exit();
}
$item_id = Event::store($datarray);
$uri_id = Event::store($datarray);
if (!$cid) {
Worker::add(PRIORITY_HIGH, "Notifier", Delivery::POST, $item_id);
Worker::add(PRIORITY_HIGH, "Notifier", Delivery::POST, (int)$uri_id, (int)$uid);
}
DI::baseUrl()->redirect('events');

View file

@ -781,7 +781,7 @@ function item_post(App $a) {
// When we are doing some forum posting via ! we have to start the notifier manually.
// These kind of posts don't initiate the notifier call in the item class.
if ($only_to_forum) {
Worker::add(['priority' => PRIORITY_HIGH, 'dont_fork' => false], "Notifier", Delivery::POST, $post_id);
Worker::add(['priority' => PRIORITY_HIGH, 'dont_fork' => false], "Notifier", Delivery::POST, (int)$datarray['uri-id'], (int)$datarray['uid']);
}
Logger::info('post_complete');

View file

@ -176,7 +176,9 @@ EOT;
Hook::callAll('post_local_end', $arr);
Worker::add(PRIORITY_HIGH, "Notifier", Delivery::POST, $post_id);
$post = Post::selectFirst(['uri-id', 'uid'], ['id' => $post_id]);
Worker::add(PRIORITY_HIGH, "Notifier", Delivery::POST, $post['uri-id'], $post['uid']);
exit();
}