]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - plugins/Meteor/MeteorPlugin.php
[TRANSLATION] Update license and copyright notice in translation files
[quix0rs-gnu-social.git] / plugins / Meteor / MeteorPlugin.php
index 3f963eb7328ec95952af05a2667b1ca19b00a533..432769ef27f017e94f9b4ac1d9e001c98a0e0732 100644 (file)
@@ -27,7 +27,7 @@
  * @link      http://status.net/
  */
 
-if (!defined('STATUSNET') && !defined('LACONICA')) {
+if (!defined('GNUSOCIAL') && !defined('STATUSNET')) {
     exit(1);
 }
 
@@ -44,6 +44,8 @@ require_once INSTALLDIR.'/plugins/Realtime/RealtimePlugin.php';
  */
 class MeteorPlugin extends RealtimePlugin
 {
+    const PLUGIN_VERSION = '2.0.0';
+
     public $webserver     = null;
     public $webport       = null;
     public $controlport   = null;
@@ -96,14 +98,19 @@ class MeteorPlugin extends RealtimePlugin
         } else {
                $scripts[] = 'http://'.$this->webserver.(($this->webport == 80) ? '':':'.$this->webport).'/meteor.js';
         }
-        $scripts[] = $this->path('meteorupdater.min.js');
+        $scripts[] = $this->path('js/meteorupdater.js');
         return $scripts;
     }
 
     function _updateInitialize($timeline, $user_id)
     {
         $script = parent::_updateInitialize($timeline, $user_id);
-        return $script." MeteorUpdater.init(\"$this->webserver\", $this->webport, \"{$timeline}\");";
+        $ours = sprintf("MeteorUpdater.init(%s, %s, %s, %s);",
+                        json_encode($this->webserver),
+                        json_encode($this->webport),
+                        json_encode($this->protocol),
+                        json_encode($timeline));
+        return $script." ".$ours;
     }
 
     function _connect()
@@ -155,12 +162,12 @@ class MeteorPlugin extends RealtimePlugin
         return implode('-', $path);
     }
 
-    function onPluginVersion(&$versions)
+    function onPluginVersion(array &$versions)
     {
         $versions[] = array('name' => 'Meteor',
-                            'version' => STATUSNET_VERSION,
+                            'version' => self::PLUGIN_VERSION,
                             'author' => 'Evan Prodromou',
-                            'homepage' => 'http://status.net/wiki/Plugin:Meteor',
+                            'homepage' => 'https://git.gnu.io/gnu/gnu-social/tree/master/plugins/Meteor',
                             'rawdescription' =>
                             // TRANS: Plugin description.
                             _m('Plugin to do "real time" updates using Meteor.'));