]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - actions/subscriptions.php
Port autocomplete from tagInput to jQuery UI, send Last-Modified header and look...
[quix0rs-gnu-social.git] / actions / subscriptions.php
index ba2f67f2da8e59e18012a27f5032eee8666b4039..cfe2b5683a830673f7bda83c877ef768a2ac78a5 100644 (file)
@@ -106,8 +106,6 @@ class SubscriptionsAction extends GalleryAction
                 }
             }
 
-            $subscriptions->free();
-
             $this->pagination($this->page > 1, $cnt > PROFILES_PER_PAGE,
                               $this->page, 'subscriptions',
                               array('nickname' => $this->user->nickname));
@@ -163,6 +161,21 @@ class SubscriptionsAction extends GalleryAction
         $cloud2 = new SubscriptionsPeopleSelfTagCloudSection($this);
         $cloud2->show();
     }
+
+    /**
+     * Link to feeds of subscriptions
+     *
+     * @return array of Feed objects
+     */
+    function getFeeds()
+    {
+        return array(new Feed(Feed::ATOM,
+                              common_local_url('AtomPubSubscriptionFeed',
+                                               array('subscriber' => $this->profile->id)),
+                              // TRANS: Atom feed title. %s is a profile nickname.
+                              sprintf(_('Subscription feed for %s (Atom)'),
+                                      $this->profile->nickname)));
+    }
 }
 
 // XXX SubscriptionsList and SubscriptionList are dangerously close
@@ -202,7 +215,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;
         }
 
@@ -212,7 +227,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',
@@ -223,7 +238,7 @@ class SubscriptionsListItem extends SubscriptionListItem
 
             $this->out->element('input', $attrs);
             // TRANS: Checkbox label for enabling Jabber messages for a profile in a subscriptions list.
-            $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);
         }