X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=plugins%2FOStatus%2FOStatusPlugin.php;h=3e9a0c58d6cd539ddcff4fd24b34b72350b65200;hb=35b0a9e3aea61a51b48c261c9b28f2cb2a64826d;hp=d877dd37c6fe55be1c78ec2cde9808ec58766c6c;hpb=a1d064129a9b8ae5bbd739885db2180f08554a55;p=quix0rs-gnu-social.git diff --git a/plugins/OStatus/OStatusPlugin.php b/plugins/OStatus/OStatusPlugin.php index d877dd37c6..3e9a0c58d6 100644 --- a/plugins/OStatus/OStatusPlugin.php +++ b/plugins/OStatus/OStatusPlugin.php @@ -28,8 +28,6 @@ if (!defined('GNUSOCIAL')) { exit(1); } -set_include_path(get_include_path() . PATH_SEPARATOR . dirname(__FILE__) . '/extlib/phpseclib'); - class OStatusPlugin extends Plugin { /** @@ -83,18 +81,6 @@ class OStatusPlugin extends Plugin return true; } - public function onAutoload($cls) - { - if (mb_substr($cls, 0, 10) === 'phpseclib\\') { - // These are saved under extlib/phpseclib with \ as /, - // phpseclib has already been added to our include_path - require_once str_replace('\\', '/', str_replace('phpseclib\\', '', $cls) . '.php'); - return false; - } - - return parent::onAutoload($cls); - } - /** * Set up queue handlers for outgoing hub pushes * @param QueueManager $qm @@ -1329,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 @@ -1421,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');