private void Message1() { // transient message (will not be stored offline if the server support AMP) /* <message to='*****@*****.**' from='[email protected]/elsinore' type='chat' id='chatty1'> <body>Who's there?</body> <amp xmlns='http://jabber.org/protocol/amp'> <rule action='drop' condition='deliver' value='stored'/> </amp> </message> */ agsXMPP.protocol.client.Message msg = new agsXMPP.protocol.client.Message(); msg.To = new Jid("*****@*****.**"); msg.From = new Jid("[email protected]/elsinore"); msg.Type = MessageType.chat; msg.Id = "chatty1"; msg.Body = "Who's there?"; Amp amp = new Amp(); Rule rule = new Rule(Condition.Deliver, "stored", agsXMPP.protocol.extensions.amp.Action.drop); amp.AddRule(rule); msg.AddChild(amp); Program.Print(msg); }
public Rule AddRule() { Rule rule = new Rule(); AddChild(rule); return rule; }
public void AddRule(Rule rule) { AddChild(rule); }
/// <summary> /// Gets a list of all form fields /// </summary> /// <returns></returns> public Rule[] GetRules() { ElementList nl = SelectElements(typeof(Rule)); Rule[] items = new Rule[nl.Count]; int i = 0; foreach (Element e in nl) { items[i] = (Rule)e; i++; } return items; }