Rather than enumerating available classes, define an event that sets a
flag indicating that there's an IM plugin available. Implemented in
implugin.php, so all IM plugins that use that class should
work. Others can hook the event, too.
EndUpgrade: when ending a site upgrade; good place to do your own upgrades
+HaveIMPlugin: is there an IM plugin loaded?
+- &$haveIMPlugin: set me to true if you're loaded!
+
return true;
}
+ function onHaveImPlugin(&$haveImPlugin) {
+ $haveImPlugin = true; // set flag true (we're loaded, after all!)
+ return false; // stop looking
+ }
+
function initialize()
{
if( ! common_config('queue', 'enabled'))
Event::handle('EndAccountSettingsNav', array(&$this->action));
- if (class_exists('XmppPlugin') || class_exists('IrcPlugin') || class_exists('MsnPlugin')) {
+ $haveImPlugin = false;
+
+ Event::handle('HaveImPlugin', array(&$haveImPlugin));
+
+ if ($haveImPlugin) {
$this->action->menuItem(common_local_url('imsettings'),
// TRANS: Menu item in settings navigation panel.
_m('MENU','IM'),