作者 邓超

1

@@ -273,6 +273,10 @@ class Home extends Base { @@ -273,6 +273,10 @@ class Home extends Base {
273 $this->setFlags('seen'); 273 $this->setFlags('seen');
274 } 274 }
275 275
  276 + public function answered_2_unanswered(){
  277 + $this->setFlags('answered');
  278 + }
  279 +
276 280
277 281
278 /** 282 /**
@@ -401,6 +405,11 @@ class Home extends Base { @@ -401,6 +405,11 @@ class Home extends Base {
401 $mailInstance->seen(array_column($uid,'uid'),$folder['origin_folder'],$fv); 405 $mailInstance->seen(array_column($uid,'uid'),$folder['origin_folder'],$fv);
402 break; 406 break;
403 } 407 }
  408 + // 未回复/已回复
  409 + case 'answered':{
  410 + $mailInstance->answered(array_column($uid,'uid'),$folder['origin_folder'],$fv);
  411 + break;
  412 + }
404 // 回收站,已删 未删,软删 413 // 回收站,已删 未删,软删
405 // case 'deleted':{ 414 // case 'deleted':{
406 // $mailInstance->recycle(array_column($uid,'uid'),$folder['origin_folder'],$fv); 415 // $mailInstance->recycle(array_column($uid,'uid'),$folder['origin_folder'],$fv);
@@ -402,6 +402,24 @@ class Mail { @@ -402,6 +402,24 @@ class Mail {
402 } 402 }
403 403
404 /** 404 /**
  405 + * 回复标记
  406 + * @param $uids
  407 + * @param $folder
  408 + * @param $seen
  409 + * @return bool
  410 + * @throws \Exception
  411 + * @author:dc
  412 + * @time 2023/4/6 17:10
  413 + */
  414 + public function answered($uids,$folder,$seen):bool{
  415 + // 选择目录
  416 + $status = $this->client->selectFolder($folder);
  417 +
  418 + return $this->client->flags($uids,[Imap::FLAGS_ANSWERED],$seen ? '+' : '-',true);
  419 + }
  420 +
  421 +
  422 + /**
405 * 复制 423 * 复制
406 * @param $uids 424 * @param $uids
407 * @param $folder 425 * @param $folder
@@ -33,6 +33,8 @@ return [ @@ -33,6 +33,8 @@ return [
33 'sync' => [\Controller\Home::class, 'sync'], 33 'sync' => [\Controller\Home::class, 'sync'],
34 // 标记为已读 34 // 标记为已读
35 'seen_2_unseen' => [\Controller\Home::class, 'seen_2_unseen'], 35 'seen_2_unseen' => [\Controller\Home::class, 'seen_2_unseen'],
  36 +// 标记为已回复/未回复
  37 + 'answered_2_unanswered' => [\Controller\Home::class, 'seen_2_unseen'],
36 // 邮件移动文件夹 38 // 邮件移动文件夹
37 'move' => [\Controller\Home::class, 'move'], 39 'move' => [\Controller\Home::class, 'move'],
38 // 检查邮箱状态 40 // 检查邮箱状态