作者 邓超

星标

... ... @@ -450,6 +450,18 @@ class Home extends Base {
$this->setFlags('answered');
}
/**
* 星标
* @throws \Lib\Err
* @author:dc
* @time 2024/6/21 16:35
*/
public function star_2_unstar(){
$this->setFlags('flagged');
}
/**
... ... @@ -680,6 +692,11 @@ class Home extends Base {
$mailInstance->answered(array_column($uid,'uid'),$folder['origin_folder'],$fv);
break;
}
// 星标
case 'flagged':{
$mailInstance->flagged(array_column($uid,'uid'),$folder['origin_folder'],$fv);
break;
}
// 回收站,已删 未删,软删
// case 'deleted':{
// $mailInstance->recycle(array_column($uid,'uid'),$folder['origin_folder'],$fv);
... ...
... ... @@ -556,6 +556,23 @@ class Mail {
return $this->client->flags($uids,[Imap::FLAGS_ANSWERED],$seen ? '+' : '-',true);
}
/**
* 回复标记
* @param $uids
* @param $folder
* @param $flagged
* @return bool
* @throws \Exception
* @author:dc
* @time 2023/4/6 17:10
*/
public function flagged($uids,$folder,$flagged):bool{
// 选择目录
$status = $this->client->selectFolder($folder);
return $this->client->flags($uids,[Imap::FLAGS_FLAGGED],$flagged ? '+' : '-',true);
}
/**
* 复制
... ...
... ... @@ -34,6 +34,8 @@ return [
'seen_2_unseen' => [\Controller\Home::class, 'seen_2_unseen'],
// 标记为已回复/未回复
'answered_2_unanswered' => [\Controller\Home::class, 'answered_2_unanswered'],
'star_2_unstar' => [\Controller\Home::class, 'star_2_unstar'],
// 邮件移动文件夹
'move' => [\Controller\Home::class, 'move'],
// 复制邮件
... ...