Not logged in. · Lost password · Register
Forum: agsXMPP RSS
Avatar
halr9000 #1
Member since Jan 2008 · 5 posts
Group memberships: Members
Show profile · Link to this post
Subject: Examples for XEP-0079 (Advanced Message Processing)
I'd like to send some 'transient messages', i.e. ones that will drop if they cannot be delivered immediately.  Where can I find examples of this?  There are some references to it so I assume it is supported.
Author, TechProsaic (http://halr9000.com)
Co-Host, PowerScripting Podcast (http://powerscripting.net)
Webmaster, Psi (http://psi-im.org)
Avatar
Alex #2
Member since Feb 2003 · 4317 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
Hi Hal,

i added Advanced Message Processing last week. So its in the latest developer version.

A transient message looks like this one:

  1. <message to='francisco@hamlet.lit'
  2.          from='bernardo@hamlet.lit/elsinore'
  3.          type='chat'
  4.          id='chatty1'>
  5.   <body>Who&apos;s there?</body>
  6.   <amp xmlns='http://jabber.org/protocol/amp'>
  7.     <rule action='drop' condition='deliver' value='stored'/>
  8.   </amp>
  9. </message>

The c# code to create this message with the latest developer version is:

  1. agsXMPP.protocol.client.Message msg = new agsXMPP.protocol.client.Message();
  2. msg.To = new Jid("francisco@hamlet.lit");
  3. msg.From = new Jid("bernardo@hamlet.lit/elsinore");
  4. msg.Type = MessageType.chat;
  5. msg.Id = "chatty1";
  6.  
  7. msg.Body = "Who&apos;s there?";
  8.  
  9. Amp amp = new Amp();
  10. Rule rule = new Rule(Condition.Deliver, "stored", agsXMPP.protocol.extensions.amp.Action.drop);
  11. amp.AddRule(rule);
  12. msg.AddChild(amp);

With the current version you have to create the amp xml elements manual
The c# code for doint this is:
  1. agsXMPP.protocol.client.Message msg = new agsXMPP.protocol.client.Message();
  2. msg.To = new Jid("francisco@hamlet.lit");
  3. msg.From = new Jid("bernardo@hamlet.lit/elsinore");
  4. msg.Type = MessageType.chat;
  5. msg.Id = "chatty1";
  6.  
  7. msg.Body = "Who&apos;s there?";
  8.  
  9. Element amp = new Element();
  10. amp.TagName     = "amp";
  11. amp.Namespace   = "http://jabber.org/protocol/amp";
  12.  
  13. Element rule = new Element();
  14. rule.TagName    = "rule";
  15. rule.Namespace  = "http://jabber.org/protocol/amp";
  16. rule.SetAttribute("action", "drop");
  17. rule.SetAttribute("condition", "deliver");
  18. rule.SetAttribute("value", "stored");
  19.  
  20. amp.AddChild(rule);
  21. msg.AddChild(amp);

let me know if you want to work with the latest developer version. I can email the agsXMPP dll to you.
Are there any servers which support Advanced Message Processing?

Alex
Avatar
halr9000 #3
Member since Jan 2008 · 5 posts
Group memberships: Members
Show profile · Link to this post
Thanks Alex.  Please send the DLL to the email address in my profile.  I'm asking around on XEP support.
Author, TechProsaic (http://halr9000.com)
Co-Host, PowerScripting Podcast (http://powerscripting.net)
Webmaster, Psi (http://psi-im.org)
Close Smaller – Larger + Reply to this post:
Verification code: VeriCode Please enter the word from the image into the text field below. (Type the letters only, lower case is okay.)
Smileys: :-) ;-) :-D :-p :blush: :cool: :rolleyes: :huh: :-/ <_< :-( :'( :#: :scared: 8-( :nuts: :-O
Special characters:
Forum: agsXMPP RSS