...
|
...
|
@@ -21,7 +21,7 @@ class Folder extends Request{ |
|
|
* 未读数量 有的邮箱是不会返回未读数量的
|
|
|
* @var int
|
|
|
*/
|
|
|
protected int $seen = 0;
|
|
|
protected int $unseen = 0;
|
|
|
|
|
|
/**
|
|
|
* 总数
|
...
|
...
|
@@ -63,6 +63,17 @@ class Folder extends Request{ |
|
|
}
|
|
|
|
|
|
|
|
|
/**
|
|
|
* 文件夹名称
|
|
|
* @return string
|
|
|
* @author:dc
|
|
|
* @time 2024/9/26 11:06
|
|
|
*/
|
|
|
public function getName(){
|
|
|
return $this->folder;
|
|
|
}
|
|
|
|
|
|
|
|
|
public function exec(): static
|
|
|
{
|
|
|
|
...
|
...
|
@@ -85,7 +96,7 @@ class Folder extends Request{ |
|
|
}
|
|
|
// 未读
|
|
|
elseif (preg_match("/^\*.*\[UNSEEN (\d+)\]/i",$item,$m)){
|
|
|
$this->seen = (int) $m[1];
|
|
|
$this->unseen = (int) $m[1];
|
|
|
}
|
|
|
// tag
|
|
|
elseif (preg_match("/^\* FLAGS \((.*)\)$/i",$item,$m)){
|
...
|
...
|
@@ -137,9 +148,9 @@ class Folder extends Request{ |
|
|
* 当前文件夹有多少未读数量
|
|
|
* @return int
|
|
|
*/
|
|
|
public function getSeen(): int
|
|
|
public function getUnseen(): int
|
|
|
{
|
|
|
return $this->getData('seen');
|
|
|
return $this->getData('unseen');
|
|
|
}
|
|
|
|
|
|
|
...
|
...
|
@@ -165,13 +176,13 @@ class Folder extends Request{ |
|
|
}
|
|
|
switch ($name){
|
|
|
case 'total':{return $this->total;}
|
|
|
case 'seen':{return $this->seen;}
|
|
|
case 'unseen':{return $this->unseen;}
|
|
|
case 'recent':{return $this->recent;}
|
|
|
case 'flags':{return $this->flags;}
|
|
|
default:{
|
|
|
return [
|
|
|
'total'=>$this->total,
|
|
|
'seen'=>$this->seen,
|
|
|
'unseen'=>$this->unseen,
|
|
|
'recent'=> $this->recent,
|
|
|
'flags'=> $this->flags
|
|
|
];
|
...
|
...
|
|