From d9d5db2680382db7b7435071b551d3649366e0c6 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tim=20D=C3=BCsterhus?= Date: Fri, 7 Aug 2020 13:55:20 +0200 Subject: [PATCH] Implement isContentAuthor for user profile comments --- .../manager/UserProfileCommentManager.class.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/wcfsetup/install/files/lib/system/comment/manager/UserProfileCommentManager.class.php b/wcfsetup/install/files/lib/system/comment/manager/UserProfileCommentManager.class.php index 29dc8a061a..6b8cbc4648 100644 --- a/wcfsetup/install/files/lib/system/comment/manager/UserProfileCommentManager.class.php +++ b/wcfsetup/install/files/lib/system/comment/manager/UserProfileCommentManager.class.php @@ -4,6 +4,7 @@ use wcf\data\comment\response\CommentResponse; use wcf\data\comment\response\CommentResponseList; use wcf\data\comment\Comment; use wcf\data\comment\CommentList; +use wcf\data\DatabaseObjectDecorator; use wcf\data\object\type\ObjectTypeCache; use wcf\system\cache\runtime\UserProfileRuntimeCache; use wcf\system\like\IViewableLikeProvider; @@ -251,4 +252,14 @@ class UserProfileCommentManager extends AbstractCommentManager implements IViewa } } } + + /** + * @inheritDoc + */ + public function isContentAuthor($commentOrResponse) { + if ($commentOrResponse instanceof CommentResponse || ($commentOrResponse instanceof DatabaseObjectDecorator && $commentOrResponse->getDecoratedObject() instanceof CommentResponse)) { + return $commentOrResponse->userID == $commentOrResponse->getComment()->objectID; + } + return $commentOrResponse->userID == $commentOrResponse->objectID; + } } -- 2.20.1