@@ -370,12 +370,28 @@ public function __get($name) {
370
370
* @param $name
371
371
*
372
372
* @return Attribute|mixed|null
373
+ * @throws AuthFailedException
374
+ * @throws ConnectionFailedException
375
+ * @throws ImapBadRequestException
376
+ * @throws ImapServerErrorException
377
+ * @throws MessageNotFoundException
378
+ * @throws RuntimeException
379
+ * @throws ResponseException
373
380
*/
374
- public function get ($ name ) {
375
- if (isset ($ this ->attributes [$ name ])) {
381
+ public function get ($ name ): mixed {
382
+ if (isset ($ this ->attributes [$ name ]) && $ this -> attributes [ $ name ] !== null ) {
376
383
return $ this ->attributes [$ name ];
377
384
}
378
385
386
+ switch ($ name ){
387
+ case "uid " :
388
+ $ this ->attributes [$ name ] = $ this ->client ->getConnection ()->getUid ($ this ->msgn )->validate ()->integer ();
389
+ return $ this ->attributes [$ name ];
390
+ case "msgn " :
391
+ $ this ->attributes [$ name ] = $ this ->client ->getConnection ()->getMessageNumber ($ this ->uid )->validate ()->integer ();
392
+ return $ this ->attributes [$ name ];
393
+ }
394
+
379
395
return $ this ->header ->get ($ name );
380
396
}
381
397
@@ -1476,7 +1492,7 @@ public function setClient($client): Message {
1476
1492
*/
1477
1493
public function setUid (int $ uid ): Message {
1478
1494
$ this ->uid = $ uid ;
1479
- $ this ->msgn = $ this -> client -> getConnection ()-> getMessageNumber ( $ this -> uid ) ;
1495
+ $ this ->msgn = null ;
1480
1496
$ this ->msglist = null ;
1481
1497
1482
1498
return $ this ;
@@ -1492,7 +1508,7 @@ public function setUid(int $uid): Message {
1492
1508
public function setMsgn (int $ msgn , int $ msglist = null ): Message {
1493
1509
$ this ->msgn = $ msgn ;
1494
1510
$ this ->msglist = $ msglist ;
1495
- $ this ->uid = $ this -> client -> getConnection ()-> getUid ( $ this -> msgn ) ;
1511
+ $ this ->uid = null ;
1496
1512
1497
1513
return $ this ;
1498
1514
}
0 commit comments