From 3903a37b647aea788ebc64b54b3225843fc9886e Mon Sep 17 00:00:00 2001 From: the-djmaze <> Date: Tue, 25 Oct 2022 17:06:00 +0200 Subject: [PATCH] Make calendar integration optional for #569 Due to bug in Nextcloud Calendar --- plugins/nextcloud/index.php | 12 ++++++++---- plugins/nextcloud/js/message.js | 9 ++++++--- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/plugins/nextcloud/index.php b/plugins/nextcloud/index.php index d629bbffb..096a254dd 100644 --- a/plugins/nextcloud/index.php +++ b/plugins/nextcloud/index.php @@ -4,8 +4,8 @@ class NextcloudPlugin extends \RainLoop\Plugins\AbstractPlugin { const NAME = 'Nextcloud', - VERSION = '2.6', - RELEASE = '2022-10-21', + VERSION = '2.7', + RELEASE = '2022-10-25', CATEGORY = 'Integrations', DESCRIPTION = 'Integrate with Nextcloud v20+', REQUIRED = '2.19.0'; @@ -170,7 +170,8 @@ class NextcloudPlugin extends \RainLoop\Plugins\AbstractPlugin // $sWebDAV = \OCP\Util::linkToRemote('dav'); $aResult['Nextcloud'] = [ 'UID' => $sUID, - 'WebDAV' => $sWebDAV + 'WebDAV' => $sWebDAV, + 'CalDAV' => $this->Config()->Get('plugin', 'calendar', false) // 'WebDAV_files' => $sWebDAV . '/files/' . $sUID ]; if (empty($aResult['Auth'])) { @@ -214,7 +215,10 @@ class NextcloudPlugin extends \RainLoop\Plugins\AbstractPlugin return array( \RainLoop\Plugins\Property::NewInstance('suggestions')->SetLabel('Suggestions') ->SetType(\RainLoop\Enumerations\PluginPropertyType::BOOL) - ->SetDefaultValue(true) + ->SetDefaultValue(true), + \RainLoop\Plugins\Property::NewInstance('calendar')->SetLabel('Enable "Put ICS in calendar"') + ->SetType(\RainLoop\Enumerations\PluginPropertyType::BOOL) + ->SetDefaultValue(false) ); } diff --git a/plugins/nextcloud/js/message.js b/plugins/nextcloud/js/message.js index 8bde31d69..4a46fd0c7 100644 --- a/plugins/nextcloud/js/message.js +++ b/plugins/nextcloud/js/message.js @@ -95,9 +95,12 @@ + '')); // https://github.com/nextcloud/calendar/issues/4684 -// attachmentsControls.append(Element.fromHTML('' -// + '' -// + '')); + let cfg = rl.settings.get('Nextcloud'); + if (cfg.CalDAV) { + attachmentsControls.append(Element.fromHTML('' + + '' + + '')); + } } const msgMenu = template.content.querySelector('#more-view-dropdown-id + menu');