mirror of
https://github.com/vanitasvitae/Smack.git
synced 2025-12-14 15:01:07 +01:00
Rename PacketListener to StanzaListener
and add the PacketListener as deprecated interface.
This commit is contained in:
parent
d4a6d8e653
commit
75ec271c6c
40 changed files with 305 additions and 279 deletions
|
|
@ -20,7 +20,7 @@ package org.jivesoftware.smackx.pep;
|
|||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.jivesoftware.smack.PacketListener;
|
||||
import org.jivesoftware.smack.StanzaListener;
|
||||
import org.jivesoftware.smack.SmackException.NotConnectedException;
|
||||
import org.jivesoftware.smack.XMPPConnection;
|
||||
import org.jivesoftware.smack.filter.StanzaExtensionFilter;
|
||||
|
|
@ -65,7 +65,7 @@ public class PEPManager {
|
|||
private XMPPConnection connection;
|
||||
|
||||
private StanzaFilter packetFilter = new StanzaExtensionFilter("event", "http://jabber.org/protocol/pubsub#event");
|
||||
private PacketListener packetListener;
|
||||
private StanzaListener packetListener;
|
||||
|
||||
/**
|
||||
* Creates a new PEP exchange manager.
|
||||
|
|
@ -134,7 +134,7 @@ public class PEPManager {
|
|||
|
||||
private void init() {
|
||||
// Listens for all roster exchange packets and fire the roster exchange listeners.
|
||||
packetListener = new PacketListener() {
|
||||
packetListener = new StanzaListener() {
|
||||
public void processPacket(Stanza packet) {
|
||||
Message message = (Message) packet;
|
||||
PEPEvent event = (PEPEvent) message.getExtension("event", "http://jabber.org/protocol/pubsub#event");
|
||||
|
|
@ -142,12 +142,12 @@ public class PEPManager {
|
|||
firePEPListeners(message.getFrom(), event);
|
||||
}
|
||||
};
|
||||
connection.addSyncPacketListener(packetListener, packetFilter);
|
||||
connection.addSyncStanzaListener(packetListener, packetFilter);
|
||||
}
|
||||
|
||||
public void destroy() {
|
||||
if (connection != null)
|
||||
connection.removeSyncPacketListener(packetListener);
|
||||
connection.removeSyncStanzaListener(packetListener);
|
||||
}
|
||||
|
||||
protected void finalize() throws Throwable {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue