diff options
Diffstat (limited to 'plugins/OStatus/lib')
-rw-r--r-- | plugins/OStatus/lib/feeddiscovery.php | 4 | ||||
-rw-r--r-- | plugins/OStatus/lib/hubconfqueuehandler.php | 4 | ||||
-rw-r--r-- | plugins/OStatus/lib/huboutqueuehandler.php | 4 | ||||
-rw-r--r-- | plugins/OStatus/lib/hubprepqueuehandler.php | 4 | ||||
-rw-r--r-- | plugins/OStatus/lib/ostatusqueuehandler.php | 4 | ||||
-rw-r--r-- | plugins/OStatus/lib/pushinqueuehandler.php | 4 | ||||
-rw-r--r-- | plugins/OStatus/lib/salmonqueuehandler.php | 4 | ||||
-rw-r--r-- | plugins/OStatus/lib/xrdaction.php | 31 |
8 files changed, 53 insertions, 6 deletions
diff --git a/plugins/OStatus/lib/feeddiscovery.php b/plugins/OStatus/lib/feeddiscovery.php index 8a166a0be..d978cc674 100644 --- a/plugins/OStatus/lib/feeddiscovery.php +++ b/plugins/OStatus/lib/feeddiscovery.php @@ -22,7 +22,9 @@ * @maintainer Brion Vibber <brion@status.net> */ -if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); } +if (!defined('STATUSNET')) { + exit(1); +} class FeedSubBadURLException extends FeedSubException { diff --git a/plugins/OStatus/lib/hubconfqueuehandler.php b/plugins/OStatus/lib/hubconfqueuehandler.php index 8219f8420..d26c45be0 100644 --- a/plugins/OStatus/lib/hubconfqueuehandler.php +++ b/plugins/OStatus/lib/hubconfqueuehandler.php @@ -17,6 +17,10 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. */ +if (!defined('STATUSNET')) { + exit(1); +} + /** * Send a PuSH subscription verification from our internal hub. * @package Hub diff --git a/plugins/OStatus/lib/huboutqueuehandler.php b/plugins/OStatus/lib/huboutqueuehandler.php index 3ad94646e..67a9d9e36 100644 --- a/plugins/OStatus/lib/huboutqueuehandler.php +++ b/plugins/OStatus/lib/huboutqueuehandler.php @@ -17,6 +17,10 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. */ +if (!defined('STATUSNET')) { + exit(1); +} + /** * Send a raw PuSH atom update from our internal hub. * @package Hub diff --git a/plugins/OStatus/lib/hubprepqueuehandler.php b/plugins/OStatus/lib/hubprepqueuehandler.php index 0d585938f..0ed6a3ec5 100644 --- a/plugins/OStatus/lib/hubprepqueuehandler.php +++ b/plugins/OStatus/lib/hubprepqueuehandler.php @@ -17,6 +17,10 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. */ +if (!defined('STATUSNET')) { + exit(1); +} + /** * When we have a large batch of PuSH consumers, we break the data set * into smaller chunks. Enqueue final destinations... diff --git a/plugins/OStatus/lib/ostatusqueuehandler.php b/plugins/OStatus/lib/ostatusqueuehandler.php index 5e0ab46a5..d5ee0c504 100644 --- a/plugins/OStatus/lib/ostatusqueuehandler.php +++ b/plugins/OStatus/lib/ostatusqueuehandler.php @@ -17,6 +17,10 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. */ +if (!defined('STATUSNET')) { + exit(1); +} + /** * Prepare PuSH and Salmon distributions for an outgoing message. * diff --git a/plugins/OStatus/lib/pushinqueuehandler.php b/plugins/OStatus/lib/pushinqueuehandler.php index 965d04266..ec1911653 100644 --- a/plugins/OStatus/lib/pushinqueuehandler.php +++ b/plugins/OStatus/lib/pushinqueuehandler.php @@ -17,6 +17,10 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. */ +if (!defined('STATUSNET')) { + exit(1); +} + /** * Process a feed distribution POST from a PuSH hub. * @package FeedSub diff --git a/plugins/OStatus/lib/salmonqueuehandler.php b/plugins/OStatus/lib/salmonqueuehandler.php index 56d3c9eff..e70d5ff52 100644 --- a/plugins/OStatus/lib/salmonqueuehandler.php +++ b/plugins/OStatus/lib/salmonqueuehandler.php @@ -17,6 +17,10 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. */ +if (!defined('STATUSNET')) { + exit(1); +} + /** * Send a Salmon notification in the background. * @package OStatusPlugin diff --git a/plugins/OStatus/lib/xrdaction.php b/plugins/OStatus/lib/xrdaction.php index c8b5beff3..371c11080 100644 --- a/plugins/OStatus/lib/xrdaction.php +++ b/plugins/OStatus/lib/xrdaction.php @@ -22,7 +22,9 @@ * @maintainer James Walker <james@status.net> */ -if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); } +if (!defined('STATUSNET')) { + exit(1); +} class XrdAction extends Action { @@ -34,7 +36,8 @@ class XrdAction extends Action function handle() { - $nick = $this->user->nickname; + $nick = $this->user->nickname; + $profile = $this->user->getProfile(); if (empty($this->xrd)) { $xrd = new XRD(); @@ -45,10 +48,28 @@ class XrdAction extends Action if (empty($xrd->subject)) { $xrd->subject = Discovery::normalize($this->uri); } - $xrd->alias[] = $this->user->uri; + + // Possible aliases for the user + + $uris = array($this->user->uri, $profile->profileurl); + + // FIXME: Webfinger generation code should live somewhere on its own + + $path = common_config('site', 'path'); + + if (empty($path)) { + $uris[] = sprintf('acct:%s@%s', $nick, common_config('site', 'server')); + } + + foreach ($uris as $uri) { + if ($uri != $xrd->subject) { + $xrd->alias[] = $uri; + } + } + $xrd->links[] = array('rel' => Discovery::PROFILEPAGE, 'type' => 'text/html', - 'href' => $this->user->uri); + 'href' => $profile->profileurl); $xrd->links[] = array('rel' => Discovery::UPDATESFROM, 'href' => common_local_url('ApiTimelineUser', @@ -64,7 +85,7 @@ class XrdAction extends Action // XFN $xrd->links[] = array('rel' => 'http://gmpg.org/xfn/11', 'type' => 'text/html', - 'href' => $this->user->uri); + 'href' => $profile->profileurl); // FOAF $xrd->links[] = array('rel' => 'describedby', 'type' => 'application/rdf+xml', |