Fix some messages flags/keywords case-insensitivity

This commit is contained in:
the-djmaze 2022-10-08 23:56:14 +02:00
parent b833113ed6
commit fc7db056c2
2 changed files with 5 additions and 8 deletions

View file

@ -141,7 +141,7 @@ export class MessageModel extends AbstractModel {
css: 'msgflag-' + lower,
value: value,
checked: this.flags().includes(lower),
label: i18n('MESSAGE_TAGS/'+lower, 0, lower),
label: i18n('MESSAGE_TAGS/'+lower, 0, value),
toggle: (/*obj*/) => toggleTag(this, value)
});
}

View file

@ -34,6 +34,7 @@ class Message implements \JsonSerializable
$iInternalTimeStampInUTC = 0,
$iHeaderTimeStampInUTC = 0,
$sHeaderDate = '',
// $aFlags = [],
$aFlagsLowerCase = [],
/**
@ -189,11 +190,6 @@ class Message implements \JsonSerializable
return $this->sHeaderDate;
}
public function FlagsLowerCase() : array
{
return $this->aFlagsLowerCase;
}
public function From() : ?\MailSo\Mime\EmailCollection
{
return $this->oFrom;
@ -293,12 +289,13 @@ class Message implements \JsonSerializable
$oBodyStructure = $oFetchResponse->GetFetchBodyStructure();
}
$aFlags = $oFetchResponse->GetFetchValue(FetchType::FLAGS);
$aFlags = $oFetchResponse->GetFetchValue(FetchType::FLAGS) ?: [];
$oMessage->sFolder = $sFolder;
$oMessage->iUid = (int) $oFetchResponse->GetFetchValue(FetchType::UID);
$oMessage->iSize = (int) $oFetchResponse->GetFetchValue(FetchType::RFC822_SIZE);
$oMessage->aFlagsLowerCase = \array_map('mb_strtolower', \array_map('\\MailSo\\Base\\Utils::Utf7ModifiedToUtf8', $aFlags ?: []));
// $oMessage->aFlags = $aFlags;
$oMessage->aFlagsLowerCase = \array_map('mb_strtolower', \array_map('\\MailSo\\Base\\Utils::Utf7ModifiedToUtf8', $aFlags));
$oMessage->iInternalTimeStampInUTC = \MailSo\Base\DateTimeHelper::ParseInternalDateString(
$oFetchResponse->GetFetchValue(FetchType::INTERNALDATE)
);