diff --git a/file/acp/be.bastelstu.wcf.chat.update.php b/file/acp/be.bastelstu.wcf.chat.update.php index 4f7504b..d99b0a9 100644 --- a/file/acp/be.bastelstu.wcf.chat.update.php +++ b/file/acp/be.bastelstu.wcf.chat.update.php @@ -17,12 +17,21 @@ final class Update { */ private $rooms = null; + /** + * Contains all the styles the current installation has. + * + * @var array<\wcf\data\style\Style> + */ + private $styles = null; + public function __construct() { $this->rooms = \wcf\data\chat\room\ChatRoom::getCache(); + $this->styles = \wcf\system\style\StyleHandler::getInstance()->getAvailableStyles(); } /** * Notifies users to refresh the chat as the JS may no longer be fully compatible with the PHP code. + * Resets styles. */ public function execute() { foreach ($this->rooms as $room) { @@ -37,6 +46,10 @@ public function execute() { )); $messageAction->executeAction(); } + + foreach ($this->styles as $style) { + \wcf\system\style\StyleHandler::getInstance()->resetStylesheet($style); + } } } $update = new Update();