Merge pull request #70 from tcriess/master

Add SendPresence, add join muc with history, add function return valu…
This commit is contained in:
mattn
2016-04-11 19:32:53 +09:00
2 changed files with 105 additions and 14 deletions
+4
View File
@@ -614,6 +614,10 @@ func (c *Client) SendOrg(org string) (n int, err error) {
return fmt.Fprint(c.conn, org)
}
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))
}
// 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'>"+