forked from GNUsocial/gnu-social
add activity:subject to atom feeds
This commit is contained in:
parent
d5ba9e1b10
commit
5aeed9e041
@ -102,16 +102,21 @@ class OStatusPlugin extends Plugin
|
|||||||
$id = null;
|
$id = null;
|
||||||
|
|
||||||
if ($feed instanceof AtomUserNoticeFeed) {
|
if ($feed instanceof AtomUserNoticeFeed) {
|
||||||
$salmonAction = 'salmon';
|
$salmonAction = 'usersalmon';
|
||||||
$id = $feed->getUser()->id;
|
$user = $feed->getUser();
|
||||||
|
$id = $user->id;
|
||||||
|
$profile = $user->getProfile();
|
||||||
|
$feed->setActivitySubject($profile->asActivityNoun('subject'));
|
||||||
} else if ($feed instanceof AtomGroupNoticeFeed) {
|
} else if ($feed instanceof AtomGroupNoticeFeed) {
|
||||||
$salmonAction = 'salmongroup';
|
$salmonAction = 'groupsalmon';
|
||||||
$id = $feed->getGroup()->id;
|
$group = $feed->getGroup();
|
||||||
|
$id = $group->id;
|
||||||
|
$feed->setActivitySubject($group->asActivitySubject());
|
||||||
} else {
|
} else {
|
||||||
return;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!empty($id)) {
|
if (!empty($id)) {
|
||||||
$hub = common_config('ostatus', 'hub');
|
$hub = common_config('ostatus', 'hub');
|
||||||
if (empty($hub)) {
|
if (empty($hub)) {
|
||||||
// Updates will be handled through our internal PuSH hub.
|
// Updates will be handled through our internal PuSH hub.
|
||||||
@ -123,6 +128,8 @@ class OStatusPlugin extends Plugin
|
|||||||
$salmon = common_local_url($salmonAction, array('id' => $id));
|
$salmon = common_local_url($salmonAction, array('id' => $id));
|
||||||
$feed->addLink($salmon, array('rel' => 'salmon'));
|
$feed->addLink($salmon, array('rel' => 'salmon'));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user