mv xmpp_get_info to other repo

This commit is contained in:
Jesse Kuang 2019-01-12 14:46:18 +08:00
parent a79a0e59ef
commit 65fd08aee2

View File

@ -1,30 +0,0 @@
package xmpp
import (
"fmt"
"time"
)
func (c *Client) RawVersion(from, to, id, version, osName string) error {
body := "<name>go-xmpp</name><version>" + version + "</version><os>" +
osName + "</os>"
_, err := c.RawInformationQuery(from, to, id, "result", "jabber:iq:version",
body)
return err
}
func (c *Client) RawLast(from, to, id string, last int) error {
body := fmt.Sprintf("<query xmlns='jabber:iq:last' "+
"seconds='%d'>Working</query>", last)
_, err := c.RawInformation(from, to, id, "result", body)
return err
}
func (c *Client) RawIQtime(from, to, id string) error {
tt := time.Now()
zone, _ := tt.Zone()
body := fmt.Sprintf("<time xmlns='urn:xmpp:time'>\n<tzo>%s</tzo><utc>%s"+
"</utc></time>", zone, tt.UTC().Format("2006-01-02T15:03:04Z"))
_, err := c.RawInformation(from, to, id, "result", body)
return err
}