Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add bridge.filter.users config option to configure filtering of direct chats #892

Merged
merged 7 commits into from
May 7, 2023
Merged

Add bridge.filter.users config option to configure filtering of direct chats #892

merged 7 commits into from
May 7, 2023

Conversation

Steffo99
Copy link
Contributor

@Steffo99 Steffo99 commented Feb 9, 2023

  • If bridge.filter.users is "null", direct chats will follow the previous settings.
  • If bridge.filter.users is "true", direct chats will always be bridged.
  • If bridge.filter.users is "false", direct chats will never be bridged.

Marked as draft as I did not test it locally.

Fixes #665.

Copy link
Member

@tulir tulir left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The new field also needs to be added to the config upgrader in config.py, otherwise looks fine

@Steffo99 Steffo99 requested a review from tulir February 16, 2023 16:23
@Steffo99
Copy link
Contributor Author

Please test this before merging, I currently cannot test it on my machine due to me not having a development Synapse server (yet)...

@Steffo99 Steffo99 marked this pull request as ready for review February 16, 2023 16:24
Comment on lines 200 to 203
if "bridge.filter.users" not in self:
base["bridge.filter.users"] = True
else:
copy("bridge.filter.users")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing fields are already handled by copy

Suggested change
if "bridge.filter.users" not in self:
base["bridge.filter.users"] = True
else:
copy("bridge.filter.users")
copy("bridge.filter.users")

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does it provide the correct default, though...?

Or does it just set it to None?

Co-authored-by: Tulir Asokan <tulir@maunium.net>
@Steffo99 Steffo99 requested a review from tulir February 26, 2023 18:27
@tulir tulir merged commit 759ccf3 into mautrix:master May 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Ability to disable direct messages
2 participants