summaryrefslogtreecommitdiff
path: root/plugins/OStatus/OStatusPlugin.php
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/OStatus/OStatusPlugin.php')
-rw-r--r--plugins/OStatus/OStatusPlugin.php37
1 files changed, 26 insertions, 11 deletions
diff --git a/plugins/OStatus/OStatusPlugin.php b/plugins/OStatus/OStatusPlugin.php
index 7f75b7b2b..720dedd0a 100644
--- a/plugins/OStatus/OStatusPlugin.php
+++ b/plugins/OStatus/OStatusPlugin.php
@@ -43,8 +43,8 @@ class OStatusPlugin extends Plugin
// Discovery actions
$m->connect('.well-known/host-meta',
array('action' => 'hostmeta'));
- $m->connect('main/webfinger',
- array('action' => 'webfinger'));
+ $m->connect('main/xrd',
+ array('action' => 'xrd'));
$m->connect('main/ostatus',
array('action' => 'ostatusinit'));
$m->connect('main/ostatus?nickname=:nickname',
@@ -103,6 +103,20 @@ class OStatusPlugin extends Plugin
}
/**
+ * Add a link header for LRDD Discovery
+ */
+ function onStartShowHTML($action)
+ {
+ if ($action instanceof ShowstreamAction) {
+ $acct = 'acct:'. $action->profile->nickname .'@'. common_config('site', 'server');
+ $url = common_local_url('xrd');
+ $url.= '?uri='. $acct;
+
+ header('Link: <'.$url.'>; rel="'. Discovery::LRDD_REL.'"; type="application/xrd+xml"');
+ }
+ }
+
+ /**
* Set up a PuSH hub link to our internal link for canonical timeline
* Atom feeds for users and groups.
*/
@@ -135,7 +149,8 @@ class OStatusPlugin extends Plugin
// Also, we'll add in the salmon link
$salmon = common_local_url($salmonAction, array('id' => $id));
- $feed->addLink($salmon, array('rel' => 'salmon'));
+ $feed->addLink($salmon, array('rel' => Salmon::NS_REPLIES));
+ $feed->addLink($salmon, array('rel' => Salmon::NS_MENTIONS));
}
return true;
@@ -400,7 +415,7 @@ class OStatusPlugin extends Plugin
$act->actor = ActivityObject::fromProfile($subscriber);
$act->object = ActivityObject::fromProfile($other);
- $oprofile->notifyActivity($act);
+ $oprofile->notifyActivity($act, $subscriber);
return true;
}
@@ -448,7 +463,7 @@ class OStatusPlugin extends Plugin
$act->actor = ActivityObject::fromProfile($profile);
$act->object = ActivityObject::fromProfile($other);
- $oprofile->notifyActivity($act);
+ $oprofile->notifyActivity($act, $profile);
return true;
}
@@ -490,7 +505,7 @@ class OStatusPlugin extends Plugin
$member->getBestName(),
$oprofile->getBestName());
- if ($oprofile->notifyActivity($act)) {
+ if ($oprofile->notifyActivity($act, $member)) {
return true;
} else {
$oprofile->garbageCollect();
@@ -540,7 +555,7 @@ class OStatusPlugin extends Plugin
$member->getBestName(),
$oprofile->getBestName());
- $oprofile->notifyActivity($act);
+ $oprofile->notifyActivity($act, $member);
}
}
@@ -583,7 +598,7 @@ class OStatusPlugin extends Plugin
$act->actor = ActivityObject::fromProfile($profile);
$act->object = ActivityObject::fromNotice($notice);
- $oprofile->notifyActivity($act);
+ $oprofile->notifyActivity($act, $profile);
return true;
}
@@ -627,7 +642,7 @@ class OStatusPlugin extends Plugin
$act->actor = ActivityObject::fromProfile($profile);
$act->object = ActivityObject::fromNotice($notice);
- $oprofile->notifyActivity($act);
+ $oprofile->notifyActivity($act, $profile);
return true;
}
@@ -644,7 +659,7 @@ class OStatusPlugin extends Plugin
function onStartUserGroupHomeUrl($group, &$url)
{
- return $this->onStartUserGroupPermalink($group, &$url);
+ return $this->onStartUserGroupPermalink($group, $url);
}
function onStartUserGroupPermalink($group, &$url)
@@ -716,7 +731,7 @@ class OStatusPlugin extends Plugin
$act->object = $act->actor;
while ($oprofile->fetch()) {
- $oprofile->notifyDeferred($act);
+ $oprofile->notifyDeferred($act, $profile);
}
return true;