provide proper reply-to fallback by default

This commit is contained in:
Aine
2023-09-28 15:17:55 +03:00
parent 8bdd46fb32
commit bebfa6df92
11 changed files with 91 additions and 85 deletions

View File

@@ -518,7 +518,7 @@ func (b *Bot) sendHelp(ctx context.Context) {
msg.WriteString("\n")
}
b.lp.SendNotice(evt.RoomID, msg.String(), utils.RelatesTo(!cfg.NoThreads(), evt.ID))
b.lp.SendNotice(evt.RoomID, msg.String(), linkpearl.RelatesTo(evt.ID, cfg.NoThreads()))
}
func (b *Bot) runSend(ctx context.Context) {
@@ -568,14 +568,14 @@ func (b *Bot) getSendDetails(ctx context.Context) (string, string, string, bool)
"as you want.\n"+
"```",
b.prefix),
utils.RelatesTo(!cfg.NoThreads(), evt.ID),
linkpearl.RelatesTo(evt.ID, cfg.NoThreads()),
)
return "", "", "", false
}
mailbox := cfg.Mailbox()
if mailbox == "" {
b.lp.SendNotice(evt.RoomID, "mailbox is not configured, kupo", utils.RelatesTo(!cfg.NoThreads(), evt.ID))
b.lp.SendNotice(evt.RoomID, "mailbox is not configured, kupo", linkpearl.RelatesTo(evt.ID, cfg.NoThreads()))
return "", "", "", false
}
@@ -609,7 +609,7 @@ func (b *Bot) runSendCommand(ctx context.Context, cfg config.Room, tos []string,
eml := email.New(ID, "", " "+ID, subject, from, to, to, "", body, htmlBody, nil, nil)
data := eml.Compose(b.cfg.GetBot().DKIMPrivateKey())
if data == "" {
b.lp.SendNotice(evt.RoomID, "email body is empty", utils.RelatesTo(!cfg.NoThreads(), evt.ID))
b.lp.SendNotice(evt.RoomID, "email body is empty", linkpearl.RelatesTo(evt.ID, cfg.NoThreads()))
return
}
queued, err := b.Sendmail(evt.ID, from, to, data)
@@ -625,6 +625,6 @@ func (b *Bot) runSendCommand(ctx context.Context, cfg config.Room, tos []string,
b.saveSentMetadata(ctx, false, evt.ID, recipients, eml, cfg)
}
if len(tos) > 1 {
b.lp.SendNotice(evt.RoomID, "All emails were sent.", utils.RelatesTo(!cfg.NoThreads(), evt.ID))
b.lp.SendNotice(evt.RoomID, "All emails were sent.", linkpearl.RelatesTo(evt.ID, cfg.NoThreads()))
}
}