mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-09-04 15:07:02 +03:00
Add IsExternal for external contact sources
Signed-off-by: Akhil <akhil@e.email>
This commit is contained in:
parent
6f61b06bbb
commit
8a4eabe699
8 changed files with 25 additions and 1 deletions
|
|
@ -4,7 +4,7 @@ import { ThemeStore } from 'Stores/Theme';
|
||||||
import { arePopupsVisible } from 'Knoin/Knoin';
|
import { arePopupsVisible } from 'Knoin/Knoin';
|
||||||
|
|
||||||
export const AppUserStore = {
|
export const AppUserStore = {
|
||||||
allowContacts: () => !!SettingsGet('contactsAllowed')
|
allowContacts: () => !!SettingsGet('contactsAllowed') && !!SettingsGet('contactsExternal')
|
||||||
};
|
};
|
||||||
|
|
||||||
addObservablesTo(AppUserStore, {
|
addObservablesTo(AppUserStore, {
|
||||||
|
|
|
||||||
|
|
@ -99,6 +99,11 @@ class KolabAddressBook implements \RainLoop\Providers\AddressBook\AddressBookInt
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function IsExternal(): bool
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
public function SetEmail(string $sEmail) : bool
|
public function SetEmail(string $sEmail) : bool
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
|
|
|
||||||
|
|
@ -33,6 +33,11 @@ class NextcloudAddressBook implements \RainLoop\Providers\AddressBook\AddressBoo
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function IsExternal(): bool
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
public function SetEmail(string $sEmail) : bool {
|
public function SetEmail(string $sEmail) : bool {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -678,6 +678,7 @@ class Actions
|
||||||
'accountSignMe' => isset($_COOKIE[self::AUTH_SIGN_ME_TOKEN_KEY]),
|
'accountSignMe' => isset($_COOKIE[self::AUTH_SIGN_ME_TOKEN_KEY]),
|
||||||
|
|
||||||
'contactsAllowed' => $this->AddressBookProvider($oAccount)->IsActive(),
|
'contactsAllowed' => $this->AddressBookProvider($oAccount)->IsActive(),
|
||||||
|
'contactsExternal' => $this->AddressBookProvider($oAccount)->IsExternal(),
|
||||||
|
|
||||||
'ViewHTML' => (bool) $oConfig->Get('defaults', 'view_html', true),
|
'ViewHTML' => (bool) $oConfig->Get('defaults', 'view_html', true),
|
||||||
'ViewImages' => $oConfig->Get('defaults', 'view_images', 'ask'),
|
'ViewImages' => $oConfig->Get('defaults', 'view_images', 'ask'),
|
||||||
|
|
|
||||||
|
|
@ -202,6 +202,7 @@ trait Accounts
|
||||||
'accountHash' => $oAccount->Hash(),
|
'accountHash' => $oAccount->Hash(),
|
||||||
'mainEmail' => \RainLoop\Api::Actions()->getMainAccountFromToken()->Email(),
|
'mainEmail' => \RainLoop\Api::Actions()->getMainAccountFromToken()->Email(),
|
||||||
'contactsAllowed' => $this->AddressBookProvider($oAccount)->IsActive(),
|
'contactsAllowed' => $this->AddressBookProvider($oAccount)->IsActive(),
|
||||||
|
'contactsExternal' => $this->AddressBookProvider($oAccount)->IsExternal(),
|
||||||
'HideUnsubscribed' => false,
|
'HideUnsubscribed' => false,
|
||||||
'UseThreads' => (bool) $oConfig->Get('defaults', 'mail_use_threads', false),
|
'UseThreads' => (bool) $oConfig->Get('defaults', 'mail_use_threads', false),
|
||||||
'ReplySameFolder' => (bool) $oConfig->Get('defaults', 'mail_reply_same_folder', false),
|
'ReplySameFolder' => (bool) $oConfig->Get('defaults', 'mail_reply_same_folder', false),
|
||||||
|
|
|
||||||
|
|
@ -25,6 +25,11 @@ class AddressBook extends AbstractProvider
|
||||||
return $this->oDriver && $this->oDriver->IsSupported();
|
return $this->oDriver && $this->oDriver->IsSupported();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function IsExternal() : bool
|
||||||
|
{
|
||||||
|
return $this->IsActive() ? $this->oDriver->IsExternal() : false;
|
||||||
|
}
|
||||||
|
|
||||||
public function Sync() : bool
|
public function Sync() : bool
|
||||||
{
|
{
|
||||||
return $this->IsActive() ? $this->oDriver->Sync() : false;
|
return $this->IsActive() ? $this->oDriver->Sync() : false;
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,8 @@ interface AddressBookInterface
|
||||||
{
|
{
|
||||||
public function IsSupported() : bool;
|
public function IsSupported() : bool;
|
||||||
|
|
||||||
|
public function IsExternal() : bool;
|
||||||
|
|
||||||
public function SetEmail(string $sEmail) : bool;
|
public function SetEmail(string $sEmail) : bool;
|
||||||
|
|
||||||
public function Sync() : bool;
|
public function Sync() : bool;
|
||||||
|
|
|
||||||
|
|
@ -76,6 +76,11 @@ class PdoAddressBook
|
||||||
return \is_array($aDrivers) && \in_array($this->settings->driver, $aDrivers);
|
return \is_array($aDrivers) && \in_array($this->settings->driver, $aDrivers);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function IsExternal(): bool
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
public function SetEmail(string $sEmail) : bool
|
public function SetEmail(string $sEmail) : bool
|
||||||
{
|
{
|
||||||
$this->iUserID = $this->getUserId($sEmail);
|
$this->iUserID = $this->getUserId($sEmail);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue