From 7a57bb7c096f1a596e3b197cfda954c80be4520a Mon Sep 17 00:00:00 2001 From: Florian Schmaus Date: Sun, 12 Apr 2020 12:09:04 +0200 Subject: [PATCH] Rename Stanza.getExtension(String, String) to getExtensionElement() --- .../java/org/jivesoftware/smack/packet/Stanza.java | 4 ++-- .../smackx/carbons/packet/CarbonExtension.java | 4 ++-- .../jivesoftware/smackx/hints/element/NoCopyHint.java | 2 +- .../smackx/hints/element/NoPermanentStoreHint.java | 2 +- .../jivesoftware/smackx/hints/element/NoStoreHint.java | 2 +- .../jivesoftware/smackx/mam/element/MamElements.java | 2 +- .../smackx/muclight/element/MUCLightElements.java | 2 +- .../smackx/sid/element/OriginIdElement.java | 2 +- .../org/jivesoftware/smackx/spoiler/SpoilerTest.java | 6 +++--- .../jivesoftware/smackx/bob/element/BoBExtension.java | 2 +- .../java/org/jivesoftware/smackx/muc/Occupant.java | 2 +- .../main/java/org/jivesoftware/smackx/pubsub/Node.java | 6 +++--- .../org/jivesoftware/smackx/pubsub/PubSubManager.java | 2 +- .../org/jivesoftware/smackx/pubsub/packet/PubSub.java | 2 +- .../org/jivesoftware/smackx/pubsub/util/NodeUtils.java | 2 +- .../org/jivesoftware/smackx/rsm/packet/RSMSet.java | 2 +- .../org/jivesoftware/smackx/xhtmlim/XHTMLManager.java | 2 +- .../smackx/workgroup/agent/AgentRoster.java | 2 +- .../smackx/workgroup/agent/AgentSession.java | 10 +++++----- .../jivesoftware/smackx/workgroup/user/Workgroup.java | 8 ++++---- .../smackx/xevent/MessageEventManager.java | 2 +- .../smackx/xroster/RosterExchangeManager.java | 2 +- .../org/jivesoftware/smackx/omemo/OmemoService.java | 8 ++++---- 23 files changed, 39 insertions(+), 39 deletions(-) diff --git a/smack-core/src/main/java/org/jivesoftware/smack/packet/Stanza.java b/smack-core/src/main/java/org/jivesoftware/smack/packet/Stanza.java index 833ff041a..e55f746da 100644 --- a/smack-core/src/main/java/org/jivesoftware/smack/packet/Stanza.java +++ b/smack-core/src/main/java/org/jivesoftware/smack/packet/Stanza.java @@ -338,7 +338,7 @@ public abstract class Stanza implements StanzaView, TopLevelStreamElement { /** * Returns the first extension of this stanza that has the given namespace. *

- * When possible, use {@link #getExtension(String, String)} instead. + * When possible, use {@link #getExtensionElement(String, String)} instead. *

* * @param namespace the namespace of the extension that is desired. @@ -358,7 +358,7 @@ public abstract class Stanza implements StanzaView, TopLevelStreamElement { * @param namespace the XML element namespace of the extension. * @return the extension, or null if it doesn't exist. */ - public final ExtensionElement getExtension(String elementName, String namespace) { + public final ExtensionElement getExtensionElement(String elementName, String namespace) { if (namespace == null) { return null; } diff --git a/smack-experimental/src/main/java/org/jivesoftware/smackx/carbons/packet/CarbonExtension.java b/smack-experimental/src/main/java/org/jivesoftware/smackx/carbons/packet/CarbonExtension.java index 6fb49ce39..960922d07 100644 --- a/smack-experimental/src/main/java/org/jivesoftware/smackx/carbons/packet/CarbonExtension.java +++ b/smack-experimental/src/main/java/org/jivesoftware/smackx/carbons/packet/CarbonExtension.java @@ -114,9 +114,9 @@ public class CarbonExtension implements ExtensionElement { * @return a Carbon if available, null otherwise. */ public static CarbonExtension from(Message msg) { - CarbonExtension cc = (CarbonExtension) msg.getExtension(Direction.received.name(), NAMESPACE); + CarbonExtension cc = (CarbonExtension) msg.getExtensionElement(Direction.received.name(), NAMESPACE); if (cc == null) - cc = (CarbonExtension) msg.getExtension(Direction.sent.name(), NAMESPACE); + cc = (CarbonExtension) msg.getExtensionElement(Direction.sent.name(), NAMESPACE); return cc; } diff --git a/smack-experimental/src/main/java/org/jivesoftware/smackx/hints/element/NoCopyHint.java b/smack-experimental/src/main/java/org/jivesoftware/smackx/hints/element/NoCopyHint.java index 393fe55fe..a29ae0473 100644 --- a/smack-experimental/src/main/java/org/jivesoftware/smackx/hints/element/NoCopyHint.java +++ b/smack-experimental/src/main/java/org/jivesoftware/smackx/hints/element/NoCopyHint.java @@ -48,7 +48,7 @@ public final class NoCopyHint extends MessageProcessingHint { } public static NoCopyHint from(Message message) { - return (NoCopyHint) message.getExtension(ELEMENT, NAMESPACE); + return (NoCopyHint) message.getExtensionElement(ELEMENT, NAMESPACE); } public static boolean hasHint(Message message) { diff --git a/smack-experimental/src/main/java/org/jivesoftware/smackx/hints/element/NoPermanentStoreHint.java b/smack-experimental/src/main/java/org/jivesoftware/smackx/hints/element/NoPermanentStoreHint.java index 63aea7699..4b0bc7100 100644 --- a/smack-experimental/src/main/java/org/jivesoftware/smackx/hints/element/NoPermanentStoreHint.java +++ b/smack-experimental/src/main/java/org/jivesoftware/smackx/hints/element/NoPermanentStoreHint.java @@ -48,7 +48,7 @@ public final class NoPermanentStoreHint extends MessageProcessingHint { } public static NoPermanentStoreHint from(Message message) { - return (NoPermanentStoreHint) message.getExtension(ELEMENT, NAMESPACE); + return (NoPermanentStoreHint) message.getExtensionElement(ELEMENT, NAMESPACE); } public static boolean hasHint(Message message) { diff --git a/smack-experimental/src/main/java/org/jivesoftware/smackx/hints/element/NoStoreHint.java b/smack-experimental/src/main/java/org/jivesoftware/smackx/hints/element/NoStoreHint.java index 72bc4ff44..b6b9e2a25 100644 --- a/smack-experimental/src/main/java/org/jivesoftware/smackx/hints/element/NoStoreHint.java +++ b/smack-experimental/src/main/java/org/jivesoftware/smackx/hints/element/NoStoreHint.java @@ -48,7 +48,7 @@ public final class NoStoreHint extends MessageProcessingHint { } public static NoStoreHint from(Message message) { - return (NoStoreHint) message.getExtension(ELEMENT, NAMESPACE); + return (NoStoreHint) message.getExtensionElement(ELEMENT, NAMESPACE); } public static boolean hasHint(Message message) { diff --git a/smack-experimental/src/main/java/org/jivesoftware/smackx/mam/element/MamElements.java b/smack-experimental/src/main/java/org/jivesoftware/smackx/mam/element/MamElements.java index 540ffe774..034245a5a 100644 --- a/smack-experimental/src/main/java/org/jivesoftware/smackx/mam/element/MamElements.java +++ b/smack-experimental/src/main/java/org/jivesoftware/smackx/mam/element/MamElements.java @@ -140,7 +140,7 @@ public class MamElements { } public static MamResultExtension from(Message message) { - return (MamResultExtension) message.getExtension(ELEMENT, NAMESPACE); + return (MamResultExtension) message.getExtensionElement(ELEMENT, NAMESPACE); } } diff --git a/smack-experimental/src/main/java/org/jivesoftware/smackx/muclight/element/MUCLightElements.java b/smack-experimental/src/main/java/org/jivesoftware/smackx/muclight/element/MUCLightElements.java index ba14e5f62..33861b29e 100644 --- a/smack-experimental/src/main/java/org/jivesoftware/smackx/muclight/element/MUCLightElements.java +++ b/smack-experimental/src/main/java/org/jivesoftware/smackx/muclight/element/MUCLightElements.java @@ -233,7 +233,7 @@ public abstract class MUCLightElements { } public static ConfigurationsChangeExtension from(Message message) { - return (ConfigurationsChangeExtension) message.getExtension(ConfigurationsChangeExtension.ELEMENT, ConfigurationsChangeExtension.NAMESPACE); + return (ConfigurationsChangeExtension) message.getExtensionElement(ConfigurationsChangeExtension.ELEMENT, ConfigurationsChangeExtension.NAMESPACE); } } diff --git a/smack-experimental/src/main/java/org/jivesoftware/smackx/sid/element/OriginIdElement.java b/smack-experimental/src/main/java/org/jivesoftware/smackx/sid/element/OriginIdElement.java index 10282b70b..585be47a6 100644 --- a/smack-experimental/src/main/java/org/jivesoftware/smackx/sid/element/OriginIdElement.java +++ b/smack-experimental/src/main/java/org/jivesoftware/smackx/sid/element/OriginIdElement.java @@ -82,7 +82,7 @@ public class OriginIdElement extends StableAndUniqueIdElement { * @return origin-id element */ public static OriginIdElement getOriginId(Message message) { - return (OriginIdElement) message.getExtension(OriginIdElement.ELEMENT, StableUniqueStanzaIdManager.NAMESPACE); + return (OriginIdElement) message.getExtensionElement(OriginIdElement.ELEMENT, StableUniqueStanzaIdManager.NAMESPACE); } @Override diff --git a/smack-experimental/src/test/java/org/jivesoftware/smackx/spoiler/SpoilerTest.java b/smack-experimental/src/test/java/org/jivesoftware/smackx/spoiler/SpoilerTest.java index 33104f575..165c4be40 100644 --- a/smack-experimental/src/test/java/org/jivesoftware/smackx/spoiler/SpoilerTest.java +++ b/smack-experimental/src/test/java/org/jivesoftware/smackx/spoiler/SpoilerTest.java @@ -44,7 +44,7 @@ public class SpoilerTest extends SmackTestSuite { Message message = StanzaBuilder.buildMessage().build(); SpoilerElement.addSpoiler(message); - SpoilerElement empty = (SpoilerElement) message.getExtension(SpoilerElement.ELEMENT, SpoilerManager.NAMESPACE_0); + SpoilerElement empty = (SpoilerElement) message.getExtensionElement(SpoilerElement.ELEMENT, SpoilerManager.NAMESPACE_0); assertNull(empty.getHint()); assertNull(empty.getLanguage()); @@ -63,7 +63,7 @@ public class SpoilerTest extends SmackTestSuite { Message message = StanzaBuilder.buildMessage().build(); SpoilerElement.addSpoiler(message, "Love story end"); - SpoilerElement withHint = (SpoilerElement) message.getExtension(SpoilerElement.ELEMENT, SpoilerManager.NAMESPACE_0); + SpoilerElement withHint = (SpoilerElement) message.getExtensionElement(SpoilerElement.ELEMENT, SpoilerManager.NAMESPACE_0); assertEquals("Love story end", withHint.getHint()); assertNull(withHint.getLanguage()); @@ -83,7 +83,7 @@ public class SpoilerTest extends SmackTestSuite { Message message = StanzaBuilder.buildMessage().build(); SpoilerElement.addSpoiler(message, "de", "Der Kuchen ist eine Lüge!"); - SpoilerElement i18nHint = (SpoilerElement) message.getExtension(SpoilerElement.ELEMENT, SpoilerManager.NAMESPACE_0); + SpoilerElement i18nHint = (SpoilerElement) message.getExtensionElement(SpoilerElement.ELEMENT, SpoilerManager.NAMESPACE_0); assertEquals("Der Kuchen ist eine Lüge!", i18nHint.getHint()); assertEquals("de", i18nHint.getLanguage()); diff --git a/smack-extensions/src/main/java/org/jivesoftware/smackx/bob/element/BoBExtension.java b/smack-extensions/src/main/java/org/jivesoftware/smackx/bob/element/BoBExtension.java index a0ee8af9e..442474fa1 100644 --- a/smack-extensions/src/main/java/org/jivesoftware/smackx/bob/element/BoBExtension.java +++ b/smack-extensions/src/main/java/org/jivesoftware/smackx/bob/element/BoBExtension.java @@ -91,7 +91,7 @@ public class BoBExtension extends XHTMLExtension { } public static BoBExtension from(Message message) { - return (BoBExtension) message.getExtension(ELEMENT, NAMESPACE); + return (BoBExtension) message.getExtensionElement(ELEMENT, NAMESPACE); } } diff --git a/smack-extensions/src/main/java/org/jivesoftware/smackx/muc/Occupant.java b/smack-extensions/src/main/java/org/jivesoftware/smackx/muc/Occupant.java index babce3829..3e8884c64 100644 --- a/smack-extensions/src/main/java/org/jivesoftware/smackx/muc/Occupant.java +++ b/smack-extensions/src/main/java/org/jivesoftware/smackx/muc/Occupant.java @@ -53,7 +53,7 @@ public class Occupant { } Occupant(Presence presence) { - MUCUser mucUser = (MUCUser) presence.getExtension("x", + MUCUser mucUser = (MUCUser) presence.getExtensionElement("x", "http://jabber.org/protocol/muc#user"); MUCItem item = mucUser.getItem(); this.jid = item.getJid(); diff --git a/smack-extensions/src/main/java/org/jivesoftware/smackx/pubsub/Node.java b/smack-extensions/src/main/java/org/jivesoftware/smackx/pubsub/Node.java index 2a43636b2..88decd520 100644 --- a/smack-extensions/src/main/java/org/jivesoftware/smackx/pubsub/Node.java +++ b/smack-extensions/src/main/java/org/jivesoftware/smackx/pubsub/Node.java @@ -686,7 +686,7 @@ public abstract class Node { @Override @SuppressWarnings({ "rawtypes", "unchecked" }) public void processStanza(Stanza packet) { - EventElement event = (EventElement) packet.getExtension("event", PubSubNamespace.event.getXmlns()); + EventElement event = (EventElement) packet.getExtensionElement("event", PubSubNamespace.event.getXmlns()); ItemsExtension itemsElem = (ItemsExtension) event.getEvent(); ItemPublishEvent eventItems = new ItemPublishEvent(itemsElem.getNode(), itemsElem.getItems(), getSubscriptionIds(packet), DelayInformationManager.getDelayTimestamp(packet)); // TODO: Use AsyncButOrdered (with Node as Key?) @@ -710,7 +710,7 @@ public abstract class Node { @Override public void processStanza(Stanza packet) { // CHECKSTYLE:OFF - EventElement event = (EventElement) packet.getExtension("event", PubSubNamespace.event.getXmlns()); + EventElement event = (EventElement) packet.getExtensionElement("event", PubSubNamespace.event.getXmlns()); List extList = event.getExtensions(); @@ -749,7 +749,7 @@ public abstract class Node { @Override public void processStanza(Stanza packet) { - EventElement event = (EventElement) packet.getExtension("event", PubSubNamespace.event.getXmlns()); + EventElement event = (EventElement) packet.getExtensionElement("event", PubSubNamespace.event.getXmlns()); ConfigurationEvent config = (ConfigurationEvent) event.getEvent(); // TODO: Use AsyncButOrdered (with Node as Key?) diff --git a/smack-extensions/src/main/java/org/jivesoftware/smackx/pubsub/PubSubManager.java b/smack-extensions/src/main/java/org/jivesoftware/smackx/pubsub/PubSubManager.java index 420c36f5a..7d91e41ca 100644 --- a/smack-extensions/src/main/java/org/jivesoftware/smackx/pubsub/PubSubManager.java +++ b/smack-extensions/src/main/java/org/jivesoftware/smackx/pubsub/PubSubManager.java @@ -503,7 +503,7 @@ public final class PubSubManager extends Manager { */ public List getSubscriptions() throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException { Stanza reply = sendPubsubPacket(Type.get, new NodeExtension(PubSubElementType.SUBSCRIPTIONS), null); - SubscriptionsExtension subElem = (SubscriptionsExtension) reply.getExtension(PubSubElementType.SUBSCRIPTIONS.getElementName(), PubSubElementType.SUBSCRIPTIONS.getNamespace().getXmlns()); + SubscriptionsExtension subElem = (SubscriptionsExtension) reply.getExtensionElement(PubSubElementType.SUBSCRIPTIONS.getElementName(), PubSubElementType.SUBSCRIPTIONS.getNamespace().getXmlns()); return subElem.getSubscriptions(); } diff --git a/smack-extensions/src/main/java/org/jivesoftware/smackx/pubsub/packet/PubSub.java b/smack-extensions/src/main/java/org/jivesoftware/smackx/pubsub/packet/PubSub.java index e8a6f4749..a71410139 100644 --- a/smack-extensions/src/main/java/org/jivesoftware/smackx/pubsub/packet/PubSub.java +++ b/smack-extensions/src/main/java/org/jivesoftware/smackx/pubsub/packet/PubSub.java @@ -51,7 +51,7 @@ public class PubSub extends IQ { @SuppressWarnings("unchecked") public PE getExtension(PubSubElementType elem) { - return (PE) getExtension(elem.getElementName(), elem.getNamespace().getXmlns()); + return (PE) getExtensionElement(elem.getElementName(), elem.getNamespace().getXmlns()); } /** diff --git a/smack-extensions/src/main/java/org/jivesoftware/smackx/pubsub/util/NodeUtils.java b/smack-extensions/src/main/java/org/jivesoftware/smackx/pubsub/util/NodeUtils.java index 7b0d7e7f8..9d386e609 100644 --- a/smack-extensions/src/main/java/org/jivesoftware/smackx/pubsub/util/NodeUtils.java +++ b/smack-extensions/src/main/java/org/jivesoftware/smackx/pubsub/util/NodeUtils.java @@ -37,7 +37,7 @@ public class NodeUtils { * @return The configuration form */ public static ConfigureForm getFormFromPacket(Stanza packet, PubSubElementType elem) { - FormNode config = (FormNode) packet.getExtension(elem.getElementName(), elem.getNamespace().getXmlns()); + FormNode config = (FormNode) packet.getExtensionElement(elem.getElementName(), elem.getNamespace().getXmlns()); Form formReply = config.getForm(); return new ConfigureForm(formReply); } diff --git a/smack-extensions/src/main/java/org/jivesoftware/smackx/rsm/packet/RSMSet.java b/smack-extensions/src/main/java/org/jivesoftware/smackx/rsm/packet/RSMSet.java index e96f74bea..cd3703938 100644 --- a/smack-extensions/src/main/java/org/jivesoftware/smackx/rsm/packet/RSMSet.java +++ b/smack-extensions/src/main/java/org/jivesoftware/smackx/rsm/packet/RSMSet.java @@ -151,7 +151,7 @@ public class RSMSet implements ExtensionElement { } public static RSMSet from(Stanza packet) { - return (RSMSet) packet.getExtension(ELEMENT, NAMESPACE); + return (RSMSet) packet.getExtensionElement(ELEMENT, NAMESPACE); } public static RSMSet newAfter(String after) { diff --git a/smack-extensions/src/main/java/org/jivesoftware/smackx/xhtmlim/XHTMLManager.java b/smack-extensions/src/main/java/org/jivesoftware/smackx/xhtmlim/XHTMLManager.java index 6a72b855c..de2def875 100644 --- a/smack-extensions/src/main/java/org/jivesoftware/smackx/xhtmlim/XHTMLManager.java +++ b/smack-extensions/src/main/java/org/jivesoftware/smackx/xhtmlim/XHTMLManager.java @@ -89,7 +89,7 @@ public class XHTMLManager { * @return a boolean indicating whether the message is an XHTML message */ public static boolean isXHTMLMessage(Message message) { - return message.getExtension(XHTMLExtension.ELEMENT, XHTMLExtension.NAMESPACE) != null; + return message.getExtensionElement(XHTMLExtension.ELEMENT, XHTMLExtension.NAMESPACE) != null; } /** diff --git a/smack-legacy/src/main/java/org/jivesoftware/smackx/workgroup/agent/AgentRoster.java b/smack-legacy/src/main/java/org/jivesoftware/smackx/workgroup/agent/AgentRoster.java index ab7187b2e..fb970d8fd 100644 --- a/smack-legacy/src/main/java/org/jivesoftware/smackx/workgroup/agent/AgentRoster.java +++ b/smack-legacy/src/main/java/org/jivesoftware/smackx/workgroup/agent/AgentRoster.java @@ -317,7 +317,7 @@ public class AgentRoster { // for a particular user a map with the presence packets saved for each resource. if (presence.getType() == Presence.Type.available) { // Ignore the presence packet unless it has an agent status extension. - AgentStatus agentStatus = (AgentStatus) presence.getExtension( + AgentStatus agentStatus = (AgentStatus) presence.getExtensionElement( AgentStatus.ELEMENT_NAME, AgentStatus.NAMESPACE); if (agentStatus == null) { return; diff --git a/smack-legacy/src/main/java/org/jivesoftware/smackx/workgroup/agent/AgentSession.java b/smack-legacy/src/main/java/org/jivesoftware/smackx/workgroup/agent/AgentSession.java index 0b8022dfc..a090c5705 100644 --- a/smack-legacy/src/main/java/org/jivesoftware/smackx/workgroup/agent/AgentSession.java +++ b/smack-legacy/src/main/java/org/jivesoftware/smackx/workgroup/agent/AgentSession.java @@ -784,7 +784,7 @@ public class AgentSession { } // QueueOverview packet extensions contain basic information about a queue. - QueueOverview queueOverview = (QueueOverview) presence.getExtension(QueueOverview.ELEMENT_NAME, QueueOverview.NAMESPACE); + QueueOverview queueOverview = (QueueOverview) presence.getExtensionElement(QueueOverview.ELEMENT_NAME, QueueOverview.NAMESPACE); if (queueOverview != null) { if (queueOverview.getStatus() == null) { queue.setStatus(WorkgroupQueue.Status.CLOSED); @@ -803,7 +803,7 @@ public class AgentSession { // QueueDetails packet extensions contain information about the users in // a queue. - QueueDetails queueDetails = (QueueDetails) packet.getExtension(QueueDetails.ELEMENT_NAME, QueueDetails.NAMESPACE); + QueueDetails queueDetails = (QueueDetails) packet.getExtensionElement(QueueDetails.ELEMENT_NAME, QueueDetails.NAMESPACE); if (queueDetails != null) { queue.setUsers(queueDetails.getUsers()); // Fire event. @@ -812,7 +812,7 @@ public class AgentSession { } // Notify agent packets gives an overview of agent activity in a queue. - StandardExtensionElement notifyAgents = (StandardExtensionElement) presence.getExtension("notify-agents", "http://jabber.org/protocol/workgroup"); + StandardExtensionElement notifyAgents = (StandardExtensionElement) presence.getExtensionElement("notify-agents", "http://jabber.org/protocol/workgroup"); if (notifyAgents != null) { int currentChats = Integer.parseInt(notifyAgents.getFirstElement("current-chats", "http://jabber.org/protocol/workgroup").getText()); int maxChats = Integer.parseInt(notifyAgents.getFirstElement("max-chats", "http://jabber.org/protocol/workgroup").getText()); @@ -833,13 +833,13 @@ public class AgentSession { String sessionID = null; Map> metaData = null; - SessionID sessionIDExt = (SessionID) message.getExtension(SessionID.ELEMENT_NAME, + SessionID sessionIDExt = (SessionID) message.getExtensionElement(SessionID.ELEMENT_NAME, SessionID.NAMESPACE); if (sessionIDExt != null) { sessionID = sessionIDExt.getSessionID(); } - MetaData metaDataExt = (MetaData) message.getExtension(MetaData.ELEMENT_NAME, + MetaData metaDataExt = (MetaData) message.getExtensionElement(MetaData.ELEMENT_NAME, MetaData.NAMESPACE); if (metaDataExt != null) { metaData = metaDataExt.getMetaData(); diff --git a/smack-legacy/src/main/java/org/jivesoftware/smackx/workgroup/user/Workgroup.java b/smack-legacy/src/main/java/org/jivesoftware/smackx/workgroup/user/Workgroup.java index cf6da6015..c4ad8134c 100644 --- a/smack-legacy/src/main/java/org/jivesoftware/smackx/workgroup/user/Workgroup.java +++ b/smack-legacy/src/main/java/org/jivesoftware/smackx/workgroup/user/Workgroup.java @@ -515,8 +515,8 @@ public class Workgroup { if (packet instanceof Message) { Message msg = (Message) packet; // Check to see if the user left the queue. - ExtensionElement pe = msg.getExtension("depart-queue", "http://jabber.org/protocol/workgroup"); - ExtensionElement queueStatus = msg.getExtension("queue-status", "http://jabber.org/protocol/workgroup"); + ExtensionElement pe = msg.getExtensionElement("depart-queue", "http://jabber.org/protocol/workgroup"); + ExtensionElement queueStatus = msg.getExtensionElement("queue-status", "http://jabber.org/protocol/workgroup"); if (pe != null) { fireQueueDepartedEvent(); @@ -539,13 +539,13 @@ public class Workgroup { String sessionID = null; Map> metaData = null; - pe = msg.getExtension(SessionID.ELEMENT_NAME, + pe = msg.getExtensionElement(SessionID.ELEMENT_NAME, SessionID.NAMESPACE); if (pe != null) { sessionID = ((SessionID) pe).getSessionID(); } - pe = msg.getExtension(MetaData.ELEMENT_NAME, + pe = msg.getExtensionElement(MetaData.ELEMENT_NAME, MetaData.NAMESPACE); if (pe != null) { metaData = ((MetaData) pe).getMetaData(); diff --git a/smack-legacy/src/main/java/org/jivesoftware/smackx/xevent/MessageEventManager.java b/smack-legacy/src/main/java/org/jivesoftware/smackx/xevent/MessageEventManager.java index 267c5e39a..1d74bc69b 100644 --- a/smack-legacy/src/main/java/org/jivesoftware/smackx/xevent/MessageEventManager.java +++ b/smack-legacy/src/main/java/org/jivesoftware/smackx/xevent/MessageEventManager.java @@ -82,7 +82,7 @@ public final class MessageEventManager extends Manager { @Override public void processStanza(Stanza packet) { Message message = (Message) packet; - MessageEvent messageEvent = (MessageEvent) message.getExtension("x", "jabber:x:event"); + MessageEvent messageEvent = (MessageEvent) message.getExtensionElement("x", "jabber:x:event"); if (messageEvent.isMessageEventRequest()) { // Fire event for requests of message events for (String eventType : messageEvent.getEventTypes()) diff --git a/smack-legacy/src/main/java/org/jivesoftware/smackx/xroster/RosterExchangeManager.java b/smack-legacy/src/main/java/org/jivesoftware/smackx/xroster/RosterExchangeManager.java index eabcd40ad..baac6db8c 100644 --- a/smack-legacy/src/main/java/org/jivesoftware/smackx/xroster/RosterExchangeManager.java +++ b/smack-legacy/src/main/java/org/jivesoftware/smackx/xroster/RosterExchangeManager.java @@ -84,7 +84,7 @@ public class RosterExchangeManager { @Override public void processStanza(Stanza packet) { Message message = (Message) packet; - RosterExchange rosterExchange = (RosterExchange) message.getExtension(ELEMENT, NAMESPACE); + RosterExchange rosterExchange = (RosterExchange) message.getExtensionElement(ELEMENT, NAMESPACE); // Fire event for roster exchange listeners fireRosterExchangeListeners(message.getFrom(), rosterExchange.getRosterEntries()); } diff --git a/smack-omemo/src/main/java/org/jivesoftware/smackx/omemo/OmemoService.java b/smack-omemo/src/main/java/org/jivesoftware/smackx/omemo/OmemoService.java index 372579b61..e3a502251 100644 --- a/smack-omemo/src/main/java/org/jivesoftware/smackx/omemo/OmemoService.java +++ b/smack-omemo/src/main/java/org/jivesoftware/smackx/omemo/OmemoService.java @@ -1051,7 +1051,7 @@ public abstract class OmemoService