Improved Kolab folders visibility

This commit is contained in:
djmaze 2021-10-14 09:43:20 +02:00
parent fa6590b3ab
commit ef9d1ed220
4 changed files with 25 additions and 11 deletions

View file

@ -171,8 +171,7 @@ class Folder implements \JsonSerializable
public function IsSelectable() : bool
{
$type = $this->getKolabFolderType();
return $this->bExists && $this->oImapFolder->IsSelectable() && (!$type || 0 === \strpos($type, 'mail.'));
return $this->bExists && $this->oImapFolder->IsSelectable();
}
/**
@ -234,7 +233,8 @@ class Folder implements \JsonSerializable
/*
// TODO: Kolab
switch ($this->getKolabFolderType()) {
$type = $this->GetMetadata(MetadataKeys::KOLAB_CTYPE) ?: $this->GetMetadata(MetadataKeys::KOLAB_CTYPE_SHARED);
switch (($type && 0 !== \strpos($type, 'mail.')) ? $type : null)
{
case 'event':
return \MailSo\Imap\Enumerations\FolderType::CALENDAR;
@ -291,9 +291,4 @@ class Folder implements \JsonSerializable
'Metadata' => $this->oImapFolder->Metadata()
);
}
protected function getKolabFolderType() : ?string
{
return $this->GetMetadata(MetadataKeys::KOLAB_CTYPE) ?: $this->GetMetadata(MetadataKeys::KOLAB_CTYPE_SHARED);
}
}