forked from jshiffer/go-xmpp
Status message option
This commit is contained in:
parent
f402673c8c
commit
c9bbe151b2
@ -14,6 +14,7 @@ import (
|
||||
var server = flag.String("server", "talk.google.com:443", "server")
|
||||
var username = flag.String("username", "", "username")
|
||||
var password = flag.String("password", "", "password")
|
||||
var status = flag.String("status", "", "status")
|
||||
var notls = flag.Bool("notls", false, "No TLS")
|
||||
var debug = flag.Bool("debug", false, "debug output")
|
||||
var session = flag.Bool("session", false, "use server session")
|
||||
@ -47,7 +48,9 @@ func main() {
|
||||
Password: *password,
|
||||
NoTLS: *notls,
|
||||
Debug: *debug,
|
||||
Session: *session}
|
||||
Session: *session,
|
||||
Status: *status,
|
||||
}
|
||||
|
||||
talk, err = options.NewClient()
|
||||
|
||||
|
7
xmpp.go
7
xmpp.go
@ -133,8 +133,11 @@ type Options struct {
|
||||
// Debug output
|
||||
Debug bool
|
||||
|
||||
//Use server sessions
|
||||
// Use server sessions
|
||||
Session bool
|
||||
|
||||
// Status message
|
||||
Status string
|
||||
}
|
||||
|
||||
// NewClient establishes a new Client connection based on a set of Options.
|
||||
@ -407,7 +410,7 @@ func (c *Client) init(o *Options) error {
|
||||
}
|
||||
|
||||
// We're connected and can now receive and send messages.
|
||||
fmt.Fprintf(c.conn, "<presence xml:lang='en'><show>xa</show><status>I for one welcome our new codebot overlords.</status></presence>")
|
||||
fmt.Fprintf(c.conn, "<presence xml:lang='en'><show>xa</show><status>%s</status></presence>", o.Status)
|
||||
return nil
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user