From 54ba300dc5c442d82dbcd78cdb995bfd3ce34f02 Mon Sep 17 00:00:00 2001 From: Florian Schmaus Date: Sun, 6 Dec 2015 22:48:22 +0100 Subject: [PATCH] Make EventContentFilter use FlexiableStanzaTypeFilter --- .../java/org/jivesoftware/smackx/pubsub/Node.java | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/smack-extensions/src/main/java/org/jivesoftware/smackx/pubsub/Node.java b/smack-extensions/src/main/java/org/jivesoftware/smackx/pubsub/Node.java index 8053b3494..cdf8e79b1 100644 --- a/smack-extensions/src/main/java/org/jivesoftware/smackx/pubsub/Node.java +++ b/smack-extensions/src/main/java/org/jivesoftware/smackx/pubsub/Node.java @@ -25,8 +25,8 @@ import org.jivesoftware.smack.StanzaListener; import org.jivesoftware.smack.SmackException.NoResponseException; import org.jivesoftware.smack.SmackException.NotConnectedException; import org.jivesoftware.smack.XMPPException.XMPPErrorException; +import org.jivesoftware.smack.filter.FlexibleStanzaTypeFilter; import org.jivesoftware.smack.filter.OrFilter; -import org.jivesoftware.smack.filter.StanzaFilter; import org.jivesoftware.smack.packet.Message; import org.jivesoftware.smack.packet.Stanza; import org.jivesoftware.smack.packet.ExtensionElement; @@ -697,7 +697,7 @@ abstract public class Node * * @author Robin Collier */ - class EventContentFilter implements StanzaFilter + class EventContentFilter extends FlexibleStanzaTypeFilter { private String firstElement; private String secondElement; @@ -713,12 +713,8 @@ abstract public class Node secondElement = secondLevelElement; } - public boolean accept(Stanza packet) - { - if (!(packet instanceof Message)) - return false; - - EventElement event = (EventElement)packet.getExtension("event", PubSubNamespace.EVENT.getXmlns()); + public boolean acceptSpecific(Message message) { + EventElement event = EventElement.from(message); if (event == null) return false;