All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.lantern.LanternXmppUtils Maven / Gradle / Ivy

package org.lantern;

import org.apache.commons.lang3.StringUtils;


public class LanternXmppUtils {

    /** This is misspelled -- use jidToResourceId */
    @Deprecated
    public static String jidToInstanceId(final String fullId) {
        return fullId.split("/", 2)[1];
    }

    public static String jidToResourceId(final String fullId) {
        return fullId.split("/", 2)[1];
    }

    public static boolean isLanternJid(final String from) {
        // Here's the format we're looking for: "-lan-"
        if (from.contains("/"+LanternConstants.UNCENSORED_ID)) {
            return true;
        }
        return false;
    }

    public static String jidToEmail(final String jid) {
        if (jid.contains("/")) {
            return StringUtils.substringBefore(jid, "/").toLowerCase();
        }
        return jid.toLowerCase();
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy