Not logged in. · Lost password · Register
Forum: agsXMPP RSS
Avatar
kylixsales #1
Member since Feb 2007 · 7 posts
Group memberships: Members
Show profile · Link to this post
Subject: about number of offline Message
i want to Request Number of Messages only, the code written in xmppcon_onlogin Event as below:
        Dim offLineIQ As New agsXMPP.protocol.client.IQ(IqType.get)
        Dim el As New Element
        el.TagName = "query"
        el.SetNamespace("http://jabber.org/protocol/disco#info")
        el.SetAttribute("node", "http://jabber.org/protocol/offline")
        offLineIQ.Query = el
        XmppCon.Send(offLineIQ)

i wish the server can only send to me number of offline message,but i still receive all message body,why?
i wish i can manually reteive special message instead of the server send me all messages auto . how can i do it?

thanks!
i Wish Win!
Avatar
Alex #2
Member since Feb 2003 · 4317 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
Hello,

what you wanna do is XEP-0013 Flexible Offline Message Retrieval
This is currently not supported in agsXMPP which means you have to build the packets on your own.
Also not all servers support this extensions. So make sure that your server supports it.

but your code looks OK to me, so it should work if the server supports it.

Alex
Avatar
sunng #3
Member since Apr 2007 · 7 posts
Group memberships: Members
Show profile · Link to this post
hi

I have a similar problem.

i'm trying out the feature of "XEP-0013 Flexible Offline Message Retrieval", and I wish the Server will keep the offline messages .

I wrote the following codes is function "XmppCon_OnRosterEnd" of agsXMPP

            //Send Request of Offline Message Headers
            IQ offLineIQ = new IQ(IqType.get);
            Element el = new Element() ;
            el.TagName = "query";
            el.SetNamespace("http://jabber.org/protocol/disco#item");
            el.SetAttribute("node", "http://jabber.org/protocol/offline");
            offLineIQ.Query = el;
            XmppCon.Send(offLineIQ);   

and here is the messages between client and server when login:

...................
SEND: <iq xmlns="jabber:client" id="agsXMPP_6" type="get" to="sunxiaodong"><query xmlns="http://jabber.org/protocol/disco#info" /></iq>
.............
SEND: <iq xmlns="jabber:client" type="get"><query xmlns="http://jabber.org/protocol/disco#item" node="http://jabber.org/protocol/offline" /></iq>

SEND: <presence xmlns="jabber:client"><status /><priority>10</priority></presence>
................
RECV: <iq xmlns="jabber:client" from="sunxiaodong" to="offmsg@sunxiaodong/MiniClient" type="result" id="agsXMPP_6"><query xmlns="http://jabber.org/protocol/disco#info"><identity name="Wildfire Server" category="server" type="im" /><feature var="http://jabber.org/protocol/disco#info" /><feature var="http://jabber.org/protocol/address" /><feature var="vcard-temp" /><feature var="jabber:iq:private" /><feature var="jabber:iq:register" /><feature var="jabber:iq:roster" /><feature var="jabber:iq:time" /><feature var="jabber:iq:version" /><feature var="jabber:iq:last" /><feature var="http://jabber.org/protocol/disco#items" /><feature var="http://jabber.org/protocol/offline"/><feature var="http://jabber.org/protocol/commands" /><feature var="jabber:iq:privacy" /></query></iq>
....................
RECV: <iq xmlns="jabber:client" to="offmsg@sunxiaodong/MiniClient" type="error"><query xmlns="http://jabber.org/protocol/disco#item" node="http://jabber.org/protocol/offline" /><error code="503" type="cancel"><service-unavailable xmlns="urn:ietf:params:xml:ns:xmpp-stanzas" /></error></iq>
...................

503 is "Service Unavailable" error, but why? I think the bold characters mean that the server support the feature, isn't it?

this troubles me, help please ..... thank you very much!


sunng
Avatar
Jabberer #4
Member since Feb 2006 · 249 posts
Group memberships: Members
Show profile · Link to this post
You send a disco item request instead of a disco info request.

  1. <iq type='get' id="agsXMPP_11">
  2.  <query xmlns='http://jabber.org/protocol/disco#info' node='http://jabber.org/protocol/offline'/>
  3. </iq>

You should also send a id with your request. If you use the IqGrabber you can define a callback for the response.
Software Developer
AG-Software
Avatar
sunng #5
Member since Apr 2007 · 7 posts
Group memberships: Members
Show profile · Link to this post
thank you!

I tried the disco Info, and the offline message stored is the server.

but, I still want to know that why I send a disco Item IQ, the server returns error:

..................

SEND: <iq xmlns="jabber:client" type="get" id="agsXMPP_12"><query xmlns="http://jabber.org/protocol/disco#info" node="http://jabber.org/protocol/offline" /></iq>

SEND: <iq xmlns="jabber:client" type="get" id="agsXMPP_13"><query xmlns="http://jabber.org/protocol/disco#item" node="http://jabber.org/protocol/offline" /></iq>

....................

RECV: <iq type="result" id="agsXMPP_12" to="solar@sunxiaodong/MiniClient"><query xmlns="http://jabber.org/protocol/disco#info" node="http://jabber.org/protocol/offline"><identity category="automation" type="message-list"/><feature var="http://jabber.org/protocol/offline"/><x xmlns="jabber:x:data" type="result"><field var="FORM_TYPE" type="hidden"><value>http://jabber.org/protocol/offline</value></field><field var="number_of_messages"><value>0</value></field></x></query></iq>

RECV: <iq type="error" id="agsXMPP_13" to="solar@sunxiaodong/MiniClient"><query xmlns="http://jabber.org/protocol/disco#item" node="http://jabber.org/protocol/offline"/><error code="503" type="cancel"><service-unavailable xmlns="urn:ietf:params:xml:ns:xmpp-stanzas"/></error></iq>

....................
Avatar
Jabberer #6
Member since Feb 2006 · 249 posts
Group memberships: Members
Show profile · Link to this post
i assume because you want send:
http://jabber.org/protocol/disco#items not
http://jabber.org/protocol/disco#item.

Example 5. User Requests Offline Message Headers

Quote by "XEP-0013":
<iq type='get'>
  <query xmlns='http://jabber.org/protocol/disco#items' node='http://jabber.org/protocol/offline'/>
</iq>

Software Developer
AG-Software
Avatar
sunng #7
Member since Apr 2007 · 7 posts
Group memberships: Members
Show profile · Link to this post
.................

I did such a stupid thing.....

thank you! I'm enjoying your help:)
Avatar
Alex #8
Member since Feb 2003 · 4317 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
Hello,

would be cool if you can share your code once it's working here with the community.

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:
Forum: agsXMPP RSS