]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - plugins/OStatus/OStatusPlugin.php
Handle normalized acct: URIs in ostatussub
[quix0rs-gnu-social.git] / plugins / OStatus / OStatusPlugin.php
index 9751772fdcd16c856f380a7d5cafdfa35374d800..3e9a0c58d6cd539ddcff4fd24b34b72350b65200 100644 (file)
@@ -1315,6 +1315,12 @@ class OStatusPlugin extends Plugin
     {
         if ($target->getObjectType() === ActivityObject::PERSON) {
             $this->addWebFingerPersonLinks($xrd, $target);
+        } elseif ($target->getObjectType() === ActivityObject::GROUP) {
+            $xrd->links[] = new XML_XRD_Element_Link(Discovery::UPDATESFROM,
+                            common_local_url('ApiTimelineGroup',
+                                array('id' => $target->getGroup()->getID(), 'format' => 'atom')),
+                            'application/atom+xml');
+
         }
 
         // Salmon
@@ -1407,7 +1413,12 @@ class OStatusPlugin extends Plugin
 
     public function onSalmonSlap($endpoint_uri, MagicEnvelope $magic_env, Profile $target=null)
     {
-        $envxml = $magic_env->toXML($target);
+        try {
+            $envxml = $magic_env->toXML($target);
+        } catch (Exception $e) {
+            common_log(LOG_ERR, sprintf('Could not generate Magic Envelope XML for profile id=='.$target->getID().': '.$e->getMessage()));
+            return false;
+        }
 
         $headers = array('Content-Type: application/magic-envelope+xml');