private XmlElement CreateSessionRequest() { return(IqStanza.Set() .NewId() .Children(new XmlElement("session") .Xmlns(XmppNamespaces.Session))); }
private static XmlElement CreateRemoveItemRequest(Jid entityJid, RosterItem item) { var itemElement = ToXmlElement(item); itemElement.SetAttributeValue("subscription", "remove"); return(AttachQuery(IqStanza.Set().From(entityJid), itemElement)); }
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)); }
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); }