|
|
@ -18,6 +18,7 @@ import (
|
|
|
|
osUser "os/user"
|
|
|
|
osUser "os/user"
|
|
|
|
"runtime"
|
|
|
|
"runtime"
|
|
|
|
"strings"
|
|
|
|
"strings"
|
|
|
|
|
|
|
|
"sync"
|
|
|
|
"time"
|
|
|
|
"time"
|
|
|
|
|
|
|
|
|
|
|
|
"github.com/ProtonMail/gopenpgp/v2/crypto" // MIT License
|
|
|
|
"github.com/ProtonMail/gopenpgp/v2/crypto" // MIT License
|
|
|
@ -33,8 +34,11 @@ type configuration struct {
|
|
|
|
alias string
|
|
|
|
alias string
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var mutex sync.Mutex
|
|
|
|
|
|
|
|
|
|
|
|
func closeAndExit(client *xmpp.Client, cancel context.CancelFunc, err error) {
|
|
|
|
func closeAndExit(client *xmpp.Client, cancel context.CancelFunc, err error) {
|
|
|
|
cancel()
|
|
|
|
cancel()
|
|
|
|
|
|
|
|
mutex.Lock()
|
|
|
|
client.Close()
|
|
|
|
client.Close()
|
|
|
|
if err != nil {
|
|
|
|
if err != nil {
|
|
|
|
log.Fatal(err)
|
|
|
|
log.Fatal(err)
|
|
|
|