add !pm threadify option, fixes #60

This commit is contained in:
Aine
2023-10-13 22:27:46 +03:00
parent 0d0dcf20b9
commit 1bf8ba4700
6 changed files with 61 additions and 6 deletions

View File

@@ -154,6 +154,13 @@ func (b *Bot) IncomingEmail(ctx context.Context, eml *email.Email) error {
b.setThreadID(roomID, eml.MessageID, threadID)
b.setLastEventID(roomID, threadID, eventID)
if newThread && cfg.Threadify() {
_, berr := b.lp.Send(roomID, eml.ContentBody(threadID, cfg.ContentOptions()))
if berr != nil {
return berr
}
}
if !cfg.NoInlines() {
b.sendFiles(ctx, roomID, eml.InlineFiles, cfg.NoThreads(), threadID)
}