fiix replace domain

This commit is contained in:
Urko 2023-08-09 19:34:51 +02:00
parent 33ed5d6af5
commit 30ad26b009
1 changed files with 1 additions and 0 deletions

View File

@ -29,6 +29,7 @@ func (acc *account) unmarshal(data map[string]interface{}) {
func (p *Prosody) loadAccount(username string) (*account, error) { func (p *Prosody) loadAccount(username string) (*account, error) {
if strings.Contains(username, "@") && strings.HasSuffix(username, p.plainDomain) { if strings.Contains(username, "@") && strings.HasSuffix(username, p.plainDomain) {
username = strings.Replace(username, p.plainDomain, "", -1) username = strings.Replace(username, p.plainDomain, "", -1)
username = strings.Replace(username, "@", "", -1)
} }
data, err := os.ReadFile(p.accountsPath + username + ".dat") data, err := os.ReadFile(p.accountsPath + username + ".dat")