namespace Friendica\Worker;
-use Friendica\BaseObject;
use Friendica\Core\Logger;
-use Friendica\Core\System;
use Friendica\Database\DBA;
+use Friendica\DI;
use Friendica\Model\PushSubscriber;
use Friendica\Protocol\OStatus;
use Friendica\Util\Network;
private static function publish($id)
{
- $a = BaseObject::getApp();
-
$subscriber = DBA::selectFirst('push_subscriber', [], ['id' => $id]);
if (!DBA::isResult($subscriber)) {
return;
}
- /// @todo Check server status with PortableContact::checkServer()
+ /// @todo Check server status with GServer::check()
// Before this can be done we need a way to safely detect the server url.
Logger::log("Generate feed of user " . $subscriber['nickname']. " to " . $subscriber['callback_url']. " - last updated " . $subscriber['last_update'], Logger::DEBUG);
$headers = ["Content-type: application/atom+xml",
sprintf("Link: <%s>;rel=hub,<%s>;rel=self",
- System::baseUrl() . '/pubsubhubbub/' . $subscriber['nickname'],
+ DI::baseUrl() . '/pubsubhubbub/' . $subscriber['nickname'],
$subscriber['topic']),
"X-Hub-Signature: sha1=" . $hmac_sig];
$postResult = Network::post($subscriber['callback_url'], $params, $headers);
$ret = $postResult->getReturnCode();
- $condition = ['id' => $subscriber['id']];
-
if ($ret >= 200 && $ret <= 299) {
Logger::log('Successfully pushed to ' . $subscriber['callback_url']);