]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - plugins/RSSCloud/RSSCloudPlugin.php
Merge remote branch 'gitorious/1.0.x' into 1.0.x
[quix0rs-gnu-social.git] / plugins / RSSCloud / RSSCloudPlugin.php
index 9f444c8bba0ca5482363ca612b242ec6eabbe43a..7d9c39a67da139c9fa093b63e4d7898a6ca266e6 100644 (file)
@@ -100,12 +100,12 @@ class RSSCloudPlugin extends Plugin
      *
      * Hook for RouterInitialized event.
      *
-     * @param Mapper &$m URL parser and mapper
+     * @param Mapper $m URL parser and mapper
      *
      * @return boolean hook return
      */
 
-    function onRouterInitialized(&$m)
+    function onRouterInitialized($m)
     {
         $m->connect('/main/rsscloud/request_notify',
                     array('action' => 'RSSCloudRequestNotify'));
@@ -192,24 +192,12 @@ class RSSCloudPlugin extends Plugin
 
     function onStartEnqueueNotice($notice, &$transports)
     {
-        array_push($transports, 'rsscloud');
+        if ($notice->isLocal()) {
+            array_push($transports, 'rsscloud');
+        }
         return true;
     }
 
-    /**
-     * Determine whether the notice was locally created
-     *
-     * @param Notice $notice the notice in question
-     *
-     * @return boolean locality
-     */
-
-    function _isLocal($notice)
-    {
-        return ($notice->is_local == Notice::LOCAL_PUBLIC ||
-                $notice->is_local == Notice::LOCAL_NONPUBLIC);
-    }
-
     /**
      * Create the rsscloud_subscription table if it's not
      * already in the DB
@@ -221,19 +209,16 @@ class RSSCloudPlugin extends Plugin
     {
         $schema = Schema::get();
         $schema->ensureTable('rsscloud_subscription',
-                             array(new ColumnDef('subscribed', 'integer',
-                                                 null, false, 'PRI'),
-                                   new ColumnDef('url', 'varchar',
-                                                 '255', false, 'PRI'),
-                                   new ColumnDef('failures', 'integer',
-                                                 null, false, null, 0),
-                                   new ColumnDef('created', 'datetime',
-                                                 null, false),
-                                   new ColumnDef('modified', 'timestamp',
-                                                 null, false, null,
-                                                 'CURRENT_TIMESTAMP',
-                                                 'on update CURRENT_TIMESTAMP')
-                                   ));
+            array(
+                'fields' => array(
+                    'subscribed' => array('type' => 'int', 'not null' => true),
+                    'url' => array('type' => 'varchar', 'length' => '255', 'not null' => true),
+                    'failures' => array('type' => 'int', 'not null' => true, 'default' => 0),
+                    'created' => array('type' => 'datetime', 'not null' => true),
+                    'modified' => array('type' => 'timestamp', 'not null' => true),
+                ),
+                'primary key' => array('subscribed', 'url'),
+            ));
          return true;
     }
 
@@ -259,10 +244,9 @@ class RSSCloudPlugin extends Plugin
                             'rawdescription' =>
                             _m('The RSSCloud plugin enables your StatusNet instance to publish ' .
                                'real-time updates for profile RSS feeds using the ' .
-                               '<a href="http://rsscloud.org/">RSSCloud protocol</a>".'));
+                               '<a href="http://rsscloud.org/">RSSCloud protocol</a>.'));
 
         return true;
     }
 
 }
-