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)
- {
- switch ($cls) {
- case 'Crypt_AES':
- case 'Crypt_RSA':
- // Crypt_AES becomes Crypt/AES.php which is found in extlib/phpseclib/
- // which has been added to our include_path before
- require_once str_replace('_', '/', $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');