pythonxmppxmpppy

Where is the full JID value when using xmpppy?


Where do I find the full JID value after connecting and authenticating against a Jabber server when using the xmpppy library?

I need the full JID for a subsequent Iq call to the server. Specifying the bare JID (user@domain.com) results in the following error:

If set, the 'from' attribute must be set to the user's full JID

I have read through the online API and looked at some of the source code but still cannot find it.

The full JID looks like this: user@domain.com/resource


Solution

  • Use the non-underbar versions:

    c = xmpp.client.Client(...)
    # connect
    jid = xmpp.JID(node=c.User, domain=c.Server, resource=c.Resource)
    

    However, there is no need to set a from address. The server will do this for you for all of the stanzas you send.