forked from GNUsocial/gnu-social
Moved Diaspora specific metadata to own plugin
This commit is contained in:
7
plugins/OStatus/EVENTS.txt
Normal file
7
plugins/OStatus/EVENTS.txt
Normal file
@@ -0,0 +1,7 @@
|
||||
StartAttachPubkeyToUserXRD: Runs only for XRD generation where a Magicsig exists for a Profile which is a "person".
|
||||
@param Magicsig $magicsig crypto stuff related to the profile we're representing
|
||||
@param XRD $xrd the XRD object which holds all data for the profile we're representing
|
||||
|
||||
EndAttachPubkeyToUserXRD: Runs only for XRD generation where a Magicsig exists for a Profile which is a "person". And only if StartAttachPubkeyToUserXRD didn't abort.
|
||||
@param Magicsig $magicsig crypto stuff related to the profile we're representing
|
||||
@param XRD $xrd the XRD object which holds all data for the profile we're representing
|
@@ -1315,11 +1315,14 @@ class OStatusPlugin extends Plugin
|
||||
$magicsig = Magicsig::generate($target->getUser());
|
||||
}
|
||||
|
||||
if ($magicsig instanceof Magicsig) {
|
||||
if (!$magicsig instanceof Magicsig) {
|
||||
return false; // value doesn't mean anything, just figured I'd indicate this function didn't do anything
|
||||
}
|
||||
if (Event::handle('StartAttachPubkeyToUserXRD', array($magicsig, $xrd, $target))) {
|
||||
$xrd->links[] = new XML_XRD_Element_Link(Magicsig::PUBLICKEYREL,
|
||||
'data:application/magic-public-key,'. $magicsig->toString());
|
||||
$xrd->links[] = new XML_XRD_Element_Link(Magicsig::DIASPORA_PUBLICKEYREL,
|
||||
base64_encode($magicsig->exportPublicKey()));
|
||||
// The following event handles plugins like Diaspora which add their own version of the Magicsig pubkey
|
||||
Event::handle('EndAttachPubkeyToUserXRD', array($magicsig, $xrd, $target));
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -36,7 +36,6 @@ require_once 'Crypt/RSA.php';
|
||||
class Magicsig extends Managed_DataObject
|
||||
{
|
||||
const PUBLICKEYREL = 'magic-public-key';
|
||||
const DIASPORA_PUBLICKEYREL = 'diaspora-public-key';
|
||||
|
||||
const DEFAULT_KEYLEN = 1024;
|
||||
const DEFAULT_SIGALG = 'RSA-SHA256';
|
||||
|
Reference in New Issue
Block a user