- break OMB profile update pings to a background queue

- add event hooks to profile update pings
- send Salmon pings with custom update-profile event to OStatus subscribees and groups (subscribers will see it on your next post)
- fix OStatus queues with overlong transport names, should work on DB queues now
- Ostatus_profile::notifyActivity() and ::notifyDeferred() now can take XML, Notice, or Activity for convenience
This commit is contained in:
Brion Vibber
2010-02-24 20:36:36 +00:00
parent 07214f1370
commit c36bdc1ba5
12 changed files with 170 additions and 41 deletions

View File

@@ -83,23 +83,11 @@ class OStatusQueueHandler extends QueueHandler
function pingReply($oprofile)
{
if ($this->user) {
if (!empty($oprofile->salmonuri)) {
// For local posts, send a Salmon ping to the mentioned
// remote user or group.
// @fixme as an optimization we can skip this if the
// remote profile is subscribed to the author.
common_log(LOG_INFO, "Prepping to send notice '{$this->notice->uri}' to remote profile '{$oprofile->uri}'.");
$xml = '<?xml version="1.0" encoding="UTF-8" ?' . '>';
$xml .= $this->notice->asAtomEntry(true, true);
$data = array('salmonuri' => $oprofile->salmonuri,
'entry' => $xml);
$qm = QueueManager::get();
$qm->enqueue($data, 'salmonout');
}
// For local posts, send a Salmon ping to the mentioned
// remote user or group.
// @fixme as an optimization we can skip this if the
// remote profile is subscribed to the author.
$oprofile->notifyDeferred($this->notice);
}
}