Merge pull request #53 from Like-all/master

Subscription handling
This commit is contained in:
mattn 2015-04-14 09:11:45 +09:00
commit 404638fb3d

20
xmpp_subscription.go Normal file
View File

@ -0,0 +1,20 @@
package xmpp
import (
"fmt"
)
func (c* Client) ApproveSubscription(jid string) {
fmt.Fprintf(c.conn, "<presence to='%s' type='subscribed'/>",
xmlEscape(jid))
}
func (c* Client) RevokeSubscription(jid string) {
fmt.Fprintf(c.conn, "<presence to='%s' type='unsubscribed'/>",
xmlEscape(jid))
}
func (c* Client) RequestSubscription(jid string) {
fmt.Fprintf(c.conn, "<presence to='%s' type='subscribe'/>",
xmlEscape(jid))
}