Change some Salmon events and similar

Use Profile instead of User and (if we know it) send along the target
profile, so a Diaspora plugin can encrypt to the receiver.
This commit is contained in:
Mikael Nordfeldth
2015-10-04 17:23:11 +02:00
parent f4ed171397
commit 6afa091dca
3 changed files with 10 additions and 8 deletions

View File

@@ -345,7 +345,7 @@ class Ostatus_profile extends Managed_DataObject
$xml = $entry->getString();
common_log(LOG_INFO, "Posting to Salmon endpoint $this->salmonuri: $xml");
Salmon::post($this->salmonuri, $xml, $actor->getUser());
Salmon::post($this->salmonuri, $xml, $actor);
}
/**
@@ -359,7 +359,7 @@ class Ostatus_profile extends Managed_DataObject
public function notifyActivity($entry, Profile $actor)
{
if ($this->salmonuri) {
return Salmon::post($this->salmonuri, $this->notifyPrepXml($entry), $actor->getUser());
return Salmon::post($this->salmonuri, $this->notifyPrepXml($entry), $actor, $this->localProfile());
}
common_debug(__CLASS__.' error: No salmonuri for Ostatus_profile uri: '.$this->uri);
@@ -378,7 +378,8 @@ class Ostatus_profile extends Managed_DataObject
if ($this->salmonuri) {
$data = array('salmonuri' => $this->salmonuri,
'entry' => $this->notifyPrepXml($entry),
'actor' => $actor->id);
'actor' => $actor->getID(),
'target' => $this->localProfile()->getID());
$qm = QueueManager::get();
return $qm->enqueue($data, 'salmon');