Add support for favor and disfavor notification

Added support for favoring and disfavoring in OStatusPlugin.

Needed to represent the Notice as an activity:object, so added
some code for that in lib/activity.php.

Also, made some small changes to OStatusPlugin so it handled
having a non-default argument $object correctly.
This commit is contained in:
Evan Prodromou
2010-02-20 19:58:20 -05:00
parent f3b08461bd
commit 96c6019638
3 changed files with 98 additions and 13 deletions

View File

@@ -307,7 +307,7 @@ class Ostatus_profile extends Memcached_DataObject
*
* @param Profile $actor
* @param $verb eg Activity::SUBSCRIBE or Activity::JOIN
* @param $object object of the action; if null, the remote entity itself is assumed
* @param string $object object of the action; if null, the remote entity itself is assumed
*/
public function notify($actor, $verb, $object=null)
{
@@ -319,7 +319,7 @@ class Ostatus_profile extends Memcached_DataObject
throw new ServerException("Invalid actor passed to " . __METHOD__ . ": " . $type);
}
if ($object == null) {
$object = $this;
$object = $this->asActivityNoun('object');
}
if ($this->salmonuri) {
$text = 'update'; // @fixme
@@ -345,7 +345,7 @@ class Ostatus_profile extends Memcached_DataObject
$entry->element('activity:verb', null, $verb);
$entry->raw($actor->asAtomAuthor());
$entry->raw($actor->asActivityActor());
$entry->raw($object->asActivityNoun('object'));
$entry->raw($object);
$entry->elementEnd('entry');
$xml = $entry->getString();