예제 #1
0
        public static HydraIdType GetHydraIdType(string address)
        {
            string peopleUrl  = "ciscospark://us/PEOPLE/";
            string spaceUrl   = "ciscospark://us/ROOM/";
            string messageUrl = "ciscospark://us/MESSAGE/";

            HydraIdType result = HydraIdType.Error;

            try
            {
                var decodedStr = StringExtention.Base64UrlDecode(address);
                if (decodedStr.StartsWith(peopleUrl))
                {
                    result = HydraIdType.People;
                }
                else if (decodedStr.StartsWith(spaceUrl))
                {
                    result = HydraIdType.Space;
                }
                else if (decodedStr.StartsWith(messageUrl))
                {
                    result = HydraIdType.Message;
                }
                else
                {
                    result = HydraIdType.Unknow;
                }
            }
            catch
            {
                result = HydraIdType.Error;
            }


            return(result);
        }