Skip to main content

A third-party rules module for Synapse to automatically freeze a room when the last admin leaves it and allow other members to unfreeze them and become the new admin.

Project description

Freeze room

This module uses third-party rules callbacks from Synapse's module interface to identify when the last admin of a room leaves it, and when they do it "freezes" the room.

Freezing the room means adding a custom org.matrix.room.frozen to the state of the room. If the content of this event says the room is frozen ({"frozen": true}), then the module will prevent any event to be sent in the room. The only exceptions are letting users leave the room, and letting a user unfreeze it and taking over the room's administration.

Unfreezing the room means sending an org.matrix.room.frozen state event into the room with the content {"frozen": false}. The user unfreezing the room will then automatically become the only administrator in the room.

As with other modules using third-party rules callbacks, it is recommended that this module is only used in a closed federation in which every server has this module configured the same way.

This module requires Synapse v1.39.0 or later.

Installation

This plugin can be installed via PyPI:

pip install synapse-freeze-room

Config

Add the following to your Synapse config:

modules:
  - module: freeze_room.FreezeRoom
    config:
      # Optional: a list of servers that are forbidden from unfreezing rooms.
      unfreeze_blacklist:
        - evil.com
        - foo.com

Development and Testing

This repository uses tox to run tests.

Tests

This repository uses unittest to run the tests located in the tests directory. They can be ran with tox -e tests.

Making a release

git tag vX.Y
python3 setup.py sdist
twine upload dist/synapse-freeze-room-X.Y.tar.gz
git push origin vX.Y

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

synapse-freeze-room-1.0.tar.gz (13.3 kB view details)

Uploaded Source

File details

Details for the file synapse-freeze-room-1.0.tar.gz.

File metadata

  • Download URL: synapse-freeze-room-1.0.tar.gz
  • Upload date:
  • Size: 13.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.6

File hashes

Hashes for synapse-freeze-room-1.0.tar.gz
Algorithm Hash digest
SHA256 8a2a2e14ad609c2f67a03f6fdc3a325e6fee527cd6041ea9a682fa3b564a7d4e
MD5 6b80441096311f495c2fafdbcb3910b3
BLAKE2b-256 637e207a9ca5a20f6b61d85b203e3829058e99d5237e0d5050eab606e229324f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page