2 namespace wcf\system\message\embedded\object;
3 use wcf\data\user\UserList;
4 use wcf\system\cache\runtime\UserProfileRuntimeCache;
5 use wcf\system\html\input\HtmlInputProcessor;
6 use wcf\util\StringUtil;
9 * IMessageEmbeddedObjectHandler implementation for quotes.
12 * @copyright 2001-2016 WoltLab GmbH
13 * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
14 * @package WoltLabSuite\Core\System\Message\Embedded\Object
16 class QuoteMessageEmbeddedObjectHandler extends AbstractMessageEmbeddedObjectHandler {
20 public function parse(HtmlInputProcessor $htmlInputProcessor, array $embeddedData) {
23 /** @var \DOMElement $element */
24 foreach ($htmlInputProcessor->getHtmlInputNodeProcessor()->getDocument()->getElementsByTagName('blockquote') as $element) {
25 $username = StringUtil::trim($element->getAttribute('data-author'));
26 if (!empty($username) && !in_array($username, $usernames)) {
27 $usernames[] = $username;
31 if (!empty($usernames)) {
32 $userList = new UserList();
33 $userList->getConditionBuilder()->add("user_table.username IN (?)", [$usernames]);
34 $userList->readObjectIDs();
35 return $userList->getObjectIDs();
44 public function loadObjects(array $objectIDs) {
45 return UserProfileRuntimeCache::getInstance()->getObjects($objectIDs);