Exemple #1
0
        protected ProtocolNode AddFeatures()
        {
            var child  = new ProtocolNode("receipt_acks", null, null, String.Empty);
            var parent = new ProtocolNode("stream:features", null, new[] { child }.ToList(), String.Empty);

            return(parent);
        }
Exemple #2
0
        protected void WriteInternal(ProtocolNode node)
        {
            var len = 1;

            if (node.attributeHash != null)
            {
                len += node.attributeHash.Count * 2;
            }
            if (node.children.Count > 0)
            {
                ++len;
            }

            if (node.data.Length > 0)
            {
                ++len;
            }
            this.WriteListStart(len);
            this.WriteString(node.tag);
            this.WriteAttributes(node.attributeHash);
            if (node.data.Length > 0)
            {
                this.writeBytes(node.data);
            }
            if (node.children.Count > 0)
            {
                this.WriteListStart(node.children.Count);
                foreach (var child in node.children)
                {
                    this.WriteInternal(child);
                }
            }
        }
Exemple #3
0
        protected ProtocolNode AddAuth()
        {
            var authHash = new Dictionary <string, string>();

            authHash.Add("xmlns", "urn:ietf:params:xml:ns:xmpp-sasl");
            authHash.Add("mechanism", "DIGEST-MD5-1");
            var node = new ProtocolNode("auth", authHash, null, String.Empty);

            return(node);
        }
Exemple #4
0
 public string Write(ProtocolNode node)
 {
     if (node != null)
     {
         this.output += "\x00";
     }
     else
     {
         this.WriteInternal(node);
     }
     return(this.FlushBuffer());
 }
Exemple #5
0
        public ProtocolNode GetChild(string tag)
        {
            ProtocolNode returnValue = null;

            if (this.children != null)
            {
                returnValue = (from x in children where String.Compare(x.tag, tag) == 0 select x).FirstOrDefault();
                if (returnValue == null)
                {
                    returnValue = (from x in children where x.GetChild(tag) != null select x).FirstOrDefault();
                }
            }
            return(returnValue);
        }
Exemple #6
0
 protected void ProcessChallenge(ProtocolNode node)
 {
 }
Exemple #7
0
 protected void SendNode(ProtocolNode node)
 {
 }