diff --git a/smack-extensions/src/main/java/org/jivesoftware/smackx/avatar/UserAvatarManager.java b/smack-extensions/src/main/java/org/jivesoftware/smackx/avatar/UserAvatarManager.java index 03b22501f..fe961ae88 100644 --- a/smack-extensions/src/main/java/org/jivesoftware/smackx/avatar/UserAvatarManager.java +++ b/smack-extensions/src/main/java/org/jivesoftware/smackx/avatar/UserAvatarManager.java @@ -161,7 +161,7 @@ public final class UserAvatarManager extends Manager { */ public void disable() { serviceDiscoveryManager.removeFeature(FEATURE_METADATA); - pepManager.addPepListener(metadataExtensionListener); + pepManager.removePepListener(metadataExtensionListener); } /** @@ -493,15 +493,11 @@ public final class UserAvatarManager extends Manager { private final PepListener metadataExtensionListener = new PepListener() { @Override public void eventReceived(EntityBareJid from, EventElement event, Message message) { - if (!MetadataExtension.NAMESPACE.equals(event.getNamespace())) { + if (!MetadataExtension.NAMESPACE.equals(event.getEvent().getNode())) { // Totally not of interest for us. return; } - if (!MetadataExtension.ELEMENT.equals(event.getElementName())) { - return; - } - for (ExtensionElement items : event.getExtensions()) { if (!(items instanceof ItemsExtension)) { continue; @@ -531,5 +527,4 @@ public final class UserAvatarManager extends Manager { } } }; - }