diff --git a/file/js/be.bastelstu.WCF.Chat.coffee b/file/js/be.bastelstu.WCF.Chat.coffee index 4b5dc16..825b5c6 100644 --- a/file/js/be.bastelstu.WCF.Chat.coffee +++ b/file/js/be.bastelstu.WCF.Chat.coffee @@ -192,7 +192,7 @@ window.console ?= # Desktop Notifications unless typeof window.webkitNotifications is 'undefined' $('#timsChatNotify').click (event) -> - if $(@).data 'status' and window.webkitNotifications.checkPermission() isnt 0 + if $(@).data('status') and window.webkitNotifications.checkPermission() isnt 0 window.webkitNotifications.requestPermission() ### @@ -280,8 +280,10 @@ window.console ?= dataType: 'json' type: 'POST' success: $.proxy((data, textStatus, jqXHR) -> + WCF.DOMNodeInsertedHandler.enable() @handleMessages(data.messages) @handleUsers(data.users) + WCF.DOMNodeInsertedHandler.disable() , @) error: $.proxy((jqXHR, textStatus, errorThrown) -> console.error 'Battle Station hit - shields at ' + (--@shields / 3 * 104) + ' percent' diff --git a/file/lib/data/chat/room/ChatRoomAction.class.php b/file/lib/data/chat/room/ChatRoomAction.class.php index 14f576a..afef181 100644 --- a/file/lib/data/chat/room/ChatRoomAction.class.php +++ b/file/lib/data/chat/room/ChatRoomAction.class.php @@ -84,19 +84,14 @@ public function prune() { public function validateUpdatePosition() { // validate permissions if (is_array($this->permissionsUpdate) && count($this->permissionsUpdate)) { - try { - WCF::getSession()->checkPermissions($this->permissionsUpdate); - } - catch (\wcf\system\exception\PermissionDeniedException $e) { - throw new ValidateActionException('Insufficient permissions'); - } + WCF::getSession()->checkPermissions($this->permissionsUpdate); } else { - throw new ValidateActionException('Insufficient permissions'); + throw new PermissionDeniedException(); } if (!isset($this->parameters['data']['structure'])) { - throw new ValidateActionException('Missing parameter structure'); + throw new UserInputException('structure'); } if (!isset($this->parameters['data']['offset'])) $this->parameters['data']['offset'] = 0;