mirror of
https://github.com/mjl-/mox.git
synced 2025-07-12 12:24:38 +03:00
webmail: add server-side stored settings, for signature, top/bottom reply and showing the security indications below address input fields
should solve #102
This commit is contained in:
@ -215,6 +215,7 @@ type EventStart struct {
|
||||
MailboxName string
|
||||
Mailboxes []store.Mailbox
|
||||
RejectsMailbox string
|
||||
Settings store.Settings
|
||||
Version string
|
||||
}
|
||||
|
||||
@ -664,6 +665,7 @@ func serveEvents(ctx context.Context, log mlog.Log, w http.ResponseWriter, r *ht
|
||||
}()
|
||||
|
||||
var mbl []store.Mailbox
|
||||
settings := store.Settings{ID: 1}
|
||||
|
||||
// We only take the rlock when getting the tx.
|
||||
acc.WithRLock(func() {
|
||||
@ -673,6 +675,9 @@ func serveEvents(ctx context.Context, log mlog.Log, w http.ResponseWriter, r *ht
|
||||
|
||||
mbl, err = bstore.QueryTx[store.Mailbox](qtx).List()
|
||||
xcheckf(ctx, err, "list mailboxes")
|
||||
|
||||
err = qtx.Get(&settings)
|
||||
xcheckf(ctx, err, "get settings")
|
||||
})
|
||||
|
||||
// Find the designated mailbox if a mailbox name is set, or there are no filters at all.
|
||||
@ -728,7 +733,7 @@ func serveEvents(ctx context.Context, log mlog.Log, w http.ResponseWriter, r *ht
|
||||
}
|
||||
|
||||
// Write first event, allowing client to fill its UI with mailboxes.
|
||||
start := EventStart{sse.ID, loginAddress, addresses, domainAddressConfigs, mailbox.Name, mbl, accConf.RejectsMailbox, moxvar.Version}
|
||||
start := EventStart{sse.ID, loginAddress, addresses, domainAddressConfigs, mailbox.Name, mbl, accConf.RejectsMailbox, settings, moxvar.Version}
|
||||
writer.xsendEvent(ctx, log, "start", start)
|
||||
|
||||
// The goroutine doing the querying will send messages on these channels, which
|
||||
|
Reference in New Issue
Block a user