Commit bbceefd5 authored by Gaston Dombiak's avatar Gaston Dombiak Committed by gaston

Workaround to hide the TO attribute with the fake JID.


git-svn-id: http://svn.igniterealtime.org/svn/repos/messenger/trunk@659 b35dd754-fafc-0310-a699-88a17e54d16e
parent 7219f000
...@@ -91,6 +91,17 @@ public class IQAuthHandler extends IQHandler implements IQAuthInfo { ...@@ -91,6 +91,17 @@ public class IQAuthHandler extends IQHandler implements IQAuthInfo {
response = IQ.createResultIQ(packet); response = IQ.createResultIQ(packet);
probeResponse.setParent(null); probeResponse.setParent(null);
response.setChildElement(probeResponse); response.setChildElement(probeResponse);
// This is a workaround. Since we don't want to have an incorrect TO attribute
// value we need to clean up the TO attribute and send directly the response.
// The TO attribute will contain an incorrect value since we are setting a fake
// JID until the user actually authenticates with the server. We need to send
// the response directly since SocketPacketWriterHandler requires a TO or FROM
// attribute which this response doesn't have.
if (session.getStatus() != Session.STATUS_AUTHENTICATED) {
response.setTo((JID)null);
session.getConnection().deliver(response);
return null;
}
} }
// Otherwise set query // Otherwise set query
else { else {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment