if (!defined('GNUSOCIAL')) { exit(1); }
-set_include_path(get_include_path() . PATH_SEPARATOR . dirname(__FILE__) . '/extlib/phpseclib');
-
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
{
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
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');