1717
1818class CurrentUser {
1919
20- /** @var string|null */
21- protected $ identifier = null ;
22- /** @var string|false|null */
23- protected $ cloudId = false ;
24- /** @var string|false|null */
25- protected $ sessionUser = false ;
26-
2720 public function __construct (
2821 protected readonly IUserSession $ userSession ,
2922 protected readonly IRequest $ request ,
@@ -46,25 +39,21 @@ public function getUserIdentifier(): string {
4639
4740 $ uid = $ this ->getUID ();
4841 if ($ uid !== null ) {
49- $ this ->identifier = $ uid ;
50- return $ this ->identifier ;
42+ return $ uid ;
5143 }
5244
5345 $ cloudId = $ this ->getCloudIDFromToken ();
5446 if ($ cloudId !== null ) {
55- $ this ->identifier = $ cloudId ;
56- return $ this ->identifier ;
47+ return $ cloudId ;
5748 }
5849
5950 $ nickname = htmlspecialchars ($ this ->request ->getHeader ('X-NC-Nickname ' ));
6051 if ($ nickname !== '' ) {
61- $ this ->identifier = $ nickname . ' ( ' . $ this ->l10nFactory ->get ('comments ' )->t ('remote user ' ) . ') ' ;
62- return $ this ->identifier ;
52+ return $ nickname . ' ( ' . $ this ->l10nFactory ->get ('comments ' )->t ('remote user ' ) . ') ' ;
6353 }
6454
6555 // Nothing worked, fallback to empty string
66- $ this ->identifier = '' ;
67- return $ this ->identifier ;
56+ return '' ;
6857 }
6958
7059 /**
@@ -79,8 +68,7 @@ public function getUID(): ?string {
7968 $ this ->sessionUser = null ;
8069 }
8170 }
82-
83- return $ this ->sessionUser ;
71+ return null ;
8472 }
8573
8674 /**
@@ -95,8 +83,6 @@ public function getCloudId(): ?string {
9583 $ this ->cloudId = $ this ->getCloudIDFromToken ();
9684 }
9785 }
98-
99- return $ this ->cloudId ;
10086 }
10187
10288 /**
0 commit comments