use Friendica\Core\Addon;
use Friendica\Core\PConfig;
use Friendica\Database\DBM;
+use Friendica\Model\Queue;
function diaspora_install() {
Addon::registerHook('post_local', 'addon/diaspora/diaspora.php', 'diaspora_post_local');
if(! count($qi))
return;
- require_once('include/queue_fn.php');
-
foreach($qi as $x) {
if($x['network'] !== NETWORK_DIASPORA2)
continue;
$conn->provider = $hostname;
$conn->postStatusMessage($post, $aspect);
- logger('diaspora_queue: send '.$userdata['uid'].' success', LOGGER_DEBUG);
+ logger('diaspora_queue: send '.$userdata['uid'].' success', LOGGER_DEBUG);
- $success = true;
+ $success = true;
- remove_queue_item($x['id']);
+ Queue::removeItem($x['id']);
} catch (Exception $e) {
logger("diaspora_queue: Send ".$userdata['uid']." failed: ".$e->getMessage(), LOGGER_DEBUG);
}
- } else
+ } else {
logger('diaspora_queue: send '.$userdata['uid'].' missing username or password', LOGGER_DEBUG);
+ }
if (!$success) {
logger('diaspora_queue: delayed');
- update_queue_time($x['id']);
+ Queue::updateTime($x['id']);
}
}
}
$a->contact = $r[0]["id"];
$s = serialize(['url' => $url, 'item' => $b['id'], 'post' => $body]);
- require_once('include/queue_fn.php');
- add_to_queue($a->contact,NETWORK_DIASPORA2,$s);
+
+ Queue::add($a->contact, NETWORK_DIASPORA2, $s);
notice(t('Diaspora post failed. Queued for retry.').EOL);
}
}
use Friendica\Model\Group;
use Friendica\Model\User;
use Friendica\Model\Item;
+use Friendica\Model\Queue;
require 'addon/pumpio/oauth/http.php';
require 'addon/pumpio/oauth/oauth_client.php';
$a->contact = $r[0]["id"];
$s = serialize(['url' => $url, 'item' => $b['id'], 'post' => $params]);
- require_once('include/queue_fn.php');
- add_to_queue($a->contact,NETWORK_PUMPIO,$s);
+
+ Queue::add($a->contact, NETWORK_PUMPIO, $s);
notice(t('Pump.io post failed. Queued for retry.').EOL);
}
-
}
}
$a->contact = $r[0]["id"];
$s = serialize(['url' => $url, 'item' => $orig_post["id"], 'post' => $params]);
- require_once('include/queue_fn.php');
- add_to_queue($a->contact,NETWORK_PUMPIO,$s);
+
+ Queue::add($a->contact, NETWORK_PUMPIO, $s);
notice(t('Pump.io like failed. Queued for retry.').EOL);
}
}
if(! count($qi))
return;
- require_once('include/queue_fn.php');
-
foreach($qi as $x) {
if($x['network'] !== NETWORK_PUMPIO)
continue;
intval($z['item'])
);
}
- remove_queue_item($x['id']);
+ Queue::removeItem($x['id']);
} else
logger('pumpio_queue: send '.$username.': '.$url.' general error: ' . print_r($user,true));
} else
if (!$success) {
logger('pumpio_queue: delayed');
- update_queue_time($x['id']);
+ Queue::updateTime($x['id']);
}
}
}