I’m writing a XMPP bot in Python (using xmpppy). I want (after user’s request) check his PubSub status (mood, tune) and do something with it. How do I do that?
I know how to parse a stanza send by user when he changes status but I don’t know how to force him to send me such stanza.
Read XEP-163. Essentially, you need to implement the send-side of entity caps (XEP-115), so that you send your presence like this:
When you get get a disco#info request like this:
You respond with the list of features you implement:
Add a +notify to each node name that you want to implicitly subscribe to, and add the resulting string as a feature, as above. Ensuring that the SHA-1 hash in your outbound presence is correct is the only hard part.