ejabberd - Comments for "Flexible Offline Message Retrieval - not stopping flood of offline messages" https://www.ejabberd.im/forum/28890/flexible-offline-message-retrieval-not-stopping-flood-offline-messages en So the key here is to send a https://www.ejabberd.im/forum/28890/flexible-offline-message-retrieval-not-stopping-flood-offline-messages#comment-67582 <p>So the key here is to send a presence with a negative priority after logging in and before the headers are fetched.<br /> If I add this step, it acts as expected, and I don't get the flood of messages.<br /> Thanks!</p> Sun, 16 Jul 2017 13:47:12 +0000 adiohaion comment 67582 at https://www.ejabberd.im > So if Flexible Offline https://www.ejabberd.im/forum/28890/flexible-offline-message-retrieval-not-stopping-flood-offline-messages#comment-67578 <p>&gt; So if Flexible Offline Message Retrieval is enabled before the initial presence, I think it shouldn't send the offline messages after the initial presence is sent.</p> <p>Right, and that behavior works correctly for me using ejabberd 17.07, as described in the second flow shown in <noindex><a href="https://xmpp.org/extensions/xep-0013.html#flow" title="https://xmpp.org/extensions/xep-0013.html#flow" rel="nofollow" >https://xmpp.org/extensions/xep-0013.html#flow</a></noindex></p> <p>See this example:<br /> 1. user1 sends a message to his contact user33, which is offline<br /> 2. user33 logins with negative priority. Consequently, user33 does not receive the offline message<br /> 3. user33 sends IQ as XEP-13 says, and receives a response indicating he has offline messages pending:</p> <div class="codeblock"><code>&lt;iq type=&#039;get&#039; id=&#039;asd&#039;&gt;<br />&nbsp; &lt;query xmlns=&#039;http://jabber.org/protocol/disco#items&#039;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; node=&#039;http://jabber.org/protocol/offline&#039;/&gt;<br />&lt;/iq&gt; <p>&lt;iq xml:lang=&#039;es&#039;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; to=&#039;user33@localhost/tka1&#039;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; from=&#039;user33@localhost&#039;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; type=&#039;result&#039;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; id=&#039;asd&#039;&gt;<br />&nbsp; &lt;query node=&#039;http://jabber.org/protocol/offline&#039;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; xmlns=&#039;http://jabber.org/protocol/disco#items&#039;&gt;<br />&nbsp;&nbsp;&nbsp; &lt;item node=&#039;1499979486413720&#039;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; name=&#039;user1@localhost/tka1&#039;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; jid=&#039;user33@localhost&#039;/&gt;<br />&nbsp; &lt;/query&gt;<br />&lt;/iq&gt;</p></code></div> <p>4. Now user33 sets a positive presence priority. He receives a response, but not the offline message flood. So, it works correctly:</p> <div class="codeblock"><code>&lt;presence xml:lang=&#039;es&#039;&gt;<br />&nbsp; &lt;show&gt;away&lt;/show&gt;<br />&nbsp; &lt;priority&gt;1&lt;/priority&gt;<br />&nbsp; &lt;status&gt;Busy&lt;/status&gt;<br />&nbsp; &lt;c hash=&#039;sha-1&#039;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; node=&#039;http://tkabber.jabber.ru/&#039;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ver=&#039;r8V40m6ZPI/XkmBng8oguZ139bA=&#039;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; xmlns=&#039;http://jabber.org/protocol/caps&#039;/&gt;<br />&lt;/presence&gt; <p>&lt;presence xml:lang=&#039;es&#039;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; to=&#039;user33@localhost/tka1&#039;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; from=&#039;user33@localhost/tka1&#039;&gt;<br />&nbsp; &lt;c hash=&#039;sha-1&#039;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; node=&#039;http://tkabber.jabber.ru/&#039;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ver=&#039;r8V40m6ZPI/XkmBng8oguZ139bA=&#039;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; xmlns=&#039;http://jabber.org/protocol/caps&#039;/&gt;<br />&nbsp; &lt;x xmlns=&#039;vcard-temp:x:update&#039;/&gt;<br />&nbsp; &lt;priority&gt;1&lt;/priority&gt;<br />&nbsp; &lt;show&gt;away&lt;/show&gt;<br />&nbsp; &lt;status&gt;Busy&lt;/status&gt;<br />&lt;/presence&gt;</p></code></div> <p>I've also tried not using XEP-0013: if client doesn't send IQ in step 3, then in step 4 he receives the offline message flood.</p> Fri, 14 Jul 2017 10:31:00 +0000 badlop comment 67578 at https://www.ejabberd.im Thanks for the quick https://www.ejabberd.im/forum/28890/flexible-offline-message-retrieval-not-stopping-flood-offline-messages#comment-67575 <p>Thanks for the quick response!</p> <p>If you look at the Process Flow in the doc you mentioned (<noindex><a href="https://xmpp.org/extensions/xep-0160.html#flow" title="https://xmpp.org/extensions/xep-0160.html#flow" rel="nofollow" >https://xmpp.org/extensions/xep-0160.html#flow</a></noindex>), you can see in #5:</p> <p>"When the recipient next sends non-negative available presence to the server, the server delivers the message to the resource that has sent that presence. (Alternatively, the server may support Flexible Offline Message Retrieval (XEP-0013), although that functionality is not described herein.)"</p> <p>This tells me that the alternative of Flexible Offline Message Retrieval is ignored in this document, when it says:<br /> "Now the recipient authenticates with the server and sends initial presence (with a non-negative priority) to the server. [...] The recipient's server now delivers the offline message to that resource"</p> <p>Also, in XEP-0013 it states:<br /> "The protocol enables a connecting client to retrieve its offline messages on login in a controlled fashion, without receiving a flood of messages"</p> <p>And </p> <p>"Upon receiving a service discovery request addressed to a node of "http://jabber.org/protocol/offline" (either a disco#info request [...] or a disco#items request [...]), the server MUST NOT send a flood of offline messages if the user subsequently sends initial presence to the server during this session."</p> <p>So if Flexible Offline Message Retrieval is enabled before the initial presence, I think it shouldn't send the offline messages after the initial presence is sent.<br /> It's not a critical issue, but it's a lot of traffic to the client that could be avoided. </p> <p>Do I understand this wrong?</p> <p>Thanks again.</p> Wed, 12 Jul 2017 11:37:31 +0000 adiohaion comment 67575 at https://www.ejabberd.im When you send initial https://www.ejabberd.im/forum/28890/flexible-offline-message-retrieval-not-stopping-flood-offline-messages#comment-67573 <p>When you send initial presence in step 5, if it has positive priority, mod_offline sends all the messages, as specified in <noindex><a href="https://xmpp.org/extensions/xep-0160.html" title="https://xmpp.org/extensions/xep-0160.html" rel="nofollow" >https://xmpp.org/extensions/xep-0160.html</a></noindex> See:</p> <p>&gt; Now the recipient authenticates with the server and sends initial presence (with a non-negative priority) to the server. [...] The recipient's server now delivers the offline message to that resource</p> Wed, 12 Jul 2017 09:57:34 +0000 badlop comment 67573 at https://www.ejabberd.im