use wcf\data\like\object\LikeObject;
use wcf\system\cache\runtime\UserProfileRuntimeCache;
use wcf\system\comment\manager\ICommentManager;
+use wcf\system\message\embedded\object\MessageEmbeddedObjectManager;
use wcf\system\reaction\ReactionHandler;
/**
$canModerate = $this->commentManager->canModerate($this->objectTypeID, $this->objectID);
// fetch response ids
- $responseIDs = $userIDs = [];
+ $embeddedObjectIDs = $responseIDs = $userIDs = [];
/** @var StructuredComment $comment */
foreach ($this->objects as $comment) {
if (!$this->minCommentTime || $comment->time < $this->minCommentTime) {
$userIDs[] = $comment->userID;
}
+ if ($comment->hasEmbeddedObjects) {
+ $embeddedObjectIDs[] = $comment->getObjectID();
+ }
+
$comment->setIsDeletable($this->commentManager->canDeleteComment($comment->getDecoratedObject()));
$comment->setIsEditable($this->commentManager->canEditComment($comment->getDecoratedObject()));
}
$responseList->setObjectIDs(\array_keys($responseIDs));
$responseList->readObjects();
+ $embeddedResponseIDs = [];
foreach ($responseList as $response) {
$response = new StructuredCommentResponse($response);
if ($response->userID) {
$userIDs[] = $response->userID;
}
+
+ if ($response->hasEmbeddedObjects) {
+ $embeddedResponseIDs[] = $response->getObjectID();
+ }
+ }
+
+ if (!empty($embeddedResponseIDs)) {
+ MessageEmbeddedObjectManager::getInstance()->loadObjects(
+ 'com.woltlab.wcf.comment.response',
+ $embeddedResponseIDs
+ );
}
}
if (!empty($userIDs)) {
UserProfileRuntimeCache::getInstance()->cacheObjectIDs(\array_unique($userIDs));
}
+
+ if (!empty($embeddedObjectIDs)) {
+ MessageEmbeddedObjectManager::getInstance()->loadObjects(
+ 'com.woltlab.wcf.comment',
+ $embeddedObjectIDs
+ );
+ }
}
/**
namespace wcf\data\comment;
use wcf\system\cache\runtime\UserProfileRuntimeCache;
+use wcf\system\message\embedded\object\MessageEmbeddedObjectManager;
/**
* Represents a list of decorated comment objects.
parent::readObjects();
if (!empty($this->objects)) {
- $userIDs = [];
+ $embeddedObjectIDs = $userIDs = [];
foreach ($this->objects as $comment) {
if ($comment->userID) {
$userIDs[] = $comment->userID;
}
+
+ if ($comment->hasEmbeddedObjects) {
+ $embeddedObjectIDs[] = $comment->getObjectID();
+ }
}
if (!empty($userIDs)) {
UserProfileRuntimeCache::getInstance()->cacheObjectIDs($userIDs);
}
+
+ if (!empty($embeddedObjectIDs)) {
+ MessageEmbeddedObjectManager::getInstance()->loadObjects(
+ 'com.woltlab.wcf.comment',
+ $embeddedObjectIDs
+ );
+ }
}
}
}
use wcf\data\like\object\LikeObject;
use wcf\system\cache\runtime\UserProfileRuntimeCache;
use wcf\system\comment\manager\ICommentManager;
+use wcf\system\message\embedded\object\MessageEmbeddedObjectManager;
use wcf\system\reaction\ReactionHandler;
/**
parent::readObjects();
// get user ids
- $userIDs = [];
+ $embeddedObjectIDs = $userIDs = [];
foreach ($this->objects as $response) {
if (!$this->minResponseTime || $response->time < $this->minResponseTime) {
$this->minResponseTime = $response->time;
}
$userIDs[] = $response->userID;
+ if ($response->hasEmbeddedObjects) {
+ $embeddedObjectIDs[] = $response->getObjectID();
+ }
+
$response->setIsDeletable($this->commentManager->canDeleteResponse($response->getDecoratedObject()));
$response->setIsEditable($this->commentManager->canEditResponse($response->getDecoratedObject()));
}
if (!empty($userIDs)) {
UserProfileRuntimeCache::getInstance()->cacheObjectIDs(\array_unique($userIDs));
}
+
+ if (!empty($embeddedObjectIDs)) {
+ MessageEmbeddedObjectManager::getInstance()->loadObjects(
+ 'com.woltlab.wcf.comment.response',
+ $embeddedObjectIDs
+ );
+ }
}
/**
namespace wcf\data\comment\response;
use wcf\system\cache\runtime\UserProfileRuntimeCache;
+use wcf\system\message\embedded\object\MessageEmbeddedObjectManager;
/**
* Represents a list of decorated comment response objects.
parent::readObjects();
if (!empty($this->objects)) {
- $userIDs = [];
+ $embeddedObjectIDs = $userIDs = [];
foreach ($this->objects as $response) {
if ($response->userID) {
$userIDs[] = $response->userID;
}
+
+ if ($response->hasEmbeddedObjects) {
+ $embeddedObjectIDs[] = $response->getObjectID();
+ }
}
if (!empty($userIDs)) {
UserProfileRuntimeCache::getInstance()->cacheObjectIDs($userIDs);
}
+
+ if (!empty($embeddedObjectIDs)) {
+ MessageEmbeddedObjectManager::getInstance()->loadObjects(
+ 'com.woltlab.wcf.comment.response',
+ $embeddedObjectIDs
+ );
+ }
}
}
}