xmppo / go-xmpp

Go XMPP Library (From Yasuhiro Matsumoto and based on the code from Russ Cox)
https://golang.org/
BSD 3-Clause "New" or "Revised" License
526 stars 170 forks source link

Extend SendPresence() to at least minimal useful form #149

Closed eleksir closed 1 year ago

eleksir commented 1 year ago

Looks like SendPresence() function is stub: https://github.com/mattn/go-xmpp/blob/bef3e549f7192032a4acf2bb73d359bdf9f060ca/xmpp.go#L1087-L1089

Seems it just sends "from" and "to" to StanzaWriter (which is io.Writer iface) but does not send actual status, as per https://www.ietf.org/rfc/rfc3921.txt, paragraph 2.2.

Dunno if it is designed to "be like this". If not, i'll spend a couple of hours to extend it to minimal fatness, to be able to fetch all required fields from Presence struct. And PR it.

(I just want to set statuses "Unavailable"/"Ready to chat" for my bot)

eleksir commented 1 year ago

Okay, made PR. https://github.com/mattn/go-xmpp/pull/150