fix panic
This commit is contained in:
@@ -1,15 +1,26 @@
|
||||
package prosody
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"net/url"
|
||||
)
|
||||
|
||||
type Prosody struct {
|
||||
binPath string
|
||||
plainDomain string
|
||||
accountsPath string
|
||||
}
|
||||
|
||||
// /var/lib/prosody/xmpp%%2eurkob%%2ecom/accounts/
|
||||
func NewProsody(domain string) *Prosody {
|
||||
plainDomain, err := url.QueryUnescape(domain)
|
||||
if err != nil {
|
||||
panic(fmt.Errorf("urlQueryUnescape %w", err))
|
||||
}
|
||||
return &Prosody{
|
||||
binPath: "/usr/bin/prosodyctl",
|
||||
accountsPath: "/var/lib/prosody/" + domain + "/accounts/",
|
||||
plainDomain: plainDomain,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user