mirror of
https://codeberg.org/Mercury-IM/Smack
synced 2024-11-26 00:02:06 +01:00
Make EventContentFilter use FlexiableStanzaTypeFilter<Message>
This commit is contained in:
parent
db72917bb4
commit
54ba300dc5
1 changed files with 4 additions and 8 deletions
|
@ -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<Message>
|
||||
{
|
||||
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;
|
||||
|
|
Loading…
Reference in a new issue