public function onUpdateRunNodeEvents(NodeEvent $event)
    {
        $node = $event->getNode();

        $this->ensureNodeSubscribers($event);

        $newEvent = new ResourceEvent('node', $node->nid, $this->currentUser->id());

        if ($node->is_flagged != $node->original->is_flagged) {
            if ($node->is_flagged) {
                $this->dispatcher->dispatch('node:flag', $newEvent);
            }
        } else if ($node->status != $node->original->status) {
            if ($node->status) {
                $this->dispatcher->dispatch('node:publish', $newEvent);
            } else {
                $this->dispatcher->dispatch('node:unpublish', $newEvent);
            }
        } else {
            $this->dispatcher->dispatch('node:edit', $newEvent);
        }
    }