forked from jshiffer/go-xmpp
Merge branch 'master' of github.com:mattn/go-xmpp
This commit is contained in:
commit
e4e8b7448c
@ -40,7 +40,7 @@ func main() {
|
||||
hbox := gtk.HBox(false, 1)
|
||||
dialog.GetVBox().Add(hbox)
|
||||
label := gtk.Label("username:")
|
||||
sgroup.Add(label)
|
||||
sgroup.AddWidget(label)
|
||||
hbox.Add(label)
|
||||
username := gtk.Entry()
|
||||
hbox.Add(username)
|
||||
@ -48,7 +48,7 @@ func main() {
|
||||
hbox = gtk.HBox(false, 1)
|
||||
dialog.GetVBox().Add(hbox)
|
||||
label = gtk.Label("password:")
|
||||
sgroup.Add(label)
|
||||
sgroup.AddWidget(label)
|
||||
hbox.Add(label)
|
||||
password := gtk.Entry()
|
||||
password.SetVisibility(false)
|
||||
|
38
xmpp.go
38
xmpp.go
@ -119,7 +119,7 @@ func (c *Client) Close() error {
|
||||
|
||||
func (c *Client) init(user, passwd string) error {
|
||||
// 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)
|
||||
|
||||
a := strings.SplitN(user, "@", 2)
|
||||
@ -279,12 +279,12 @@ type tlsFailure struct {
|
||||
|
||||
type saslMechanisms struct {
|
||||
XMLName xml.Name `xml:"urn:ietf:params:xml:ns:xmpp-sasl mechanisms"`
|
||||
Mechanism []string
|
||||
Mechanism []string `xml:"mechanism"`
|
||||
}
|
||||
|
||||
type saslAuth struct {
|
||||
XMLName xml.Name `xml:"urn:ietf:params:xml:ns:xmpp-sasl auth"`
|
||||
Mechanism string `xml:"attr"`
|
||||
Mechanism string `xml:",attr"`
|
||||
}
|
||||
|
||||
type saslChallenge string
|
||||
@ -316,10 +316,10 @@ type bindBind struct {
|
||||
|
||||
type clientMessage struct {
|
||||
XMLName xml.Name `xml:"jabber:client message"`
|
||||
From string `xml:"attr"`
|
||||
Id string `xml:"attr"`
|
||||
To string `xml:"attr"`
|
||||
Type string `xml:"attr"` // chat, error, groupchat, headline, or normal
|
||||
From string `xml:",attr"`
|
||||
Id string `xml:",attr"`
|
||||
To string `xml:",attr"`
|
||||
Type string `xml:",attr"` // chat, error, groupchat, headline, or normal
|
||||
|
||||
// These should technically be []clientText,
|
||||
// but string is much more convenient.
|
||||
@ -329,17 +329,17 @@ type clientMessage struct {
|
||||
}
|
||||
|
||||
type clientText struct {
|
||||
Lang string `xml:"attr"`
|
||||
Lang string `xml:",attr"`
|
||||
Body string `xml:"chardata"`
|
||||
}
|
||||
|
||||
type clientPresence struct {
|
||||
XMLName xml.Name `xml:"jabber:client presence"`
|
||||
From string `xml:"attr"`
|
||||
Id string `xml:"attr"`
|
||||
To string `xml:"attr"`
|
||||
Type string `xml:"attr"` // error, probe, subscribe, subscribed, unavailable, unsubscribe, unsubscribed
|
||||
Lang string `xml:"attr"`
|
||||
From string `xml:",attr"`
|
||||
Id string `xml:",attr"`
|
||||
To string `xml:",attr"`
|
||||
Type string `xml:",attr"` // error, probe, subscribe, subscribed, unavailable, unsubscribe, unsubscribed
|
||||
Lang string `xml:",attr"`
|
||||
|
||||
Show string // away, chat, dnd, xa
|
||||
Status string // sb []clientText
|
||||
@ -349,18 +349,18 @@ type clientPresence struct {
|
||||
|
||||
type clientIQ struct { // info/query
|
||||
XMLName xml.Name `xml:"jabber:client iq"`
|
||||
From string `xml:"attr"`
|
||||
Id string `xml:"attr"`
|
||||
To string `xml:"attr"`
|
||||
Type string `xml:"attr"` // error, get, result, set
|
||||
From string `xml:",attr"`
|
||||
Id string `xml:",attr"`
|
||||
To string `xml:",attr"`
|
||||
Type string `xml:",attr"` // error, get, result, set
|
||||
Error clientError
|
||||
Bind bindBind
|
||||
}
|
||||
|
||||
type clientError struct {
|
||||
XMLName xml.Name `xml:"jabber:client error"`
|
||||
Code string `xml:"attr"`
|
||||
Type string `xml:"attr"`
|
||||
Code string `xml:",attr"`
|
||||
Type string `xml:",attr"`
|
||||
Any xml.Name
|
||||
Text string
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user