mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-08-30 04:29:21 +03:00
Kolab folders are not selectable
This commit is contained in:
parent
474c2b9f95
commit
44f73828f1
1 changed files with 12 additions and 2 deletions
|
|
@ -171,7 +171,8 @@ class Folder implements \JsonSerializable
|
|||
|
||||
public function IsSelectable() : bool
|
||||
{
|
||||
return $this->bExists && $this->oImapFolder->IsSelectable();
|
||||
$type = $this->getKolabFolderType();
|
||||
return $this->bExists && $this->oImapFolder->IsSelectable() && (!$type || 0 === \strpos($type, 'mail.'));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -225,11 +226,15 @@ class Folder implements \JsonSerializable
|
|||
case \in_array('\\all', $aFlags):
|
||||
case \in_array('\\allmail', $aFlags):
|
||||
return \MailSo\Imap\Enumerations\FolderType::ALL;
|
||||
|
||||
// TODO
|
||||
// case 'Templates' === $this->FullNameRaw():
|
||||
// return \MailSo\Imap\Enumerations\FolderType::TEMPLATES;
|
||||
}
|
||||
|
||||
/*
|
||||
// TODO: Kolab
|
||||
switch ($this->oImapFolder->GetMetadata(MetadataKeys::KOLAB_CTYPE) ?: $this->oImapFolder->GetMetadata(MetadataKeys::KOLAB_CTYPE_SHARED)) {
|
||||
switch ($this->getKolabFolderType()) {
|
||||
{
|
||||
case 'event':
|
||||
return \MailSo\Imap\Enumerations\FolderType::CALENDAR;
|
||||
|
|
@ -286,4 +291,9 @@ class Folder implements \JsonSerializable
|
|||
'Metadata' => $this->oImapFolder->Metadata()
|
||||
);
|
||||
}
|
||||
|
||||
protected function getKolabFolderType() : ?string
|
||||
{
|
||||
return $this->GetMetadata(MetadataKeys::KOLAB_CTYPE) ?: $this->GetMetadata(MetadataKeys::KOLAB_CTYPE_SHARED);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue