Exemplo n.º 1
0
 private XmlElement CreateSessionRequest()
 {
     return(IqStanza.Set()
            .NewId()
            .Children(new XmlElement("session")
                      .Xmlns(XmppNamespaces.Session)));
 }
Exemplo n.º 2
0
        private static XmlElement CreateRemoveItemRequest(Jid entityJid, RosterItem item)
        {
            var itemElement = ToXmlElement(item);

            itemElement.SetAttributeValue("subscription", "remove");

            return(AttachQuery(IqStanza.Set().From(entityJid), itemElement));
        }
Exemplo n.º 3
0
        private static XmlElement CreateAddOrUpdateItemRequest(Jid entityJid, RosterItem rosterItem)
        {
            var item = ToXmlElement(rosterItem);

            if (!string.IsNullOrEmpty(rosterItem.Name))
            {
                item.SetAttributeValue("name", rosterItem.Name);
            }

            //for (int i = 0; i < groups.Length; i++)
            //{
            //    item.Children.Add(new XmlElement("group").Value(groups[i]));
            //}

            return(AttachQuery(IqStanza.Set().From(entityJid), item));
        }
Exemplo n.º 4
0
        private XmlElement CreateBindRequest(string resource)
        {
            var bindIq = IqStanza.Set().NewId();
            var bind   = new XmlElement("bind").Xmlns(XmppNamespaces.Bind);

            bindIq.Children(bind);

            if (!string.IsNullOrEmpty(resource))
            {
                bind.Children(new XmlElement("resource")
                {
                    Value = resource
                });
            }

            return(bindIq);
        }