use Friendica\Core\Logger;
use Friendica\Core\Protocol;
use Friendica\Core\Renderer;
+use Friendica\Core\Worker;
use Friendica\Database\DBA;
use Friendica\DI;
use Friendica\Model\Item;
$link = hash('ripemd128', $item['msg']);
}
- Post\Delayed::add($link, $post, PRIORITY_MEDIUM, Post\Delayed::UNPREPARED);
+ Post\Delayed::add($link, $post, Worker::PRIORITY_MEDIUM, Post\Delayed::UNPREPARED);
}
'addon/mailstream/mailstream.php',
'mailstream_convert_table_entries'
);
- Hook::fork(PRIORITY_LOW, 'mailstream_convert_table_entries');
+ Hook::fork(Worker::PRIORITY_LOW, 'mailstream_convert_table_entries');
}
}
'message_id' => $message_id,
'tries' => 0,
];
- Hook::fork(PRIORITY_LOW, 'mailstream_send_hook', $send_hook_data);
+ Hook::fork(Worker::PRIORITY_LOW, 'mailstream_send_hook', $send_hook_data);
}
/**
*
* @return array new value of the attachments table (results are also stored in the reference parameter)
*/
-function mailstream_do_images(arrat &$item, array &$attachments)
+function mailstream_do_images(array &$item, array &$attachments)
{
if (!DI::pConfig()->get($item['uid'], 'mailstream', 'attachimg')) {
return;
*
* @param string $text text to word wrap - modified in-place
*/
-function mailstream_html_wrap(string &$text): string
+function mailstream_html_wrap(string &$text)
{
$lines = str_split($text, 200);
for ($i = 0; $i < count($lines); $i++) {
continue;
}
Logger::info('mailstream_convert_table_entries: convert item to workerqueue', $send_hook_data);
- Hook::fork(PRIORITY_LOW, 'mailstream_send_hook', $send_hook_data);
+ Hook::fork(Worker::PRIORITY_LOW, 'mailstream_send_hook', $send_hook_data);
}
DBA::e('DROP TABLE `mailstream_item`');
}
function pumpio_cron(App $a, $b)
{
- Worker::add(PRIORITY_MEDIUM, 'addon/pumpio/pumpio_sync.php');
+ Worker::add(Worker::PRIORITY_MEDIUM, 'addon/pumpio/pumpio_sync.php');
}
function pumpio_fetchtimeline(App $a, int $uid)
$post->object = $item;
- Logger::notice('pumpio_fetchallcomments: posting comment ' . $post->object->id . ' ', $post);
+ Logger::notice('pumpio_fetchallcomments: posting comment ' . $post->object->id . ' ', json_decode(json_encode($post), true));
pumpio_dopost($a, $client, $uid, $self, $post, $own_id, false);
}
}
$pconfigs = DBA::selectToArray('pconfig', [], ['cat' => 'twitter', 'k' => 'mirror_posts', 'v' => true]);
foreach ($pconfigs as $rr) {
Logger::notice('Fetching', ['user' => $rr['uid']]);
- Worker::add(['priority' => PRIORITY_MEDIUM, 'force_priority' => true], 'addon/twitter/twitter_sync.php', 1, (int) $rr['uid']);
+ Worker::add(['priority' => Worker::PRIORITY_MEDIUM, 'force_priority' => true], 'addon/twitter/twitter_sync.php', 1, (int) $rr['uid']);
}
$abandon_days = intval(DI::config()->get('system', 'account_abandon_days'));
}
Logger::notice('importing timeline', ['user' => $rr['uid']]);
- Worker::add(['priority' => PRIORITY_MEDIUM, 'force_priority' => true], 'addon/twitter/twitter_sync.php', 2, (int) $rr['uid']);
+ Worker::add(['priority' => Worker::PRIORITY_MEDIUM, 'force_priority' => true], 'addon/twitter/twitter_sync.php', 2, (int) $rr['uid']);
/*
// To-Do
// check for new contacts once a day
Logger::info('Posting mirror post', ['twitter-id' => $post->id_str, 'uid' => $uid]);
- Post\Delayed::add($mirrorpost['extid'], $mirrorpost, PRIORITY_MEDIUM, Post\Delayed::UNPREPARED);
+ Post\Delayed::add($mirrorpost['extid'], $mirrorpost, Worker::PRIORITY_MEDIUM, Post\Delayed::UNPREPARED);
}
}
DI::pConfig()->set($uid, 'twitter', 'lastid', $lastid);
if (empty($postarray['thr-parent'])) {
$contact = DBA::selectFirst('contact', [], ['id' => $postarray['contact-id'], 'self' => false]);
if (DBA::isResult($contact) && Item::isRemoteSelf($contact, $postarray)) {
- $notify = PRIORITY_MEDIUM;
+ $notify = Worker::PRIORITY_MEDIUM;
}
}