mautrix / slack

A Matrix-Slack puppeting bridge
GNU Affero General Public License v3.0
61 stars 17 forks source link

Slack user's display name / real name is not applied in Matrix #30

Closed wapsi closed 9 months ago

wapsi commented 1 year ago

Slack user's display name / real name is not applied in Matrix. All the users, in all rooms are seen as they raw Matrix user ID, even I've configured the "displayname_template" setting:

image

I've tried multiple different configuration for the displayname_template, but it does not affect:

bridge:
    # Localpart template of MXIDs for Slack users.
    # {{.}} is replaced with the internal ID of the Slack user.
    username_template: slack_{{.}}
    # Displayname template for Slack users.
    # TODO: document variables
    displayname_template: '{{.Name}}'
    bot_displayname_template: '{{.Name}} (Slack bot)'
    channel_name_template: '{{.Name}} ({{.TeamName}}, Slack)'

and

bridge:
    # Localpart template of MXIDs for Slack users.
    # {{.}} is replaced with the internal ID of the Slack user.
    username_template: slack_{{.}}
    # Displayname template for Slack users.
    # TODO: document variables
    displayname_template: '{{.Name}} ({{.RealName}}, Slack)'
    bot_displayname_template: '{{.Name}} (Slack bot)'
    channel_name_template: '{{.Name}} ({{.TeamName}}, Slack)'

I also tried to erase the database mautrix-slack is using and start it "from the scratch", but the issue remains.

The room names' (channel_name_template) setting works just fine, though.

Version I'm using is pulled from the Git on 21st of June 2023.

wapsi commented 9 months ago

This was most probably misconfiguration issue, {{.DisplayName}} and {{.RealName}} work just fine now:

    displayname_template: '{{.DisplayName}} ({{.RealName}}, Slack)'
    bot_displayname_template: '{{.Name}} (Slack bot)'
    channel_name_template: '{{.Name}} ({{.TeamName}}, Slack)'