From 3444926bc18d51f1780e50236f67b8cdbcd87f31 Mon Sep 17 00:00:00 2001 From: PhilW Date: Wed, 23 Jan 2019 18:51:02 +0000 Subject: [PATCH] some code cleanup --- README.md | 2 +- swipe.php | 14 +++++--------- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 989ae71..cbfb31e 100644 --- a/README.md +++ b/README.md @@ -85,7 +85,7 @@ The following actions are available for down swipe: *Contacts List:* The following actions are available for left/right swipe: -* `attvcard` - Attach the contact to a new message as a vCard (Requires the Roundcube Vcard_attachments plugin) +* `vcard_attachments` - Attach the contact to a new message as a vCard (Requires the Roundcube Vcard_attachments plugin) * `compose` - Compose a new message to this contact * `delete` - Delete the contact * `swipe-select` - Select/deselect the contact diff --git a/swipe.php b/swipe.php index e0258d6..e2beb07 100644 --- a/swipe.php +++ b/swipe.php @@ -57,7 +57,7 @@ class swipe extends rcube_plugin 'contactlist' => array( 'vertical' => array(), 'horizontal' => array( - 'attvcard' => 'vcard_attachments.forwardvcard', + 'vcard_attachments' => 'vcard_attachments.forwardvcard', 'compose' => 'compose', 'delete' => 'delete', 'swipe-select' => 'select' @@ -211,16 +211,12 @@ class swipe extends rcube_plugin else if (in_array($action, $this->disabled_actions) || in_array($this->rcube->task . $action, $this->disabled_actions)) { $result = false; } - else if ($action == 'archive' && !$this->rcube->output->env['archive_folder']) { - // archive plugin - $result = false; - } - else if ($action == 'markasjunk' && !in_array('markasjunk', $this->laoded_plugins)) { - // markasjunk plugin + else if (in_array($action, array('markasjunk', 'vcard_attachments')) && !in_array($action, $this->laoded_plugins)) { + // check plugin is enabled $result = false; } - else if ($action == 'attvcard' && !in_array('vcard_attachments', $this->laoded_plugins)) { - // vcard_attachments plugin + else if ($action == 'archive' && !$this->rcube->output->env['archive_folder']) { + // archive plugin $result = false; }