diff options
author | Tim Culverhouse <tim@timculverhouse.com> | 2022-04-25 08:30:43 -0500 |
---|---|---|
committer | Robin Jarry <robin@jarry.cc> | 2022-04-27 09:46:11 +0200 |
commit | d09636ee0b9957ed60fc01224ddfbb03c4f4b7fa (patch) | |
tree | 5f0ec8c9ad11a0f638c25dbd896a518e983dc779 /aerc.go | |
parent | afe35839eddfaf43be0f791e97a926a15d91fc02 (diff) | |
download | aerc-d09636ee0b9957ed60fc01224ddfbb03c4f4b7fa.tar.gz |
refactor: refactor pgp implementation
This commit refactors the internal PGP implementation to make way for
GPG integration.
Signed-off-by: Tim Culverhouse <tim@timculverhouse.com>
Acked-by: Koni Marti <koni.marti@gmail.com>
Acked-by: Robin Jarry <robin@jarry.cc>
Diffstat (limited to 'aerc.go')
-rw-r--r-- | aerc.go | 11 |
1 files changed, 6 insertions, 5 deletions
@@ -22,6 +22,7 @@ import ( "git.sr.ht/~rjarry/aerc/commands/terminal" "git.sr.ht/~rjarry/aerc/config" "git.sr.ht/~rjarry/aerc/lib" + "git.sr.ht/~rjarry/aerc/lib/crypto" "git.sr.ht/~rjarry/aerc/lib/templates" libui "git.sr.ht/~rjarry/aerc/lib/ui" "git.sr.ht/~rjarry/aerc/logging" @@ -168,7 +169,11 @@ func main() { deferLoop := make(chan struct{}) - aerc = widgets.NewAerc(conf, logger, func(cmd []string) error { + c := crypto.New(conf.General.PgpProvider) + c.Init(logger) + defer c.Close() + + aerc = widgets.NewAerc(conf, logger, c, func(cmd []string) error { return execCommand(aerc, ui, cmd) }, func(cmd string) []string { return getCompletions(aerc, cmd) @@ -188,10 +193,6 @@ func main() { ui.EnableMouse() } - logger.Println("Initializing PGP keyring") - lib.InitKeyring() - defer lib.UnlockKeyring() - logger.Println("Starting Unix server") as, err := lib.StartServer(logger) if err != nil { |