Quantcast
Channel: Ignite Realtime : Discussion List - All Communities
Viewing all articles
Browse latest Browse all 10742

"Monitoring Service", bag from "Open Archive", request history

$
0
0

I find and correct the error in the plugin "Monitoring Service", in the modules implementing xep-0059 and xep-0136 (ex "Open Archive" plugin).

Client is used Vacuum-IM.

 

Modeling problems :

1) Two people communicating create 3 conversation with 20 messages in each.

2) One of the users makes a request to the server to get the story:

<iq type="get" id="sid_17">  <list xmlns="urn:xmpp:archive" end="2014-02-23T14:01:38.278Z" with="user2@domain.local">    <set xmlns="http://jabber.org/protocol/rsm">      <max>10</max>      <before/>    </set>  </list></iq>

3) The server returns:

<iq type="result" id="sid_17" to="user1@domain.local/Vacuum-IM">  <list xmlns="urn:xmpp:archive">    <chat with="user2@domain.local" start="2014-02-22T12:10:29.243Z"/>    <set xmlns="http://jabber.org/protocol/rsm">      <first index="0">1</first>      <last>1</last>      <count>3</count>    </set>  </list></iq>

4) Instead, the server should return:

<iq type="result" id="sid_17" to="user1@domain.local/Vacuum-IM">  <list xmlns="urn:xmpp:archive">    <chat with="user2@domain.local" start="2014-02-22T12:10:29.243Z"/>    <chat with="user2@domain.local" start="2014-02-22T12:27:45.585Z"/>    <chat with="user2@domain.local" start="2014-02-22T12:34:05.371Z"/>    <set xmlns="http://jabber.org/protocol/rsm">      <first index="0">1</ first>      <last>3</last>      <count>3</count>    </set>  </list></iq>

 

I find two errors due to which there is such a situation:

1) First, the tag "<max>10</max>" must request 10 conversations, but in fact it requests 10 posts of the total number of messages in these three conversations (ie 10 of 60).

2) Secondly, the tag does not work "<before/>", as it does not contain the number (ie, an empty tag).

 

These problems I managed to solve by applying patches from two files:

1) "openfire_src\src\plugins\monitoring\src\java\com\reucon\openfire\plugin\archiv e\impl\JdbcPersistenceManager.java"

2) "openfire_src\src\plugins\monitoring\src\java\com\reucon\openfire\plugin\archiv e\xep0059\XmppResultSet.java"

 

In the first file you need to fix SQL-query "SELECT_CONVERSATIONS". This query returns the conversations with messages, but should only return conversations.

The second file is needed to handle the case when a tag "<before/>" empty.

 

Corrected files and patched plugin as an attachment.

 

Monitoring_1.3.2-rc1_patched_X.zip for Openfire 3.7.X-3.8.X

Monitoring_1.4.0_patched_X.zip for Openfire 3.9.X

 


By the way, this plugin will generate an errorwhen usedin conjunction with MS SQL Server, because thisdatabasedoes not understandcommands "LIMIT"and "OFFSET". With PostgreSQL it's work perfectly.FIXED

 

Sorryfor my english


Viewing all articles
Browse latest Browse all 10742

Trending Articles