mirror of
https://github.com/FluuxIO/go-xmpp.git
synced 2026-05-23 04:23:45 -07:00
Merge pull request #84 from joyrex2001/master
Add SendKeepAlive method to send "whitespace keepalive"
This commit is contained in:
@@ -633,6 +633,11 @@ func (c *Client) SendPresence(presence Presence) (n int, err error) {
|
||||
return fmt.Fprintf(c.conn, "<presence from='%s' to='%s'/>", xmlEscape(presence.From), xmlEscape(presence.To))
|
||||
}
|
||||
|
||||
// SendKeepAlive sends a "whitespace keepalive" as described in chapter 4.6.1 of RFC6120.
|
||||
func (c *Client) SendKeepAlive() (n int, err error) {
|
||||
return fmt.Fprintf(c.conn," ")
|
||||
}
|
||||
|
||||
// SendHtml sends the message as HTML as defined by XEP-0071
|
||||
func (c *Client) SendHtml(chat Chat) (n int, err error) {
|
||||
return fmt.Fprintf(c.conn, "<message to='%s' type='%s' xml:lang='en'>"+
|
||||
|
||||
Reference in New Issue
Block a user