Move network event handlers to their own methods
Move network event handlers to their own methods

This will be needed to unsubscribe the handlers, as it was not possible
to refer to the arrow functions from other parts of the code.

Signed-off-by: Daniel Calviño Sánchez <bd7629e975cc0e00ea7cda4ab6a120f2ee42ac1b@gmail.com>

nextcloud/spreed,nextcloud/spreed,nextcloud/spreed