]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - plugins/Orbited/OrbitedPlugin.php
Introduced common_location_shared() to check if location sharing is always,
[quix0rs-gnu-social.git] / plugins / Orbited / OrbitedPlugin.php
index 8af71af747246419595971f272d756128673d795..5abd27e9ee52854b094c87b92a90cc0888f7c5c3 100644 (file)
@@ -27,7 +27,7 @@
  * @link      http://laconi.ca/
  */
 
-if (!defined('LACONICA')) {
+if (!defined('GNUSOCIAL') && !defined('STATUSNET')) {
     exit(1);
 }
 
@@ -45,7 +45,6 @@ require_once INSTALLDIR.'/plugins/Realtime/RealtimePlugin.php';
  * @license  http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
  * @link     http://laconi.ca/
  */
-
 class OrbitedPlugin extends RealtimePlugin
 {
     public $webserver   = null;
@@ -77,9 +76,9 @@ class OrbitedPlugin extends RealtimePlugin
         $root = 'http://'.$server.(($port == 80) ? '':':'.$port);
 
         $scripts[] = $root.'/static/Orbited.js';
-        $scripts[] = 'plugins/Orbited/orbitedextra.js';
+        $scripts[] = $this->path('js/orbitedextra.js');
         $scripts[] = $root.'/static/protocols/stomp/stomp.js';
-        $scripts[] = 'plugins/Orbited/orbitedupdater.js';
+        $scripts[] = $this->path('js/orbitedupdater.js');
 
         return $scripts;
     }
@@ -107,7 +106,8 @@ class OrbitedPlugin extends RealtimePlugin
             $this->log(LOG_INFO, "Connected.");
         } else {
             $this->log(LOG_ERR, 'Failed to connect to queue server');
-            throw new ServerException('Failed to connect to queue server');
+            // TRANS: Server exception thrown when no connection can be made to a queue server.
+            throw new ServerException(_m('Failed to connect to queue server.'));
         }
     }
 
@@ -117,7 +117,7 @@ class OrbitedPlugin extends RealtimePlugin
                                    json_encode($message));
 
         return $result;
-        // TODO: parse and deal with result
+        // @todo Parse and deal with result.
     }
 
     function _disconnect()
@@ -151,4 +151,23 @@ class OrbitedPlugin extends RealtimePlugin
         $port   = $this->_getStompPort();
         return "tcp://$server:$port/";
     }
+
+    /**
+     * Add our version information to output
+     *
+     * @param array &$versions Array of version-data arrays
+     *
+     * @return boolean hook value
+     */
+    function onPluginVersion(array &$versions)
+    {
+        $versions[] = array('name' => 'Orbited',
+                            'version' => GNUSOCIAL_VERSION,
+                            'author' => 'Evan Prodromou',
+                            'homepage' => 'http://status.net/wiki/Plugin:Orbited',
+                            'rawdescription' =>
+                            // TRANS: Plugin description.
+                            _m('Plugin to make updates using Orbited and STOMP.'));
+        return true;
+    }
 }