Compare commits

...

4 Commits

Author SHA1 Message Date
Chteufleur 6465ebd169 go fmt 2017-03-21 22:21:01 +01:00
Chteufleur 2d4531739a Fix typo. 2017-03-21 22:19:01 +01:00
Chteufleur b32173d11e Fix typo on Confirm message. 2017-03-21 22:18:23 +01:00
Chteufleur 3125d02cf6 Remove useless function that already exist in strings pakage. 2017-03-21 22:17:01 +01:00
6 changed files with 16 additions and 25 deletions

View File

@ -3,6 +3,7 @@ package xmpp
import (
"fmt"
"net"
"strings"
)
const (
@ -27,18 +28,8 @@ func HomeServerAddrs(jid JID) (addr []string, err error) {
// Build list of "host:port" strings.
for _, a := range addrs {
target := parseTargetDomainName(a.Target)
target := strings.TrimRight(a.Target, ".")
addr = append(addr, fmt.Sprintf("%s:%d", target, a.Port))
}
return
}
// Remove the last dot in the domain name if exist
func parseTargetDomainName(domainName string) (ret string) {
if domainName[len(domainName)-1] == '.' {
ret = parseTargetDomainName(domainName[:len(domainName)-1])
} else {
ret = domainName
}
return
}

View File

@ -78,7 +78,7 @@ type Message struct {
Error *Error `xml:"error"`
Lang string `xml:"xml:lang,attr,omitempty"`
Confir *Confirm `xml:"confirm"` // XEP-0070
Confirm *Confirm `xml:"confirm"` // XEP-0070
Active *Active `xml:"active"` // XEP-0085
Composing *Composing `xml:"composing"` // XEP-0085

View File

@ -18,7 +18,7 @@ type StreamConfig struct {
// causes incoming stanzas to be XML-parsed a second time.
LogStanzas bool
// The dommain connection for certificat validation.
// The dommain connection for certificate validation.
ConnectionDomain string
}