</div>
</article>`);
+ // TODO dont query the DOM
fragment.querySelectorAll<HTMLButtonElement>(".jsInsertQuote").forEach((button) => {
button.addEventListener("click", () => {
- // TODO dont query the DOM
// TODO use rawMessage to insert if available otherwise use message
dispatchToCkeditor(this.#editor).insertQuote({
author: message.author,
use Psr\Http\Message\ServerRequestInterface;
use wcf\data\IEmbeddedMessageObject;
use wcf\data\IMessage;
+use wcf\data\user\UserProfile;
use wcf\http\Helper;
use wcf\system\cache\runtime\UserProfileRuntimeCache;
use wcf\system\endpoint\GetRequest;
\assert($object instanceof IMessage);
$userProfile = UserProfileRuntimeCache::getInstance()->getObject($object->getUserID());
+ if ($userProfile === null) {
+ $userProfile = UserProfile::getGuestUserProfile($object->getUsername());
+ }
if ($object instanceof IEmbeddedMessageObject) {
$object->loadEmbeddedObjects();