override public void GetCapabilities(ZPushCapabilities caps)
 {
     base.GetCapabilities(caps);
     if (AllowImpersonate)
     {
         caps.Add(Constants.ZPUSH_CAPABILITY_IMPERSONATE);
     }
 }
Beispiel #2
0
            public Response(HttpResponseMessage response)
            {
                Logger.Instance.Trace(this, "Response received: {0} {1}\n{2}", (int)response.StatusCode, response.ReasonPhrase, response.Headers);

                // Check for ZPush headers
                // GAB name is now hex encoded, but also support old-style for transition
                string gabNameOrig = GetStringHeader(response, Constants.ZPUSH_HEADER_GAB_NAME);

                if (gabNameOrig != null && new Regex("^[0-9a-fA-F]+$").IsMatch(gabNameOrig))
                {
                    GABName = StringUtil.HexToUtf8(gabNameOrig);
                }
                else
                {
                    GABName = gabNameOrig;
                }

                Capabilities   = ZPushCapabilities.Parse(GetStringHeader(response, Constants.ZPUSH_HEADER_CAPABILITIES));
                ZPushVersion   = GetStringHeader(response, Constants.ZPUSH_HEADER_VERSION);
                SignaturesHash = GetStringHeader(response, Constants.ZPUSH_HEADER_SIGNATURES_HASH);

                // Check for success
                Success = response.IsSuccessStatusCode;
                if (Success)
                {
                    // Parse the body
                    using (HttpContent responseContent = response.Content)
                    {
                        byte[] result = responseContent.ReadAsByteArrayAsync().Result;
                        Body = new WBXMLDocument();
                        Body.VersionNumber = 1.3;
                        Body.TagCodeSpace  = new ActiveSyncCodeSpace();
                        Body.Encoding      = Encoding.UTF8;
                        Body.LoadBytes(result);
                    }
                }

                Logger.Instance.Trace(this, "Response parsed: {0}", Body == null ? "Failure" : Body.ToXMLString());
            }
Beispiel #3
0
 virtual public void GetCapabilities(ZPushCapabilities caps)
 {
     caps.Add(Name.ToLower());
 }
 override public void GetCapabilities(ZPushCapabilities caps)
 {
     caps.Add("receiveflags");
     caps.Add("sendflags");
 }
 override public void GetCapabilities(ZPushCapabilities caps)
 {
     caps.Add("oof");
     caps.Add("ooftime");
 }