- if((strlen($hub)) && ($cmd !== 'mail') && ($followup == false)) {
- $params = 'hub.mode=publish&hub.url=' . urlencode($a->get_baseurl() . '/dfrn_poll/' . $owner['nickname'] );
- post_url($hub,$params);
+ if((strlen($hub)) && ($notify_hub)) {
+ $hubs = explode(',', $hub);
+ if(count($hubs)) {
+ foreach($hubs as $h) {
+ $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);
+ if($debugging) {
+ file_put_contents('pubsub.out', "\n\n" . "Pinged hub " . $h . ' at '
+ . datetime_convert() . "\n" . "Hub returned " . $a->get_curl_code() . "\n\n" , FILE_APPEND);
+ }
+ if(count($hubs) > 1)
+ sleep(7); // try and avoid multiple hubs responding at precisely the same time
+ }
+ }