From 032a7e0c1188d3507b8d9a9571f2446a43cf775b Mon Sep 17 00:00:00 2001 From: msglm Date: Fri, 27 Oct 2023 07:08:25 -0500 Subject: apply https://github.com/42wim/matterbridge/pull/1864 --- gateway/gateway.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'gateway/gateway.go') diff --git a/gateway/gateway.go b/gateway/gateway.go index a2d572be..04f0f117 100644 --- a/gateway/gateway.go +++ b/gateway/gateway.go @@ -323,11 +323,12 @@ func (gw *Gateway) ignoreFilesComment(extra map[string][]interface{}, igMessages return false } -func (gw *Gateway) modifyUsername(msg *config.Message, dest *bridge.Bridge) string { +func (gw *Gateway) ModifyUsername(msg *config.Message, dest *bridge.Bridge) string { if dest.GetBool("StripNick") { re := regexp.MustCompile("[^a-zA-Z0-9]+") msg.Username = re.ReplaceAllString(msg.Username, "") } + nick := dest.GetString("RemoteNickFormat") // loop to replace nicks @@ -462,7 +463,7 @@ func (gw *Gateway) SendMessage( msg.Channel = channel.Name msg.Avatar = gw.modifyAvatar(rmsg, dest) - msg.Username = gw.modifyUsername(rmsg, dest) + msg.Username = gw.ModifyUsername(rmsg, dest) // exclude file delete event as the msg ID here is the native file ID that needs to be deleted if msg.Event != config.EventFileDelete { -- cgit v1.2.3