/**
 *
 * Copyright © 2014 Florian Schmaus
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.jivesoftware.smackx.delay;

import java.util.Date;

import org.jivesoftware.smack.packet.Packet;
import org.jivesoftware.smack.packet.PacketExtension;
import org.jivesoftware.smackx.delay.packet.DelayInformation;

/**
 * Delayed Delivery (XEP-203)
 *
 * @author Florian Schmaus
 * @see <a href="http://xmpp.org/extensions/xep-0203.html">Delayed Delivery (XEP-203)</a>
 *
 */
public class DelayInformationManager {

    public static final String LEGACY_DELAYED_DELIVERY_NAMESPACE = "jabber:x:delay";
    public static final String LEGACY_DELAYED_DELIVERY_ELEMENT = "x";


    /**
     * Get Delayed Delivery information as defined in XEP-203
     * <p>
     * Prefer {@link #getDelayInformation(Packet)} over this method for backwards compatibility.
     * </p>
     * @param packet
     * @return the Delayed Delivery information or <code>null</code>
     */
    public static DelayInformation getXep203DelayInformation(Packet packet) {
        return DelayInformation.getFrom(packet);
    }

    /**
     * Get Delayed Delivery information as defined in XEP-91
     * <p>
     * Prefer {@link #getDelayInformation(Packet)} over this method for backwards compatibility.
     * </p>
     * @param packet
     * @return the Delayed Delivery information or <code>null</code>
     */
    public static DelayInformation getLegacyDelayInformation(Packet packet) {
        return packet.getExtension(LEGACY_DELAYED_DELIVERY_ELEMENT, LEGACY_DELAYED_DELIVERY_NAMESPACE);
    }

    /**
     * Get Delayed Delivery information. This method first looks for a PacketExtension with the
     * XEP-203 namespace and falls back to the XEP-91 namespace.
     *
     * @param packet
     * @return the Delayed Delivery information or <code>null</code>
     */
    public static DelayInformation getDelayInformation(Packet packet) {
        DelayInformation delayInformation = getXep203DelayInformation(packet);
        if (delayInformation != null) {
            return delayInformation;
        }
        return getLegacyDelayInformation(packet);
    }

    /**
     * Get the Delayed Delivery timestamp or <code>null</code>
     *
     * @param packet
     * @return the Delayed Delivery timestamp or <code>null</code>
     */
    public static Date getDelayTimestamp(Packet packet) {
        DelayInformation delayInformation = getDelayInformation(packet);
        if (delayInformation == null) {
            return null;
        }
        return delayInformation.getStamp();
    }

     /**
     * Check if the given stanza is a delayed stanza as of XEP-203.
     *
     * @param packet
     * @return true if the stanza got delayed.
     */
    public static boolean isDelayedStanza(Packet packet) {
        PacketExtension packetExtension = getDelayInformation(packet);
        return packetExtension != null;
    }
}

@@ -1584,12 +1584,9 @@
 ion.
-getF
+f
 rom(

Use non-deprecated method in DelayInformationManager