From 5726d6d812ddeb2ec49494bd55b79282e73a9d1f Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tim=20D=C3=BCsterhus?= Date: Fri, 7 Aug 2020 13:54:35 +0200 Subject: [PATCH] Add ICommentManager::isContentAuthor() --- .../comment/manager/AbstractCommentManager.class.php | 7 +++++++ .../lib/system/comment/manager/ICommentManager.class.php | 9 +++++++++ 2 files changed, 16 insertions(+) diff --git a/wcfsetup/install/files/lib/system/comment/manager/AbstractCommentManager.class.php b/wcfsetup/install/files/lib/system/comment/manager/AbstractCommentManager.class.php index 76c3787671..fbf9c3309e 100644 --- a/wcfsetup/install/files/lib/system/comment/manager/AbstractCommentManager.class.php +++ b/wcfsetup/install/files/lib/system/comment/manager/AbstractCommentManager.class.php @@ -231,4 +231,11 @@ abstract class AbstractCommentManager extends SingletonFactory implements IComme return $this->getLink($response->getComment()->objectTypeID, $response->getComment()->objectID) . '#comment' . $response->commentID . '/response' . $response->responseID; } + + /** + * @inheritDoc + */ + public function isContentAuthor($commentOrResponse) { + return false; + } } diff --git a/wcfsetup/install/files/lib/system/comment/manager/ICommentManager.class.php b/wcfsetup/install/files/lib/system/comment/manager/ICommentManager.class.php index 807af53684..75e6ae0544 100644 --- a/wcfsetup/install/files/lib/system/comment/manager/ICommentManager.class.php +++ b/wcfsetup/install/files/lib/system/comment/manager/ICommentManager.class.php @@ -147,4 +147,13 @@ interface ICommentManager { * Sets the list of disallowed bbcodes. */ public function setDisallowedBBCodes(); + + /** + * Returns whether the given Comment or CommentResponse was created by + * the content's author. + * + * @param Comment|CommentResponse $commentOrResponse + * @return boolean + */ + public function isContentAuthor($commentOrResponse); } -- 2.20.1