We are no longer offering accounts on this server. Consider https://gitlab.freedesktop.org/ as a place to host projects.

Commit 6f0f8cd6 authored by mattl's avatar mattl

Initial work on making the Share verb handled in plugin

parent 2a32af08
......@@ -1818,17 +1818,7 @@ class Notice extends Managed_DataObject
$act->verb = $this->verb;
if ($this->repeat_of) {
$repeated = Notice::getKV('id', $this->repeat_of);
if ($repeated instanceof Notice) {
// TRANS: A repeat activity's title. %1$s is repeater's nickname
// and %2$s is the repeated user's nickname.
$act->title = sprintf(_('%1$s repeated a notice by %2$s'),
$this->getProfile()->getNickname(),
$repeated->getProfile()->getNickname());
$act->objects[] = $repeated->asActivity($scoped);
}
} else {
if (!$this->repeat_of) {
$act->objects[] = $this->asActivityObject();
}
......
......@@ -160,10 +160,10 @@ abstract class ActivityHandlerPlugin extends Plugin
* @fixme are there any standard options?
*
* @param Activity $activity
* @param Profile $actor
* @param Notice $stored The notice in our database for this certain object
* @param array $options=array()
*
* @return Notice the resulting notice
* @return object If the verb handling plugin creates an object, it can be returned here.
*/
protected function saveObjectFromActivity(Activity $activity, Notice $stored, array $options=array())
{
......@@ -182,7 +182,13 @@ abstract class ActivityHandlerPlugin extends Plugin
}
$object = $this->saveObjectFromActivity($act, $stored, $options);
try {
$act->context->attention = array_merge($act->context->attention, $object->getAttentionArray());
// In the future we probably want to use something like ActivityVerb_DataObject for the kind
// of objects which are returned from saveObjectFromActivity.
if ($object instanceof Managed_DataObject) {
// If the verb handling plugin figured out some more attention URIs, add them here to the
// original activity.
$act->context->attention = array_merge($act->context->attention, $object->getAttentionArray());
}
} catch (Exception $e) {
common_debug('WARNING: Could not get attention list from object '.get_class($object).'!');
}
......
......@@ -149,7 +149,6 @@ class Router
'sandbox', 'unsandbox',
'silence', 'unsilence',
'grantrole', 'revokerole',
'repeat',
'deleteuser',
'geocode',
'version',
......@@ -393,18 +392,6 @@ class Router
array('action' => 'ApiTimelineMentions',
'format' => '(xml|json|rss|atom|as)'));
$m->connect('api/statuses/retweeted_by_me.:format',
array('action' => 'ApiTimelineRetweetedByMe',
'format' => '(xml|json|atom|as)'));
$m->connect('api/statuses/retweeted_to_me.:format',
array('action' => 'ApiTimelineRetweetedToMe',
'format' => '(xml|json|atom|as)'));
$m->connect('api/statuses/retweets_of_me.:format',
array('action' => 'ApiTimelineRetweetsOfMe',
'format' => '(xml|json|atom|as)'));
$m->connect('api/statuses/friends/:id.:format',
array('action' => 'ApiUserFriends',
'id' => Nickname::INPUT_FMT,
......@@ -445,16 +432,6 @@ class Router
array('action' => 'ApiStatusesDestroy',
'format' => '(xml|json)'));
$m->connect('api/statuses/retweet/:id.:format',
array('action' => 'ApiStatusesRetweet',
'id' => '[0-9]+',
'format' => '(xml|json)'));
$m->connect('api/statuses/retweets/:id.:format',
array('action' => 'ApiStatusesRetweets',
'id' => '[0-9]+',
'format' => '(xml|json)'));
// START qvitter API additions
$m->connect('api/attachment/:id.:format',
......
This diff is collapsed.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment