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

Change Team sync to prefer slack profile's real name opposed to display name #25

Merged
merged 2 commits into from
Nov 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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) {
psrpinto marked this conversation as resolved.
Show resolved Hide resolved
await this._intent.setDisplayName(slackUser.profile.real_name);
this.displayname = slackUser.profile.real_name;
changed = true;
}

Expand Down
Loading