Skip to content

Fix channel deletion not working

Merge Request Guidelines

  1. Please fill this form out to the best of your ability.
  2. Follow the principle of "One Merge Request, One Concern"
  3. Merge Requests must be complete in total.
  4. Contributed Code must be universal in scope, ie: Able to be used for all installs / install environments.

Description

This applies a few fixes to channelFunc.py delete_channel().

  • Deletion of channel's stickers and videos folders is done by making use of os.path.join and os.path.exists
  • Destruction of channels' ejabberd rooms is done using defaultChatDomain instead of siteAddress.
  • Adding a try-except block, and using logging to write error to log.

Motivation and Context

Channel deletion was not working, specifically at the step to destroy the channel's ejabberd rooms.

How Has This Been Tested?

This was tested on a test instance of OSP for experimentation.

  • Channel deletion is successful, as the owner of the channel.
  • Channel deletion is successful, as site admin.

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • Merge Request Follows the Merge Request Guidelines
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.

Merge request reports