]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Use presence of IM plugins to decide if "IM" options should be available
authorCraig Andrews <candrews@integralblue.com>
Wed, 16 Jun 2010 20:00:54 +0000 (16:00 -0400)
committerCraig Andrews <candrews@integralblue.com>
Wed, 16 Jun 2010 20:00:54 +0000 (16:00 -0400)
actions/subscriptions.php
lib/connectsettingsaction.php

index 7b10b3425bd7a6957b3f4cce1a6a49b7b1640cba..da563a218f06a730aceacfeff31b6894a63cb8f0 100644 (file)
@@ -185,7 +185,9 @@ class SubscriptionsListItem extends SubscriptionListItem
             return;
         }
 
-        if (!common_config('xmpp', 'enabled') && !common_config('sms', 'enabled')) {
+        $transports = array();
+        Event::handle('GetImTransports', array(&$transports));
+        if (!$transports && !common_config('sms', 'enabled')) {
             return;
         }
 
@@ -195,7 +197,7 @@ class SubscriptionsListItem extends SubscriptionListItem
                                           'action' => common_local_url('subedit')));
         $this->out->hidden('token', common_session_token());
         $this->out->hidden('profile', $this->profile->id);
-        if (common_config('xmpp', 'enabled')) {
+        if ($transports) {
             $attrs = array('name' => 'jabber',
                            'type' => 'checkbox',
                            'class' => 'checkbox',
@@ -205,7 +207,7 @@ class SubscriptionsListItem extends SubscriptionListItem
             }
 
             $this->out->element('input', $attrs);
-            $this->out->element('label', array('for' => 'jabber-'.$this->profile->id), _('Jabber'));
+            $this->out->element('label', array('for' => 'jabber-'.$this->profile->id), _('IM'));
         } else {
             $this->out->hidden('jabber', $sub->jabber);
         }
index c3a88be552bb37466892ac105833ad6ddebf9f70..5d62fc56b3e9e868a2ff6f6d1dfa9d4a87e72588 100644 (file)
@@ -105,7 +105,9 @@ class ConnectSettingsNav extends Widget
 
             # action => array('prompt', 'title')
             $menu = array();
-            if (Event::handle('GetImTransports', array(&$transports))) {
+            $transports = array();
+            Event::handle('GetImTransports', array(&$transports));
+            if ($transports) {
                 $menu['imsettings'] =
                   array(_('IM'),
                         _('Updates by instant messenger (IM)'));