equal
deleted
inserted
replaced
8 |
8 |
9 import ( |
9 import ( |
10 "bytes" |
10 "bytes" |
11 "flag" |
11 "flag" |
12 "fmt" |
12 "fmt" |
|
13 "go-idn.googlecode.com/hg/src/stringprep" |
13 "io" |
14 "io" |
14 "os" |
15 "os" |
15 "regexp" |
16 "regexp" |
16 "strings" |
17 "strings" |
17 "xml" |
18 "xml" |
199 r := regexp.MustCompile("^(([^@/]+)@)?([^@/]+)(/([^@/]+))?$") |
200 r := regexp.MustCompile("^(([^@/]+)@)?([^@/]+)(/([^@/]+))?$") |
200 parts := r.FindStringSubmatch(val) |
201 parts := r.FindStringSubmatch(val) |
201 if parts == nil { |
202 if parts == nil { |
202 return false |
203 return false |
203 } |
204 } |
204 jid.Node = parts[2] |
205 jid.Node = stringprep.Nodeprep(parts[2]) |
205 jid.Domain = parts[3] |
206 jid.Domain = stringprep.Nodeprep(parts[3]) |
206 jid.Resource = parts[5] |
207 jid.Resource = stringprep.Resourceprep(parts[5]) |
207 return true |
208 return true |
208 } |
209 } |
209 |
210 |
210 func (s *stream) MarshalXML() ([]byte, os.Error) { |
211 func (s *stream) MarshalXML() ([]byte, os.Error) { |
211 buf := bytes.NewBuffer(nil) |
212 buf := bytes.NewBuffer(nil) |