|
6 | 6 | use wcf\command\user\UnignoreUser; |
7 | 7 | use wcf\data\AbstractDatabaseObjectAction; |
8 | 8 | use wcf\system\cache\runtime\UserProfileRuntimeCache; |
9 | | -use wcf\system\cache\runtime\UserRuntimeCache; |
10 | 9 | use wcf\system\exception\IllegalLinkException; |
11 | 10 | use wcf\system\exception\PermissionDeniedException; |
12 | 11 | use wcf\system\exception\UserInputException; |
@@ -79,9 +78,9 @@ public function validateIgnore() |
79 | 78 | public function ignore() |
80 | 79 | { |
81 | 80 | $type = $this->parameters['data']['type'] ?? UserIgnore::TYPE_BLOCK_DIRECT_CONTACT; |
82 | | - $user = UserRuntimeCache::getInstance()->getObject($this->parameters['data']['userID']); |
| 81 | + $userProfile = UserProfileRuntimeCache::getInstance()->getObject($this->parameters['data']['userID']); |
83 | 82 |
|
84 | | - (new IgnoreUser(WCF::getUser(), $user, $type))(); |
| 83 | + (new IgnoreUser(WCF::getUser(), $userProfile->getDecoratedObject(), $type))(); |
85 | 84 |
|
86 | 85 | return ['isIgnoredUser' => 1]; |
87 | 86 | } |
@@ -112,9 +111,9 @@ public function validateUnignore() |
112 | 111 | */ |
113 | 112 | public function unignore() |
114 | 113 | { |
115 | | - $user = UserRuntimeCache::getInstance()->getObject($this->parameters['data']['userID']); |
| 114 | + $userProfile = UserProfileRuntimeCache::getInstance()->getObject($this->parameters['data']['userID']); |
116 | 115 |
|
117 | | - (new UnignoreUser(WCF::getUser(), $user))(); |
| 116 | + (new UnignoreUser(WCF::getUser(), $userProfile->getDecoratedObject()))(); |
118 | 117 |
|
119 | 118 | return ['isIgnoredUser' => 0]; |
120 | 119 | } |
|
0 commit comments