public static void CreateNode(XMPPClient connection, string strNode, string strParentNode, PubSubConfigForm nodeform) { IQ pubsub = new IQ(); pubsub.Type = IQType.set.ToString(); pubsub.From = connection.JID; pubsub.To = new JID(string.Format("pubsub.{0}", connection.Domain)); string strXML = CreateNodeXML.Replace("#NODE#", strNode); /// Get inner xml /// string strForm = nodeform.BuildAskingForm(nodeform); strXML = strXML.Replace("#x#", strForm); pubsub.InnerXML = strXML; IQ IQResponse = connection.SendRecieveIQ(pubsub, 10000); if (IQResponse == null) return; if (IQResponse.Type == IQType.error.ToString()) { return; } }
public static void CreateNode(XMPPClient connection, string strNode, string strParentNode, PubSubConfigForm nodeform) { IQ pubsub = new IQ(); pubsub.Type = IQType.set.ToString(); pubsub.From = connection.JID; pubsub.To = new JID(string.Format("pubsub.{0}", connection.Domain)); string strXML = CreateNodeXML.Replace("#NODE#", strNode); /// Get inner xml /// string strForm = nodeform.BuildAskingForm(nodeform); strXML = strXML.Replace("#x#", strForm); pubsub.InnerXML = strXML; IQ IQResponse = connection.SendRecieveIQ(pubsub, 10000); if (IQResponse == null) { return; } if (IQResponse.Type == IQType.error.ToString()) { return; } }