public static string PrepareServer(string server) { if (String.IsNullOrEmpty(server)) { return(null); } #if !STRINGPREP return(server.ToLower()); #else return(StringPrep.NamePrep(server)); #endif }
/// <summary> /// Builds a new Jid object. /// StringPrep is applied to the input string. /// </summary> /// <param name="user">XMPP User part</param> /// <param name="server">XMPP Domain part</param> /// <param name="resource">XMPP Resource part</param> public Jid(string user, string server, string resource) { #if !STRINGPREP if (user != null) { user = EscapeNode(user); m_User = user.ToLower(); } if (server != null) { m_Server = server.ToLower(); } if (resource != null) { m_Resource = resource; } #else if (user != null) { user = EscapeNode(user); m_User = StringPrep.NodePrep(user); } if (server != null) { m_Server = StringPrep.NamePrep(server); } if (resource != null) { m_Resource = StringPrep.ResourcePrep(resource); } #endif BuildJid(); }