diff options
author | sualko <klaus@jsxc.org> | 2019-08-20 17:12:23 +0300 |
---|---|---|
committer | sualko <klaus@jsxc.org> | 2019-08-20 17:20:28 +0300 |
commit | 162a138569a638e48894f11e32bdf40604dc3bd1 (patch) | |
tree | ab1feb754ca029c250281fb4fa89720b88b876c9 /appinfo | |
parent | 768ac960ada38cf932d986e899682c1f59d51007 (diff) | |
parent | 9ca1d903bc86a9abade837026499353e1f93fa07 (diff) |
Merge remote-tracking branch 'origin/master' into jsxc-next
Diffstat (limited to 'appinfo')
-rwxr-xr-x | appinfo/app.php | 2 | ||||
-rw-r--r-- | appinfo/application.php | 30 | ||||
-rwxr-xr-x | appinfo/info.xml | 4 | ||||
-rw-r--r-- | appinfo/register_command.php | 3 |
4 files changed, 26 insertions, 13 deletions
diff --git a/appinfo/app.php b/appinfo/app.php index 7815bef..b2ccb6d 100755 --- a/appinfo/app.php +++ b/appinfo/app.php @@ -77,7 +77,7 @@ if(!$apiSecret) { $config->setAppValue('ojsxc', Config::API_SECRET, $apiSecret); } -if (Application::getServerType() === 'internal') { +if (Application::getServerType() === Application::INTERNAL) { Hooks::register(); } diff --git a/appinfo/application.php b/appinfo/application.php index 0c283b9..e018331 100644 --- a/appinfo/application.php +++ b/appinfo/application.php @@ -2,12 +2,14 @@ namespace OCA\OJSXC\AppInfo; +use OCA\DAV\Server; use OCA\OJSXC\Controller\ManagedServerController; use OCA\OJSXC\Controller\SettingsController; use OCA\OJSXC\Controller\ExternalApiController; use OCA\OJSXC\Controller\JavascriptController; use OCA\OJSXC\Middleware\ExternalApiMiddleware; use OCA\OJSXC\Command\RefreshRoster; +use OCA\OJSXC\Command\ServerSharing; use OCA\OJSXC\Controller\HttpBindController; use OCA\OJSXC\Db\IQRosterPushMapper; use OCA\OJSXC\Db\MessageMapper; @@ -67,7 +69,7 @@ class Application extends App { return new HttpBindController( $c->query('AppName'), $c->query('Request'), - $c->query('OJSXC_UserId'), + $c->query('UserId'), $c->query('StanzaMapper'), $c->query('IQHandler'), $c->query('MessageHandler'), @@ -172,7 +174,7 @@ class Application extends App { return new PresenceMapper( $container->getServer()->getDatabaseConnection(), $c->query('Host'), - $c->query('OJSXC_UserId'), + $c->query('UserId'), $c->query('MessageMapper'), $c->query('NewContentContainer'), self::$config['polling']['timeout'], @@ -186,7 +188,7 @@ class Application extends App { */ $container->registerService('IQHandler', function(IContainer $c) { return new IQ( - $c->query('OJSXC_UserId'), + $c->query('UserId'), $c->query('Host'), $c->query('OCP\IUserManager'), $c->query('OCP\IConfig'), @@ -196,7 +198,7 @@ class Application extends App { $container->registerService('PresenceHandler', function(IContainer $c) { return new Presence( - $c->query('OJSXC_UserId'), + $c->query('UserId'), $c->query('Host'), $c->query('PresenceMapper'), $c->query('MessageMapper') @@ -205,7 +207,7 @@ class Application extends App { $container->registerService('MessageHandler', function(IContainer $c) { return new Message( - $c->query('OJSXC_UserId'), + $c->query('UserId'), $c->query('Host'), $c->query('MessageMapper'), $c->query('UserProvider'), @@ -219,7 +221,7 @@ class Application extends App { $container->registerService('Host', function(IContainer $c) { /** @var IRequest $request */ $request = $c->query('Request'); - return $request->getServerHost(); + return preg_replace('/:\d+$/', '', $request->getServerHost()); }); /** @@ -294,6 +296,12 @@ class Application extends App { ); }); + $container->registerService('ServerSharingCommand', function($c) { + return new ServerSharing( + $c->query('OCP\IConfig') + ); + }); + /** * A modified userID for use in OJSXC. * This is automatically made lowercase. @@ -349,7 +357,7 @@ class Application extends App { } else if ($cache->isAvailable()) { $memcache = $cache->create('ojsxc'); return new MemLock( - $c->query('OJSXC_UserId'), + $c->query('UserId'), $memcache ); } else { @@ -359,7 +367,7 @@ class Application extends App { // default return new DbLock( - $c->query('OJSXC_UserId'), + $c->query('UserId'), $c->query('OCP\IConfig'), $c->getServer()->getDatabaseConnection() ); @@ -410,7 +418,11 @@ class Application extends App { */ public static function contactsStoreApiSupported() { $version = \OCP\Util::getVersion(); - return $version[0] >= 13; + if ($version[0] >= 13 && \OC::$server->getConfig()->getAppValue('ojsxc', 'use_server_sharing_settings', 'no') === 'yes') { + // ContactsStore API is supported and feature is enabled + return true; + } + return false; } public static function getServerType() { diff --git a/appinfo/info.xml b/appinfo/info.xml index 346072c..e2f502b 100755 --- a/appinfo/info.xml +++ b/appinfo/info.xml @@ -28,7 +28,7 @@ <screenshot>https://www.jsxc.org/assets/screenshot-nextcloud-latest.png</screenshot> <dependencies> - <php min-version="5.4" max-version="7"/> + <php min-version="7" max-version="7"/> <database>sqlite</database> <database>mysql</database> <database>pgsql</database> @@ -36,7 +36,7 @@ <lib>xmlreader</lib> <lib>xmlwriter</lib> <lib>dom</lib> - <nextcloud min-version="14" max-version="15"/> + <nextcloud min-version="14" max-version="16"/> </dependencies> <repair-steps> diff --git a/appinfo/register_command.php b/appinfo/register_command.php index fb69e9f..cf616ac 100644 --- a/appinfo/register_command.php +++ b/appinfo/register_command.php @@ -5,4 +5,5 @@ use OCA\OJSXC\AppInfo\Application; $app = new Application(); /** @var Symfony\Component\Console\Application $application */ -$application->add($app->getContainer()->query('RefreshRosterCommand'));
\ No newline at end of file +$application->add($app->getContainer()->query('RefreshRosterCommand')); +$application->add($app->getContainer()->query('ServerSharingCommand')); |