1
0
Fork 0
mirror of https://github.com/vanitasvitae/Smack.git synced 2025-12-14 15:01:07 +01:00

Replace PacketInterceptor with PacketListener

both serve the same purpose: As callback for Packets. There is no need
to have both, so remace PacketInterceptor and let PacketListener take
its place. Some classes like ChatStateManager can now use
MessageListener as interceptor callback, which is more convenient.
This commit is contained in:
Florian Schmaus 2014-10-12 19:19:44 +02:00
parent fd7b747987
commit 63d52f6eaa
8 changed files with 57 additions and 95 deletions

View file

@ -22,7 +22,6 @@ import org.jivesoftware.smack.SmackException.NotConnectedException;
import org.jivesoftware.smack.XMPPConnection;
import org.jivesoftware.smack.ConnectionCreationListener;
import org.jivesoftware.smack.Manager;
import org.jivesoftware.smack.PacketInterceptor;
import org.jivesoftware.smack.PacketListener;
import org.jivesoftware.smack.XMPPConnectionRegistry;
import org.jivesoftware.smack.XMPPException.XMPPErrorException;
@ -344,8 +343,8 @@ public class EntityCapsManager extends Manager {
// Intercept presence packages and add caps data when intended.
// XEP-0115 specifies that a client SHOULD include entity capabilities
// with every presence notification it sends.
PacketInterceptor packetInterceptor = new PacketInterceptor() {
public void interceptPacket(Packet packet) {
PacketListener packetInterceptor = new PacketListener() {
public void processPacket(Packet packet) {
if (!entityCapsEnabled)
return;