Skip to main content

Auto-accept invites

Synapse module to automatically accept invites.

Compatible with Synapse v1.84.0 and later.

Installation

From the virtual environment that you use for Synapse, install this module with:

pip install synapse-auto-accept-invite

(If you run into issues, you may need to upgrade pip first, e.g. by running pip install --upgrade pip)

Then alter your homeserver configuration, adding to your modules configuration:

modules:
  - module: synapse_auto_accept_invite.InviteAutoAccepter
    config:
      # Optional: if set to true, then only invites for direct messages (1:1 rooms)
      # will be auto accepted.
      # Defaults to false.
      accept_invites_only_for_direct_messages: false

      # Optional: if set to true, then only invites from local users will be auto 
      # accepted.
      # Defaults to false.
      accept_invites_only_from_local_users: false

      # (For workerised Synapse deployments)
      #
      # This module should only be active on a single worker process at once,
      # otherwise invites may be accepted by multiple workers simultaneously.
      #
      # By default, this module is only enabled on the main process, and is disabled
      # on workers. To choose a worker to run this module on (to reduce load on the
      # main process), specify that worker's configured 'worker_name' below.
      #
      # Any worker may be specified. If this worker does not have the ability to
      # write to Synapse's events stream, it will end up calling out to one that
      # does.
      #
      #worker_to_run_on: workername1

A note about logging

Your Synapse logging configuration should have the following option set in it:

disable_existing_loggers: False

Without it, logging from this module (and potentially others) may not appear in your logs.

Development

In a virtual environment with pip ≥ 21.1, run

pip install -e .[dev]

To run the unit tests, you can either use:

tox -e py

or

trial tests

To run the linters and mypy type checker, use ./scripts-dev/lint.sh.

Releasing

  1. Set a shell variable to the version you are releasing (this just makes subsequent steps easier):

    version=X.Y.Z
    
  2. Update setup.cfg so that the version is correct.

  3. Stage the changed files and commit.

    git add -u
    git commit -m v$version -n
    
  4. Push your changes.

    git push
    
  5. When ready, create a signed tag for the release:

    git tag -s v$version
    

    Base the tag message on the changelog.

  6. Push the tag.

    git push origin tag v$version
    
  7. Create a source distribution and upload it to PyPI:

    python -m build
    twine upload dist/synapse_auto_accept_invite-$version*
    

Download files

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

Source Distribution

synapse_auto_accept_invite-1.2.0.tar.gz (11.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

synapse_auto_accept_invite-1.2.0-py3-none-any.whl (9.2 kB view details)

Uploaded Python 3

File details

Details for the file synapse_auto_accept_invite-1.2.0.tar.gz.

File metadata

File hashes

Hashes for synapse_auto_accept_invite-1.2.0.tar.gz
Algorithm Hash digest
SHA256 c966b250d525101c70215b39ed8f785dba0389b8f8696149476708b3d23445da
MD5 910b59347016a1d32e126333834e363c
BLAKE2b-256 5a9911f6dee5c8e39e684dfd2af9c85c92f98186389d70fa2f00bae59ddda203

See more details on using hashes here.

File details

Details for the file synapse_auto_accept_invite-1.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for synapse_auto_accept_invite-1.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a43945c280cf66b83a5c30c96f1a097a42c0c3271c694ab79c708b1539405b21
MD5 d87dc8352218b6842c5f03bd891d0d43
BLAKE2b-256 90101098b4fa62bb9c7eebd10783e8295d7c2566a56b47ea1b6fac7b17f735cb

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

1.2.0 This release

2 files

1.1.3

2 files

1.1.1

2 files

1.1.0

2 files

1.0.1

2 files

1.0.0

1 file

Supported by

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