Email validations

This commit is contained in:
Aine
2022-10-08 00:11:48 +03:00
parent 6f8e850103
commit 99e509ea3a
9 changed files with 63 additions and 10 deletions

View File

@@ -59,6 +59,17 @@ func (b *Bot) GetMapping(mailbox string) (id.RoomID, bool) {
return roomID, ok
}
// GetOptions returns room settings
func (b *Bot) GetOptions(roomID id.RoomID) utils.ValidationOptions {
cfg, err := b.getRoomSettings(roomID)
if err != nil {
b.log.Error("cannot retrieve room settings: %v", err)
return roomSettings{}
}
return cfg
}
// Send email to matrix room
func (b *Bot) Send2Matrix(ctx context.Context, email *utils.Email, incoming bool) error {
roomID, ok := b.GetMapping(email.Mailbox(incoming))