From 6fe0cff342e701aabc069a9b2ea2ec2d26006f8b Mon Sep 17 00:00:00 2001 From: Alexander Date: Sat, 26 Mar 2022 22:52:24 +0300 Subject: [PATCH] Use slack real name as user name (slack) (#1775) * Use slack real name as user name * Change slack option UseRealName to UseFullName --- bridge/slack/helpers.go | 3 +++ matterbridge.toml.sample | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/bridge/slack/helpers.go b/bridge/slack/helpers.go index c970b0d7..bdacd7ee 100644 --- a/bridge/slack/helpers.go +++ b/bridge/slack/helpers.go @@ -87,6 +87,9 @@ func (b *Bslack) populateMessageWithUserInfo(ev *slack.MessageEvent, rmsg *confi if user.Profile.DisplayName != "" { rmsg.Username = user.Profile.DisplayName } + if b.GetBool("UseFullName") && user.Profile.RealName != "" { + rmsg.Username = user.Profile.RealName + } return nil } diff --git a/matterbridge.toml.sample b/matterbridge.toml.sample index 54768a1e..a0fa7c0b 100644 --- a/matterbridge.toml.sample +++ b/matterbridge.toml.sample @@ -862,6 +862,10 @@ ShowUserTyping=false #Default "" MessageClipped="" +#If enabled use the slack "Real Name" as username. +#OPTIONAL (default false) +UseFullName=false + ################################################################### #discord section ###################################################################