mirror of
https://github.com/FluuxIO/go-xmpp.git
synced 2024-11-24 11:32:00 -08:00
Fix Full method for domain/resource JIDs
This commit is contained in:
parent
5f99e1cd06
commit
39809352e2
@ -54,7 +54,7 @@ func (j *Jid) Full() string {
|
|||||||
if j.Resource == "" {
|
if j.Resource == "" {
|
||||||
return j.Bare()
|
return j.Bare()
|
||||||
} else if j.Node == "" {
|
} else if j.Node == "" {
|
||||||
return j.Node + "/" + j.Resource
|
return j.Domain + "/" + j.Resource
|
||||||
} else {
|
} else {
|
||||||
return j.Node + "@" + j.Domain + "/" + j.Resource
|
return j.Node + "@" + j.Domain + "/" + j.Resource
|
||||||
}
|
}
|
||||||
|
@ -63,6 +63,7 @@ func TestIncorrectJids(t *testing.T) {
|
|||||||
func TestFull(t *testing.T) {
|
func TestFull(t *testing.T) {
|
||||||
fullJids := []string{
|
fullJids := []string{
|
||||||
"test@domain.com/my resource",
|
"test@domain.com/my resource",
|
||||||
|
"domain.com/my resource",
|
||||||
"test@domain.com",
|
"test@domain.com",
|
||||||
"domain.com",
|
"domain.com",
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user