mirror of
https://github.com/friendica/friendica
synced 2025-04-23 13:50:11 +00:00
Initial implementation of internal PuSH server in Friendica. It has been tested with GNU Social/StatusNet, and subscribe, unsubscribe and pushing new items seem to work.
This commit is contained in:
parent
19de78e511
commit
2859ce1483
6 changed files with 243 additions and 6 deletions
|
@ -966,9 +966,18 @@ function notifier_run(&$argv, &$argc){
|
|||
$h = trim($h);
|
||||
if(! strlen($h))
|
||||
continue;
|
||||
$params = 'hub.mode=publish&hub.url=' . urlencode($a->get_baseurl() . '/dfrn_poll/' . $owner['nickname'] );
|
||||
post_url($h,$params);
|
||||
logger('pubsub: publish: ' . $h . ' ' . $params . ' returned ' . $a->get_curl_code());
|
||||
|
||||
if ($h === '[internal]') {
|
||||
// Set push flag for PuSH subscribers to this topic,
|
||||
// they will be notified in queue.php
|
||||
q("UPDATE `push_subscriber` SET `push` = 1 " .
|
||||
"WHERE `nickname` = '%s'", dbesc($owner['nickname']));
|
||||
} else {
|
||||
|
||||
$params = 'hub.mode=publish&hub.url=' . urlencode( $a->get_baseurl() . '/dfrn_poll/' . $owner['nickname'] );
|
||||
post_url($h,$params);
|
||||
logger('pubsub: publish: ' . $h . ' ' . $params . ' returned ' . $a->get_curl_code());
|
||||
}
|
||||
if(count($hubs) > 1)
|
||||
sleep(7); // try and avoid multiple hubs responding at precisely the same time
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue