mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-09-05 15:37:03 +03:00
Cleanup Filters/Sieve capa
This commit is contained in:
parent
a9785bc39c
commit
bde4d147bb
9 changed files with 9 additions and 35 deletions
|
|
@ -32,7 +32,6 @@ export const Capa = {
|
||||||
Themes: 'THEMES',
|
Themes: 'THEMES',
|
||||||
UserBackground: 'USER_BACKGROUND',
|
UserBackground: 'USER_BACKGROUND',
|
||||||
Sieve: 'SIEVE',
|
Sieve: 'SIEVE',
|
||||||
Filters: 'FILTERS',
|
|
||||||
AttachmentThumbnails: 'ATTACHMENT_THUMBNAILS',
|
AttachmentThumbnails: 'ATTACHMENT_THUMBNAILS',
|
||||||
Templates: 'TEMPLATES',
|
Templates: 'TEMPLATES',
|
||||||
AutoLogout: 'AUTOLOGOUT',
|
AutoLogout: 'AUTOLOGOUT',
|
||||||
|
|
|
||||||
|
|
@ -236,7 +236,7 @@ export class FilterModel extends AbstractModel {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
filter.actionKeep(1 == json.Keep);
|
filter.actionKeep(0 != json.Keep);
|
||||||
filter.actionNoStop(0 == json.Stop);
|
filter.actionNoStop(0 == json.Stop);
|
||||||
filter.actionMarkAsRead(1 == json.MarkAsRead);
|
filter.actionMarkAsRead(1 == json.MarkAsRead);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -8,8 +8,6 @@ export const CapaAdminStore = {
|
||||||
this.additionalAccounts(capa(Capa.AdditionalAccounts));
|
this.additionalAccounts(capa(Capa.AdditionalAccounts));
|
||||||
this.identities(capa(Capa.Identities));
|
this.identities(capa(Capa.Identities));
|
||||||
this.attachmentThumbnails(capa(Capa.AttachmentThumbnails));
|
this.attachmentThumbnails(capa(Capa.AttachmentThumbnails));
|
||||||
this.sieve(capa(Capa.Sieve));
|
|
||||||
this.filters(capa(Capa.Filters));
|
|
||||||
this.themes(capa(Capa.Themes));
|
this.themes(capa(Capa.Themes));
|
||||||
this.userBackground(capa(Capa.UserBackground));
|
this.userBackground(capa(Capa.UserBackground));
|
||||||
this.openPGP(capa(Capa.OpenPGP));
|
this.openPGP(capa(Capa.OpenPGP));
|
||||||
|
|
@ -23,8 +21,6 @@ ko.addObservablesTo(CapaAdminStore, {
|
||||||
additionalAccounts: false,
|
additionalAccounts: false,
|
||||||
identities: false,
|
identities: false,
|
||||||
attachmentThumbnails: false,
|
attachmentThumbnails: false,
|
||||||
sieve: false,
|
|
||||||
filters: false,
|
|
||||||
themes: true,
|
themes: true,
|
||||||
userBackground: false,
|
userBackground: false,
|
||||||
openPGP: false,
|
openPGP: false,
|
||||||
|
|
|
||||||
|
|
@ -2,8 +2,6 @@ import { StorageResultType, Notification } from 'Common/Enums';
|
||||||
import { pInt, pString } from 'Common/Utils';
|
import { pInt, pString } from 'Common/Utils';
|
||||||
import { i18n } from 'Common/Translator';
|
import { i18n } from 'Common/Translator';
|
||||||
|
|
||||||
import { CapaAdminStore } from 'Stores/Admin/Capa';
|
|
||||||
|
|
||||||
import Remote from 'Remote/Admin/Fetch';
|
import Remote from 'Remote/Admin/Fetch';
|
||||||
|
|
||||||
import { decorateKoCommands } from 'Knoin/Knoin';
|
import { decorateKoCommands } from 'Knoin/Knoin';
|
||||||
|
|
@ -56,8 +54,6 @@ class DomainPopupView extends AbstractViewPopup {
|
||||||
});
|
});
|
||||||
|
|
||||||
this.addComputables({
|
this.addComputables({
|
||||||
allowSieve: () => CapaAdminStore.filters() && CapaAdminStore.sieve(),
|
|
||||||
|
|
||||||
headerText: () => {
|
headerText: () => {
|
||||||
const name = this.name(),
|
const name = this.name(),
|
||||||
aliasName = this.aliasName();
|
aliasName = this.aliasName();
|
||||||
|
|
@ -85,14 +81,13 @@ class DomainPopupView extends AbstractViewPopup {
|
||||||
|
|
||||||
domainIsComputed: () => {
|
domainIsComputed: () => {
|
||||||
const usePhpMail = this.smtpPhpMail(),
|
const usePhpMail = this.smtpPhpMail(),
|
||||||
allowSieve = this.allowSieve(),
|
|
||||||
useSieve = this.useSieve();
|
useSieve = this.useSieve();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
this.name() &&
|
this.name() &&
|
||||||
this.imapServer() &&
|
this.imapServer() &&
|
||||||
this.imapPort() &&
|
this.imapPort() &&
|
||||||
(allowSieve && useSieve ? this.sieveServer() && this.sievePort() : true) &&
|
(useSieve ? this.sieveServer() && this.sievePort() : true) &&
|
||||||
((this.smtpServer() && this.smtpPort()) || usePhpMail)
|
((this.smtpServer() && this.smtpPort()) || usePhpMail)
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -2077,11 +2077,8 @@ class Actions
|
||||||
$aResult[] = Enumerations\Capa::OPEN_PGP;
|
$aResult[] = Enumerations\Capa::OPEN_PGP;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($oConfig->Get('capa', 'filters', false)) {
|
if ($bAdmin || ($oAccount && $oAccount->Domain()->UseSieve())) {
|
||||||
$aResult[] = Enumerations\Capa::FILTERS;
|
$aResult[] = Enumerations\Capa::SIEVE;
|
||||||
if ($bAdmin || ($oAccount && $oAccount->Domain()->UseSieve())) {
|
|
||||||
$aResult[] = Enumerations\Capa::SIEVE;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -18,22 +18,11 @@ trait Filters
|
||||||
{
|
{
|
||||||
$oAccount = $this->getAccountFromToken();
|
$oAccount = $this->getAccountFromToken();
|
||||||
|
|
||||||
if (!$this->GetCapa(false, Capa::FILTERS, $oAccount))
|
if (!$this->GetCapa(false, Capa::SIEVE, $oAccount))
|
||||||
{
|
{
|
||||||
return $this->FalseResponse(__FUNCTION__);
|
return $this->FalseResponse(__FUNCTION__);
|
||||||
}
|
}
|
||||||
|
|
||||||
$aFakeFilters = null;
|
|
||||||
|
|
||||||
$this->Plugins()
|
|
||||||
->RunHook('filter.filters-fake', array($oAccount, &$aFakeFilters))
|
|
||||||
;
|
|
||||||
|
|
||||||
if ($aFakeFilters)
|
|
||||||
{
|
|
||||||
return $this->DefaultResponse(__FUNCTION__, $aFakeFilters);
|
|
||||||
}
|
|
||||||
|
|
||||||
return $this->DefaultResponse(__FUNCTION__, $this->FiltersProvider()->Load($oAccount));
|
return $this->DefaultResponse(__FUNCTION__, $this->FiltersProvider()->Load($oAccount));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -44,7 +33,7 @@ trait Filters
|
||||||
{
|
{
|
||||||
$oAccount = $this->getAccountFromToken();
|
$oAccount = $this->getAccountFromToken();
|
||||||
|
|
||||||
if (!$this->GetCapa(false, Capa::FILTERS, $oAccount)) {
|
if (!$this->GetCapa(false, Capa::SIEVE, $oAccount)) {
|
||||||
return $this->FalseResponse(__FUNCTION__);
|
return $this->FalseResponse(__FUNCTION__);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -79,7 +68,7 @@ trait Filters
|
||||||
{
|
{
|
||||||
$oAccount = $this->getAccountFromToken();
|
$oAccount = $this->getAccountFromToken();
|
||||||
|
|
||||||
if (!$this->GetCapa(false, Capa::FILTERS, $oAccount)) {
|
if (!$this->GetCapa(false, Capa::SIEVE, $oAccount)) {
|
||||||
return $this->FalseResponse(__FUNCTION__);
|
return $this->FalseResponse(__FUNCTION__);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -95,7 +84,7 @@ trait Filters
|
||||||
{
|
{
|
||||||
$oAccount = $this->getAccountFromToken();
|
$oAccount = $this->getAccountFromToken();
|
||||||
|
|
||||||
if (!$this->GetCapa(false, Capa::FILTERS, $oAccount)) {
|
if (!$this->GetCapa(false, Capa::SIEVE, $oAccount)) {
|
||||||
return $this->FalseResponse(__FUNCTION__);
|
return $this->FalseResponse(__FUNCTION__);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -186,7 +186,6 @@ class Application extends \RainLoop\Config\AbstractConfig
|
||||||
'reload' => array(true),
|
'reload' => array(true),
|
||||||
'search' => array(true),
|
'search' => array(true),
|
||||||
'search_adv' => array(true),
|
'search_adv' => array(true),
|
||||||
'filters' => array(true),
|
|
||||||
'x-templates' => array(false),
|
'x-templates' => array(false),
|
||||||
'dangerous_actions' => array(true),
|
'dangerous_actions' => array(true),
|
||||||
'message_actions' => array(true),
|
'message_actions' => array(true),
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,6 @@ class Capa
|
||||||
const THEMES = 'THEMES';
|
const THEMES = 'THEMES';
|
||||||
const USER_BACKGROUND = 'USER_BACKGROUND';
|
const USER_BACKGROUND = 'USER_BACKGROUND';
|
||||||
const SIEVE = 'SIEVE';
|
const SIEVE = 'SIEVE';
|
||||||
const FILTERS = 'FILTERS';
|
|
||||||
const ATTACHMENT_THUMBNAILS = 'ATTACHMENT_THUMBNAILS';
|
const ATTACHMENT_THUMBNAILS = 'ATTACHMENT_THUMBNAILS';
|
||||||
const ADDITIONAL_ACCOUNTS = 'ADDITIONAL_ACCOUNTS';
|
const ADDITIONAL_ACCOUNTS = 'ADDITIONAL_ACCOUNTS';
|
||||||
const IDENTITIES = 'IDENTITIES';
|
const IDENTITIES = 'IDENTITIES';
|
||||||
|
|
|
||||||
|
|
@ -78,7 +78,7 @@
|
||||||
</div>
|
</div>
|
||||||
<br />
|
<br />
|
||||||
<br />
|
<br />
|
||||||
<div class="row" data-bind="visible: allowSieve">
|
<div class="row">
|
||||||
<div class="span5">
|
<div class="span5">
|
||||||
<span data-bind="command: sieveCommand">
|
<span data-bind="command: sieveCommand">
|
||||||
<i class="icon-filter"></i>
|
<i class="icon-filter"></i>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue