Not logged in. · Lost password · Register
Forum: XMPP Protocol RSS
Avatar
jcdekoning #1
Member since Sep 2005 · 13 posts
Group memberships: Members
Show profile · Link to this post
Subject: Message retrieval confirmation
I am using XMPP for sending messages between different clients that use connectiontypes which are not always online. Because of that i store the messages from the client to the server.

Some messages are really important and i want to make some check between client and server to confirm the message is succesfully retrieved. Does anybody knows which specification (could be draft) support this type of confirmation?
Avatar
jcdekoning #2
Member since Sep 2005 · 13 posts
Group memberships: Members
Show profile · Link to this post
Maybe i should try to implement JEP 022 (which is not official but often used)
Avatar
Alex #3
Member since Feb 2003 · 4317 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
Hi,

yes JEP-0022 is a good start. But its normally its used for client 2 client communication.
You can use the delivered or displayed event. The client that receives or displayed the message is sending back the event to the other client.

Alex
Avatar
jcdekoning #4
Member since Sep 2005 · 13 posts
Group memberships: Members
Show profile · Link to this post
To realize this i should extend the message object with a X property element. Is this true?
Avatar
Alex #5
Member since Feb 2003 · 4317 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
yes,

this extension is also on my TODO list.
But i can't promise now when i add it.

Alex
Avatar
jcdekoning #6
Member since Sep 2005 · 13 posts
Group memberships: Members
Show profile · Link to this post
Okey thanks for your help. I added a X Element to the Message object. I know that this will limit the option to only add one X item to a message, but it is a quick hack :D
Avatar
Alex #7
Member since Feb 2003 · 4317 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
Hi,

i added JEP-22 to the code. I didnt checkin to SVN yet. But it will be in the next release. I post the code of the Event.cs here. YOu only have to add it to the code and the factory:

/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
 *                                                                                     *
 * Copyright (c) 2005 by AG-Software                                                 *
 * All Rights Reserved.                                                                 *
 *                                                                                     *
 * You should have received a copy of the AG-Software Shared Source License             *
 * along with this library; if not, email gnauck@ag-software.de to request a copy.   *
 *                                                                                     *
 * For general enquiries, email gnauck@ag-software.de or visit our website at:         *
 * http://www.ag-software.net                                                         *
 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

using System;

using agsXMPP.Xml.Dom;

namespace agsXMPP.protocol.x
{
    /// <summary>
    /// JEP-0022: Message Events
    /// This JEP defines protocol extensions used to request and respond to events relating to the delivery, display, and composition of messages.
    /// </summary>
    public class Event : Element
    {
        public Event()
        {
            this.TagName = &quot;x&quot;;
            this.Namespace = Uri.X_EVENT;
        }

        /// <summary>
        /// Indicates that the message has been stored offline by the intended recipient's server.
        /// This event is triggered only if the intended recipient's server supports offline storage,
        /// has that support enabled, and the recipient is offline when the server receives the message for delivery.
        /// </summary>
        public bool Offline
        {
            get { return HasTag(&quot;offline&quot;); }
            set
            {
                RemoveTag(&quot;offline&quot;);
                if (value)
                    AddTag(&quot;offline&quot;);
            }
           
        }

        /// <summary>
        /// Indicates that the message has been delivered to the recipient.
        /// This signifies that the message has reached the recipient's Jabber client,
        /// but does not necessarily mean that the message has been displayed.
        /// This event is to be raised by the Jabber client.
        /// </summary>
        public bool Delivered
        {
            get { return HasTag(&quot;delivered&quot;); }
            set
            {
                RemoveTag(&quot;delivered&quot;);
                if (value)
                    AddTag(&quot;delivered&quot;);
            }
           
        }
       
        /// <summary>
        /// Once the message has been received by the recipient's Jabber client,
        /// it may be displayed to the user.
        /// This event indicates that the message has been displayed, and is to be raised by the Jabber client.
        /// Even if a message is displayed multiple times, this event should be raised only once.
        /// </summary>
        public bool Displayed
        {
            get { return HasTag(&quot;displayed&quot;); }
            set
            {
                RemoveTag(&quot;displayed&quot;);
                if (value)
                    AddTag(&quot;displayed&quot;);
            }
           
        }
       
        /// <summary>
        /// In threaded chat conversations, this indicates that the recipient is composing a reply to a message.
        /// The event is to be raised by the recipient's Jabber client.
        /// A Jabber client is allowed to raise this event multiple times in response to the same request,
        /// providing the original event is cancelled first.
        /// </summary>
        public bool Composing
        {
            get { return HasTag(&quot;composing&quot;); }
            set
            {
                RemoveTag(&quot;composing&quot;);
                if (value)
                    AddTag(&quot;composing&quot;);
            }
           
        }

        /// <summary>
        /// 'id' attribute of the original message to which this event notification pertains.
        /// (If no 'id' attribute was included in the original message, then the id tag must still be included with no
        /// </summary>
        public string Id
        {
            get { return GetTag(&quot;id&quot;); }
            set { SetTag(&quot;id&quot;); }
        }
    }

}

Alex
Avatar
Alex #8
Member since Feb 2003 · 4317 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
i checked in the code to SVN.
The project files are visual studio 2005 now.
But its still compatible to 2003 and .NET1.1 or Mono

Alex
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: