Skip to content

Commit

Permalink
Make calendar integration optional for #569
Browse files Browse the repository at this point in the history
Due to bug in Nextcloud Calendar
  • Loading branch information
the-djmaze committed Oct 25, 2022
1 parent 4fa931f commit 3903a37
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 7 deletions.
12 changes: 8 additions & 4 deletions plugins/nextcloud/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -170,7 +170,8 @@ public function FilterAppData($bAdmin, &$aResult) : void
// $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'])) {
Expand Down Expand Up @@ -214,7 +215,10 @@ protected function configMapping() : array
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)
);
}

Expand Down
9 changes: 6 additions & 3 deletions plugins/nextcloud/js/message.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,12 @@
+ '</span>'));

// https://github.com/nextcloud/calendar/issues/4684
// attachmentsControls.append(Element.fromHTML('<span data-bind="visible: nextcloudICS" data-icon="📅">'
// + '<span class="g-ui-link" data-bind="click: nextcloudSaveICS" data-i18n="NEXTCLOUD/SAVE_ICS"></span>'
// + '</span>'));
let cfg = rl.settings.get('Nextcloud');
if (cfg.CalDAV) {
attachmentsControls.append(Element.fromHTML('<span data-bind="visible: nextcloudICS" data-icon="📅">'
+ '<span class="g-ui-link" data-bind="click: nextcloudSaveICS" data-i18n="NEXTCLOUD/SAVE_ICS"></span>'
+ '</span>'));
}
}

const msgMenu = template.content.querySelector('#more-view-dropdown-id + menu');
Expand Down

0 comments on commit 3903a37

Please sign in to comment.