X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=plugins%2FOrbited%2FOrbitedPlugin.php;h=e788c464e605f42b36d90f3fa9578ad774d13f97;hb=e45c784451f9a63e4cf87255d13ed90d568fb621;hp=ba87b266a03b2588cb62988531838dce483693c0;hpb=39598582d90eab2a8abaf2ca01bcad6cb09d2c73;p=quix0rs-gnu-social.git diff --git a/plugins/Orbited/OrbitedPlugin.php b/plugins/Orbited/OrbitedPlugin.php index ba87b266a0..e788c464e6 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(&$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; + } }