OStatus and XMPP plugins now inform Nodeinfo plugins about their activity
This commit is contained in:
parent
e6667db0cd
commit
e186ad57d0
|
@ -136,23 +136,9 @@ class Nodeinfo_2_0Action extends ApiAction
|
|||
|
||||
public function getProtocols()
|
||||
{
|
||||
$oStatusEnabled = array_key_exists('ostatus', $this->plugins);
|
||||
$xmppEnabled = (array_key_exists('xmpp', $this->plugins) && common_config('xmpp', 'enabled')) ? true : false;
|
||||
$protocols = array();
|
||||
$protocols = [];
|
||||
|
||||
if (Event::handle('StartNodeInfoProtocols', array(&$protocols))) {
|
||||
// Until the OStatus and XMPP plugins handle this themselves,
|
||||
// try to figure out if they're enabled ourselves.
|
||||
|
||||
if ($oStatusEnabled) {
|
||||
$protocols[] = 'ostatus';
|
||||
}
|
||||
|
||||
if ($xmppEnabled) {
|
||||
$protocols[] = 'xmpp';
|
||||
}
|
||||
}
|
||||
Event::handle('EndNodeInfoProtocols', array(&$protocols));
|
||||
Event::handle('NodeInfoProtocols', array(&$protocols));
|
||||
|
||||
return $protocols;
|
||||
}
|
||||
|
|
|
@ -1335,6 +1335,18 @@ class OStatusPlugin extends Plugin
|
|||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Plugin Nodeinfo information
|
||||
*
|
||||
* @param array $protocols
|
||||
* @return bool hook true
|
||||
*/
|
||||
public function onNodeInfoProtocols(array &$protocols)
|
||||
{
|
||||
$protocols[] = "ostatus";
|
||||
return true;
|
||||
}
|
||||
|
||||
function onPluginVersion(array &$versions)
|
||||
{
|
||||
$versions[] = array('name' => 'OStatus',
|
||||
|
|
|
@ -426,6 +426,18 @@ class XmppPlugin extends ImPlugin
|
|||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Plugin Nodeinfo information
|
||||
*
|
||||
* @param array $protocols
|
||||
* @return bool hook true
|
||||
*/
|
||||
public function onNodeInfoProtocols(array &$protocols)
|
||||
{
|
||||
$protocols[] = "xmpp";
|
||||
return true;
|
||||
}
|
||||
|
||||
function onPluginVersion(array &$versions)
|
||||
{
|
||||
$versions[] = array('name' => 'XMPP',
|
||||
|
|
Loading…
Reference in New Issue
Block a user