mautrix-meta: enable spaces; add a hint into the display name (#3210)

* mautrix-meta: enable spaces; add a hint into the display name

* use the meta mode to determine displayname suffix

* Allow for people to easily unset the mautrix-meta displayname suffix

Previously, unsetting `matrix_mautrix_meta_messenger_bridge_displayname_suffix`
or (`matrix_mautrix_meta_instagram_bridge_displayname_suffix`) variable would
make you end up witha trailing space in `displayname`.

It's possible that mautrix-meta trims this, but I haven't checked. It's
better not to risk it anyway.

---------

Co-authored-by: Slavi Pantaleev <slavi@devture.com>
This commit is contained in:
Aine 2024-03-02 16:15:44 +00:00 committed by GitHub
parent 80f6f98ac4
commit abbcd2188d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 32 additions and 4 deletions

View File

@ -179,7 +179,17 @@ matrix_mautrix_meta_instagram_bridge_username_prefix: |-
# Changing this may require that you change the regex in the appservice. # Changing this may require that you change the regex in the appservice.
matrix_mautrix_meta_instagram_bridge_username_template: "{{ matrix_mautrix_meta_instagram_bridge_username_prefix + '{{.}}' }}" matrix_mautrix_meta_instagram_bridge_username_template: "{{ matrix_mautrix_meta_instagram_bridge_username_prefix + '{{.}}' }}"
matrix_mautrix_meta_instagram_bridge_displayname_template: '{% raw %}{{or .DisplayName .Username "Unknown user"}}{% endraw %}' matrix_mautrix_meta_instagram_bridge_displayname_suffix: |-
{{
({
'facebook': '(FB)',
'facebook-tor': '(FB)',
'messenger': '(FB)',
'instagram': '(IG)',
})[matrix_mautrix_meta_instagram_meta_mode]
}}
matrix_mautrix_meta_instagram_bridge_displayname_template: '{% raw %}{{or .DisplayName .Username "Unknown user"}}{% endraw %}{{ (" " ~ matrix_mautrix_meta_instagram_bridge_displayname_suffix) if matrix_mautrix_meta_instagram_bridge_displayname_suffix else "" }}'
# The prefix for commands. Only required in non-management rooms. # The prefix for commands. Only required in non-management rooms.
# If set to "default", will be determined based on meta -> mode (`matrix_mautrix_meta_instagram_meta_mode`): # If set to "default", will be determined based on meta -> mode (`matrix_mautrix_meta_instagram_meta_mode`):
@ -191,6 +201,10 @@ matrix_mautrix_meta_instagram_bridge_command_prefix: default
# If false, created portal rooms will never be federated. # If false, created portal rooms will never be federated.
matrix_mautrix_meta_instagram_bridge_federate_rooms: true matrix_mautrix_meta_instagram_bridge_federate_rooms: true
# Should the bridge create a space for each logged-in user and add bridged rooms to it?
# Users who logged in before turning this on should run `!meta sync-space` to create and fill the space for the first time.
matrix_mautrix_meta_instagram_bridge_personal_filtering_spaces: true
# Enable End-to-bridge encryption # Enable End-to-bridge encryption
matrix_mautrix_meta_instagram_bridge_encryption_allow: "{{ matrix_bridges_encryption_enabled }}" matrix_mautrix_meta_instagram_bridge_encryption_allow: "{{ matrix_bridges_encryption_enabled }}"
matrix_mautrix_meta_instagram_bridge_encryption_default: "{{ matrix_mautrix_meta_instagram_bridge_encryption_allow }}" matrix_mautrix_meta_instagram_bridge_encryption_default: "{{ matrix_mautrix_meta_instagram_bridge_encryption_allow }}"

View File

@ -124,7 +124,7 @@ bridge:
# Should the bridge create a space for each logged-in user and add bridged rooms to it? # Should the bridge create a space for each logged-in user and add bridged rooms to it?
# Users who logged in before turning this on should run `!meta sync-space` to create and fill the space for the first time. # Users who logged in before turning this on should run `!meta sync-space` to create and fill the space for the first time.
personal_filtering_spaces: false personal_filtering_spaces: {{ matrix_mautrix_meta_instagram_bridge_personal_filtering_spaces | to_json }}
# Should Matrix m.notice-type messages be bridged? # Should Matrix m.notice-type messages be bridged?
bridge_notices: true bridge_notices: true
# Should the bridge send a read receipt from the bridge bot when a message has been sent to FB/IG? # Should the bridge send a read receipt from the bridge bot when a message has been sent to FB/IG?

View File

@ -179,7 +179,17 @@ matrix_mautrix_meta_messenger_bridge_username_prefix: |-
# Changing this may require that you change the regex in the appservice. # Changing this may require that you change the regex in the appservice.
matrix_mautrix_meta_messenger_bridge_username_template: "{{ matrix_mautrix_meta_messenger_bridge_username_prefix + '{{.}}' }}" matrix_mautrix_meta_messenger_bridge_username_template: "{{ matrix_mautrix_meta_messenger_bridge_username_prefix + '{{.}}' }}"
matrix_mautrix_meta_messenger_bridge_displayname_template: '{% raw %}{{or .DisplayName .Username "Unknown user"}}{% endraw %}' matrix_mautrix_meta_messenger_bridge_displayname_suffix: |-
{{
({
'facebook': '(FB)',
'facebook-tor': '(FB)',
'messenger': '(FB)',
'instagram': '(IG)',
})[matrix_mautrix_meta_messenger_meta_mode]
}}
matrix_mautrix_meta_messenger_bridge_displayname_template: '{% raw %}{{or .DisplayName .Username "Unknown user"}}{% endraw %}{{ (" " ~ matrix_mautrix_meta_messenger_bridge_displayname_suffix) if matrix_mautrix_meta_messenger_bridge_displayname_suffix else "" }}'
# The prefix for commands. Only required in non-management rooms. # The prefix for commands. Only required in non-management rooms.
# If set to "default", will be determined based on meta -> mode (`matrix_mautrix_meta_messenger_meta_mode`): # If set to "default", will be determined based on meta -> mode (`matrix_mautrix_meta_messenger_meta_mode`):
@ -191,6 +201,10 @@ matrix_mautrix_meta_messenger_bridge_command_prefix: default
# If false, created portal rooms will never be federated. # If false, created portal rooms will never be federated.
matrix_mautrix_meta_messenger_bridge_federate_rooms: true matrix_mautrix_meta_messenger_bridge_federate_rooms: true
# Should the bridge create a space for each logged-in user and add bridged rooms to it?
# Users who logged in before turning this on should run `!meta sync-space` to create and fill the space for the first time.
matrix_mautrix_meta_messenger_bridge_personal_filtering_spaces: true
# Enable End-to-bridge encryption # Enable End-to-bridge encryption
matrix_mautrix_meta_messenger_bridge_encryption_allow: "{{ matrix_bridges_encryption_enabled }}" matrix_mautrix_meta_messenger_bridge_encryption_allow: "{{ matrix_bridges_encryption_enabled }}"
matrix_mautrix_meta_messenger_bridge_encryption_default: "{{ matrix_mautrix_meta_messenger_bridge_encryption_allow }}" matrix_mautrix_meta_messenger_bridge_encryption_default: "{{ matrix_mautrix_meta_messenger_bridge_encryption_allow }}"

View File

@ -124,7 +124,7 @@ bridge:
# Should the bridge create a space for each logged-in user and add bridged rooms to it? # Should the bridge create a space for each logged-in user and add bridged rooms to it?
# Users who logged in before turning this on should run `!meta sync-space` to create and fill the space for the first time. # Users who logged in before turning this on should run `!meta sync-space` to create and fill the space for the first time.
personal_filtering_spaces: false personal_filtering_spaces: {{ matrix_mautrix_meta_messenger_bridge_personal_filtering_spaces | to_json }}
# Should Matrix m.notice-type messages be bridged? # Should Matrix m.notice-type messages be bridged?
bridge_notices: true bridge_notices: true
# Should the bridge send a read receipt from the bridge bot when a message has been sent to FB/IG? # Should the bridge send a read receipt from the bridge bot when a message has been sent to FB/IG?