Fix Full method for domain/resource JIDs

This commit is contained in:
Bohdan Horbeshko 2022-05-24 16:26:48 -04:00
parent 5f99e1cd06
commit 39809352e2
2 changed files with 2 additions and 1 deletions

View file

@ -54,7 +54,7 @@ func (j *Jid) Full() string {
if j.Resource == "" {
return j.Bare()
} else if j.Node == "" {
return j.Node + "/" + j.Resource
return j.Domain + "/" + j.Resource
} else {
return j.Node + "@" + j.Domain + "/" + j.Resource
}

View file

@ -63,6 +63,7 @@ func TestIncorrectJids(t *testing.T) {
func TestFull(t *testing.T) {
fullJids := []string{
"test@domain.com/my resource",
"domain.com/my resource",
"test@domain.com",
"domain.com",
}