1
0
Fork 0
mirror of https://codeberg.org/Mercury-IM/Smack synced 2024-11-24 07:12:05 +01:00

Fix pep usage

This commit is contained in:
Paul Schaub 2020-02-09 19:44:29 +01:00
parent cceb30c52f
commit c6e9e5c717

View file

@ -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 {
}
}
};
}