]> git.mxchange.org Git - friendica.git/commitdiff
Our user feeds now look more like OStatus
authorMichael <heluecht@pirati.ca>
Tue, 22 Aug 2017 10:18:07 +0000 (10:18 +0000)
committerMichael <heluecht@pirati.ca>
Tue, 22 Aug 2017 10:18:07 +0000 (10:18 +0000)
mod/_well_known.php
mod/dfrn_poll.php
mod/xrd.php

index 45c1da494cc785da79f753ea3546a6705c1847ff..d75f43fbe0fc76bfb7859c5e1bb9696b1bf66430 100644 (file)
@@ -5,6 +5,7 @@ use Friendica\Core\Config;
 
 require_once("mod/hostxrd.php");
 require_once("mod/nodeinfo.php");
+require_once("mod/xrd.php");
 
 function _well_known_init(App $a) {
        if ($a->argc > 1) {
@@ -18,6 +19,9 @@ function _well_known_init(App $a) {
                        case "nodeinfo":
                                nodeinfo_wellknown($a);
                                break;
+                       case "webfinger":
+                               xrd_init($a);
+                               break;
                }
        }
        http_status_exit(404);
index ba845e41f42344dc1e9eee146c5fdb96079603b6..f02539b0053c7f49b95661488270b724fd2052b7 100644 (file)
@@ -5,6 +5,7 @@ use Friendica\App;
 require_once('include/items.php');
 require_once('include/auth.php');
 require_once('include/dfrn.php');
+require_once('include/ostatus.php');
 
 function dfrn_poll_init(App $a) {
        $dfrn_id         = ((x($_GET,'dfrn_id'))         ? $_GET['dfrn_id']              : '');
@@ -17,6 +18,14 @@ function dfrn_poll_init(App $a) {
        $perm            = ((x($_GET,'perm'))            ? $_GET['perm']                 : 'r');
        $quiet                   = ((x($_GET,'quiet'))                   ? true                                                  : false);
 
+       // Possibly it is an OStatus compatible server that requests a user feed
+       if (($a->argc > 1) && ($dfrn_id == '') && !strstr($_SERVER["HTTP_USER_AGENT"], 'Friendica')) {
+               $nickname = $a->argv[1];
+               header("Content-type: application/atom+xml");
+               echo ostatus::feed($a, $nickname, $last_update);
+               killme();
+       }
+
        $direction = (-1);
 
 
index bfb889258cf5193ae21e4e4d8eb67df14a374871..acde4d9f359518a36f5bf234d12a851dd02be188 100644 (file)
@@ -8,6 +8,10 @@ function xrd_init(App $a) {
 
        $uri = urldecode(notags(trim($_GET['uri'])));
 
+       if ($uri == "") {
+               $uri = urldecode(notags(trim($_GET['resource'])));
+       }
+
        if(substr($uri,0,4) === 'http') {
                $acct = false;
                $name = basename($uri);