Merge branch 'master' of github.com:mattn/go-xmpp

This commit is contained in:
mattn 2012-05-15 21:29:41 +09:00
commit e4e8b7448c
2 changed files with 21 additions and 21 deletions

View File

@ -40,7 +40,7 @@ func main() {
hbox := gtk.HBox(false, 1) hbox := gtk.HBox(false, 1)
dialog.GetVBox().Add(hbox) dialog.GetVBox().Add(hbox)
label := gtk.Label("username:") label := gtk.Label("username:")
sgroup.Add(label) sgroup.AddWidget(label)
hbox.Add(label) hbox.Add(label)
username := gtk.Entry() username := gtk.Entry()
hbox.Add(username) hbox.Add(username)
@ -48,7 +48,7 @@ func main() {
hbox = gtk.HBox(false, 1) hbox = gtk.HBox(false, 1)
dialog.GetVBox().Add(hbox) dialog.GetVBox().Add(hbox)
label = gtk.Label("password:") label = gtk.Label("password:")
sgroup.Add(label) sgroup.AddWidget(label)
hbox.Add(label) hbox.Add(label)
password := gtk.Entry() password := gtk.Entry()
password.SetVisibility(false) password.SetVisibility(false)

38
xmpp.go
View File

@ -119,7 +119,7 @@ func (c *Client) Close() error {
func (c *Client) init(user, passwd string) error { func (c *Client) init(user, passwd string) error {
// For debugging: the following causes the plaintext of the connection to be duplicated to stdout. // For debugging: the following causes the plaintext of the connection to be duplicated to stdout.
// c.p = xml.NewParser(tee{c.tls, os.Stdout}); //c.p = xml.NewDecoder(tee{c.tls, os.Stdout});
c.p = xml.NewDecoder(c.tls) c.p = xml.NewDecoder(c.tls)
a := strings.SplitN(user, "@", 2) a := strings.SplitN(user, "@", 2)
@ -279,12 +279,12 @@ type tlsFailure struct {
type saslMechanisms struct { type saslMechanisms struct {
XMLName xml.Name `xml:"urn:ietf:params:xml:ns:xmpp-sasl mechanisms"` XMLName xml.Name `xml:"urn:ietf:params:xml:ns:xmpp-sasl mechanisms"`
Mechanism []string Mechanism []string `xml:"mechanism"`
} }
type saslAuth struct { type saslAuth struct {
XMLName xml.Name `xml:"urn:ietf:params:xml:ns:xmpp-sasl auth"` XMLName xml.Name `xml:"urn:ietf:params:xml:ns:xmpp-sasl auth"`
Mechanism string `xml:"attr"` Mechanism string `xml:",attr"`
} }
type saslChallenge string type saslChallenge string
@ -316,10 +316,10 @@ type bindBind struct {
type clientMessage struct { type clientMessage struct {
XMLName xml.Name `xml:"jabber:client message"` XMLName xml.Name `xml:"jabber:client message"`
From string `xml:"attr"` From string `xml:",attr"`
Id string `xml:"attr"` Id string `xml:",attr"`
To string `xml:"attr"` To string `xml:",attr"`
Type string `xml:"attr"` // chat, error, groupchat, headline, or normal Type string `xml:",attr"` // chat, error, groupchat, headline, or normal
// These should technically be []clientText, // These should technically be []clientText,
// but string is much more convenient. // but string is much more convenient.
@ -329,17 +329,17 @@ type clientMessage struct {
} }
type clientText struct { type clientText struct {
Lang string `xml:"attr"` Lang string `xml:",attr"`
Body string `xml:"chardata"` Body string `xml:"chardata"`
} }
type clientPresence struct { type clientPresence struct {
XMLName xml.Name `xml:"jabber:client presence"` XMLName xml.Name `xml:"jabber:client presence"`
From string `xml:"attr"` From string `xml:",attr"`
Id string `xml:"attr"` Id string `xml:",attr"`
To string `xml:"attr"` To string `xml:",attr"`
Type string `xml:"attr"` // error, probe, subscribe, subscribed, unavailable, unsubscribe, unsubscribed Type string `xml:",attr"` // error, probe, subscribe, subscribed, unavailable, unsubscribe, unsubscribed
Lang string `xml:"attr"` Lang string `xml:",attr"`
Show string // away, chat, dnd, xa Show string // away, chat, dnd, xa
Status string // sb []clientText Status string // sb []clientText
@ -349,18 +349,18 @@ type clientPresence struct {
type clientIQ struct { // info/query type clientIQ struct { // info/query
XMLName xml.Name `xml:"jabber:client iq"` XMLName xml.Name `xml:"jabber:client iq"`
From string `xml:"attr"` From string `xml:",attr"`
Id string `xml:"attr"` Id string `xml:",attr"`
To string `xml:"attr"` To string `xml:",attr"`
Type string `xml:"attr"` // error, get, result, set Type string `xml:",attr"` // error, get, result, set
Error clientError Error clientError
Bind bindBind Bind bindBind
} }
type clientError struct { type clientError struct {
XMLName xml.Name `xml:"jabber:client error"` XMLName xml.Name `xml:"jabber:client error"`
Code string `xml:"attr"` Code string `xml:",attr"`
Type string `xml:"attr"` Type string `xml:",attr"`
Any xml.Name Any xml.Name
Text string Text string
} }