]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - plugins/OStatus/OStatusPlugin.php
Merge branch 'master' into testing
[quix0rs-gnu-social.git] / plugins / OStatus / OStatusPlugin.php
index 276ca1b3d0507a93c183ec174ab93887da1edd3c..b6c9fa1d4c28b2439255f1af31d6f3f657eaf482 100644 (file)
@@ -218,6 +218,9 @@ class OStatusPlugin extends Plugin
         $count = preg_match_all('/(\w+\.)*\w+@(\w+\.)*\w+(\w+\-\w+)*\.\w+/', $notice->content, $matches);
         if ($count) {
             foreach ($matches[0] as $webfinger) {
+
+                // FIXME: look up locally first
+
                 // Check to see if we've got an actual webfinger
                 $w = new Webfinger;
 
@@ -238,6 +241,8 @@ class OStatusPlugin extends Plugin
                     continue;
                 }
 
+                // FIXME: this needs to go out in a queue handler
+
                 $xml = '<?xml version="1.0" encoding="UTF-8" ?>';
                 $xml .= $notice->asAtomEntry();
 
@@ -284,4 +289,17 @@ class OStatusPlugin extends Plugin
         $action->script(common_path('plugins/OStatus/js/ostatus.js'));
         return true;
     }
+
+    function onStartNoticeSourceLink($notice, &$name, &$url, &$title)
+    {
+        if ($notice->source == 'ostatus') {
+            $bits = parse_url($notice->uri);
+            $domain = $bits['host'];
+
+            $name = $domain;
+            $url = $notice->uri;
+            $title = sprintf(_m("Sent from %s via OStatus"), $domain);
+            return false;
+        }
+    }
 }