diff options
author | Nick Hudson <nick.hudson@isode.com> | 2014-02-03 20:46:23 (GMT) |
---|---|---|
committer | Nick Hudson <nick.hudson@isode.com> | 2014-02-03 21:54:21 (GMT) |
commit | 535e1a979a164f807aa64bf2df2bb36e7015ff17 (patch) | |
tree | baf2e95bc6f33e99512842cf1ad78c715c45a3c0 /src/com/isode/stroke/queries/IQRouter.java | |
parent | 2a1c515b337bde1ad4a95888902cd7c9a8ef1aab (diff) | |
download | stroke-535e1a979a164f807aa64bf2df2bb36e7015ff17.zip stroke-535e1a979a164f807aa64bf2df2bb36e7015ff17.tar.bz2 |
Check sender on incoming IQ responses
This patch corresponds with the Swiften commit
5f1cb0d768265347bc80862c33f5967f07759b10 whose comment reads
Release-Notes: Fixed a bug whereby the sender of an iq wasn't being
checked before matching it to a request.
Note that since the Swiften change, other modifications have been made
to the affected files, and these modifications are not reflected in
this patch.
Test-information:
Code builds. Ran with MLC to make sure things all seem to work OK.
Change-Id: Ife96925d4d728bc0fe749d6b5b849fbe4e866315
Diffstat (limited to 'src/com/isode/stroke/queries/IQRouter.java')
-rw-r--r-- | src/com/isode/stroke/queries/IQRouter.java | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/src/com/isode/stroke/queries/IQRouter.java b/src/com/isode/stroke/queries/IQRouter.java index bb4dafa..f35cab4 100644 --- a/src/com/isode/stroke/queries/IQRouter.java +++ b/src/com/isode/stroke/queries/IQRouter.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010, Isode Limited, London, England. + * Copyright (c) 2010-2014, Isode Limited, London, England. * All rights reserved. */ /* @@ -13,6 +13,7 @@ import java.util.Vector; import com.isode.stroke.elements.ErrorPayload; import com.isode.stroke.elements.IQ; import com.isode.stroke.signals.Slot1; +import com.isode.stroke.jid.JID; /** * This class is responsible for routing all IQ stanzas to the handlers. It's @@ -26,6 +27,7 @@ public class IQRouter { private final Vector<IQHandler> handlers_ = new Vector<IQHandler>(); private final IQChannel channel_; + private JID jid_; public IQRouter(IQChannel channel) { channel_ = channel; @@ -75,4 +77,20 @@ public class IQRouter { sendIQ(IQ.createError(iq.getFrom(), iq.getID(), ErrorPayload.Condition.FeatureNotImplemented, ErrorPayload.Type.Cancel)); } } + + /** + * Sets the JID of this IQ router. + * + * This JID is used by requests to check whether incoming results + * are addressed correctly + * @param jid the JID + */ + public void setJID(final JID jid) { + jid_ = jid; + } + + public JID getJID() { + return jid_; + } + } |