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();
    }
}

@@ -99,188 +99,8 @@
  %7B%0A%0A
-    /** This is misspelled -- use jidToResourceId */%0A    @Deprecated%0A    public static String jidToInstanceId(final String fullId) %7B%0A        return fullId.split(%22/%22, 2)%5B1%5D;%0A    %7D%0A%0A
     
@@ -519,33 +519,52 @@
     
-if (jid.contains(%22/%22)) %7B%0A
+return EmailAddressUtils.normalizedEmail(%0A  
     
@@ -571,22 +571,17 @@
         
-return
+ 
  StringU
@@ -614,65 +614,8 @@
 %22/%22)
-.toLowerCase();%0A        %7D%0A        return jid.toLowerCase(
 );%0A 

Normalize emails when extracting them from the jid.