From 4b1ce195b4fe017a34784384f37a37b81941fbb6 Mon Sep 17 00:00:00 2001 From: Slavi Pantaleev Date: Wed, 31 Aug 2022 09:16:16 +0300 Subject: [PATCH 1/2] Do not append domain twice when updating mailbox (again) Fixes: > `mailbox` of this room set to `test@domain@domain` Previously fixed in 97a4d6c7bc961eb8, but it seems like we unintentionally reintroduced this bug again at some point after that. --- bot/command_owner.go | 4 ---- 1 file changed, 4 deletions(-) diff --git a/bot/command_owner.go b/bot/command_owner.go index becd5fe..962b8a8 100644 --- a/bot/command_owner.go +++ b/bot/command_owner.go @@ -98,9 +98,5 @@ func (b *Bot) setOption(ctx context.Context, name, value string) { return } - if name == roomOptionMailbox { - value = value + "@" + b.domain - } - b.SendNotice(ctx, evt.RoomID, fmt.Sprintf("`%s` of this room set to `%s`", name, value)) } From bf970fc699cffd9d2e924e92271855b601a4a400 Mon Sep 17 00:00:00 2001 From: Aine Date: Wed, 31 Aug 2022 10:24:17 +0300 Subject: [PATCH 2/2] remove duplications in utils.Mailbox --- utils/utils.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/utils.go b/utils/utils.go index ddc1b28..93271da 100644 --- a/utils/utils.go +++ b/utils/utils.go @@ -11,7 +11,7 @@ func Mailbox(email string) string { if index == -1 { return email } - return email[:strings.LastIndex(email, "@")] + return email[:index] } // Hostname returns hostname part from email address