views:

331

answers:

1

Okay, this isn't a question. All the examples of wokkel and twisted I have seen do not properly observe generated resources in the JID.

Google talk clients built using wokkel/twisted generally break because they do not set the full JID on responses, resulting in (very hidden, low level) errors like:

<message to="[email protected]" from="[email protected]/Example2C2F32A1" type="error"><body>echo: None</body><error code="400" type="modify"><bad-request xmlns="urn:ietf:params:xml:ns:xmpp-stanzas"/><text xmlns="urn:ietf:params:xml:ns:xmpp-stanzas">If set, the 'from' attribute must be set to the user's full JID.</text></error></message>

The full, server issued jid can be obtained in the protocol handler from self.parent.authenticator.jid.full()

So, when sending messages, ensure you use the full jid in your from field, or some servers will not like you and you will pull all your hair out, and cry.

+1  A: 

In this particular case, the better answer to the non-question is that you should not set the from address at all. Every server will happily fill in the blank for you, saving you from figuring out what JID your client has.

Ralph Meijer