X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=plugins%2FOrbited%2FOrbitedPlugin.php;h=5abd27e9ee52854b094c87b92a90cc0888f7c5c3;hb=53e820b46667c2f0e22ffa0a2f91e847a02f4cb8;hp=ba87b266a03b2588cb62988531838dce483693c0;hpb=650d2e2f8e47222bcc2d6aed9e284949ebdd7d8f;p=quix0rs-gnu-social.git diff --git a/plugins/Orbited/OrbitedPlugin.php b/plugins/Orbited/OrbitedPlugin.php index ba87b266a0..5abd27e9ee 100644 --- a/plugins/Orbited/OrbitedPlugin.php +++ b/plugins/Orbited/OrbitedPlugin.php @@ -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[] = common_path('plugins/Orbited/orbitedextra.js'); + $scripts[] = $this->path('js/orbitedextra.js'); $scripts[] = $root.'/static/protocols/stomp/stomp.js'; - $scripts[] = common_path('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; + } }