From c399c6ff109ab95f98a61bf21b850d68ce7ad458 Mon Sep 17 00:00:00 2001 From: Slavi Pantaleev Date: Tue, 8 Jul 2025 06:38:51 +0300 Subject: [PATCH] Extract mautrix-twitter's `network.displayname_template` configuration into a variable (`matrix_mautrix_twitter_network_displayname_template`) --- roles/custom/matrix-bridge-mautrix-twitter/defaults/main.yml | 5 +++++ .../matrix-bridge-mautrix-twitter/templates/config.yaml.j2 | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/roles/custom/matrix-bridge-mautrix-twitter/defaults/main.yml b/roles/custom/matrix-bridge-mautrix-twitter/defaults/main.yml index 998ae1554..3b5e479c8 100644 --- a/roles/custom/matrix-bridge-mautrix-twitter/defaults/main.yml +++ b/roles/custom/matrix-bridge-mautrix-twitter/defaults/main.yml @@ -44,6 +44,11 @@ matrix_mautrix_twitter_msc4190_enabled: "{{ matrix_bridges_msc4190_enabled }}" # A public address that external services can use to reach this appservice. matrix_mautrix_twitter_appservice_public_address: '' +# Displayname template for Twitter users. +# {{ .DisplayName }} is replaced with the display name of the Twitter user. +# {{ .Username }} is replaced with the username of the Twitter user. +matrix_mautrix_twitter_network_displayname_template: "{% raw %}{{ .DisplayName }}{% endraw %} (Twitter)" + matrix_mautrix_twitter_bridge_command_prefix: "!tw" matrix_mautrix_twitter_bridge_permissions: | diff --git a/roles/custom/matrix-bridge-mautrix-twitter/templates/config.yaml.j2 b/roles/custom/matrix-bridge-mautrix-twitter/templates/config.yaml.j2 index e437ffc3c..cc9cfc255 100644 --- a/roles/custom/matrix-bridge-mautrix-twitter/templates/config.yaml.j2 +++ b/roles/custom/matrix-bridge-mautrix-twitter/templates/config.yaml.j2 @@ -11,7 +11,7 @@ network: # {{ .DisplayName }} is replaced with the display name of the Twitter user. # {{ .Username }} is replaced with the username of the Twitter user. # {% endraw %} - displayname_template: "{% raw %}{{ .DisplayName }}{% endraw %} (Twitter)" + displayname_template: {{ matrix_mautrix_twitter_network_displayname_template | to_json }} # Maximum number of conversations to sync on startup conversation_sync_limit: 20