package xmpp
import (
"fmt"
"runtime"
"time"
)
func (c *Client) SendVersion(id, toServer, fromU string) error {
_, err := fmt.Fprintf(c.conn, "", xmlEscape(fromU), xmlEscape(toServer), xmlEscape(id))
if err != nil {
return err
}
_, err = fmt.Fprintf(c.conn, ""+
"go-xmpp0.1%s"+
"\n", runtime.GOOS)
return err
}
func (c *Client) SendIQLast(id, toServer, fromU string) error {
ss := fmt.Sprintf("\n", xmlEscape(fromU), xmlEscape(toServer), xmlEscape(id))
tt := time.Now().Sub(c.loginTime)
ss += fmt.Sprintf("Working\n", int(tt.Seconds()))
_, err := fmt.Fprint(c.conn, ss)
return err
}
func (c *Client) SendIQtime(id, toServer, fromU string) error {
ss := fmt.Sprintf("\n", xmlEscape(fromU), xmlEscape(toServer), xmlEscape(id))
tt := time.Now()
zoneN, _ := tt.Zone()
ss += fmt.Sprintf("\n", zoneN,
tt.UTC().Format("2006-01-02T15:03:04Z"))
_, err := fmt.Fprint(c.conn, ss)
return err
}