Skip to content

Commit

Permalink
Merge pull request #25 from Automattic/team_sync_prefer_slack_real_name
Browse files Browse the repository at this point in the history
Change Team sync to prefer slack profile's real name opposed to display name
  • Loading branch information
ashfame authored Nov 22, 2023
2 parents 7783ceb + 1e237e1 commit 4983799
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ In addition to all features of the upstream bridge, this fork adds the following
- Define `rooms` field under teamsync config for who should be the creator, mods and admins in new rooms created by team sync.
- Tweak message that gets posted in a new channel to suggest inviting `matrixbridge` Slack app.
- Notify admins in admin room for bridge when bridge initialises upon boot, when a Slack channel is created/archived/deleted and unlinking of bridge fails upon channel archive/delete event.
- When user is synced, Slack's real name is preferred over display name and updated on user's profile on Matrix

## Usage

Expand Down
6 changes: 3 additions & 3 deletions src/SlackGhost.ts
Original file line number Diff line number Diff line change
Expand Up @@ -147,9 +147,9 @@ export class SlackGhost {
throw Error('No intent associated with ghost');
}
let changed = false;
if (slackUser.profile.display_name && this.displayName !== slackUser.profile.display_name) {
await this._intent.setDisplayName(slackUser.profile.display_name);
this.displayname = slackUser.profile.display_name;
if (slackUser.profile.real_name && this.displayName !== slackUser.profile.real_name) {
await this._intent.setDisplayName(slackUser.profile.real_name);
this.displayname = slackUser.profile.real_name;
changed = true;
}

Expand Down

0 comments on commit 4983799

Please sign in to comment.