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 开发者_JAVA技巧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
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.
I don't see the JID being stored as such either, but in auth's sources, line 213, I see
self._User,self._Password,self._Resource=user,password,resource
where self
is the instance of Client
we're authenticating; so maybe you could just recover this info and build yourself a JID from that?
精彩评论