Logging private messages on server

Hi all,

First of all, I would like to say that XIFF 3.0 is great library and till now, I had no problem. I’ve done basic IM in Flex with chatting, MUC and private messages. Requirements from my client is store conversations on server which is supported by OpenFire, but problem is that I need store private messages sent in Group Chats. As far as I know, this is not supported by OpenFire, but I’ve found plugin OpenArchive, which do the job and store private messages on server (I can see them in Admin console). But now I really don’t know how to retrieve them in Flex via XIFF library.

My first attempt was using SearchExtension, but I have problem to get anything. Maybe it’s because I don’t know how to use SearchExtension or maybe because of security reason.

Here is code I’m using for search:

private function search(userName: String): void
{
     SearchExtension.enable();
                    
     var iq:IQ = new IQ(room.roomJID.escaped, IQ.TYPE_GET, XMPPStanza.generateID('discoverSearch'), onServiceItems, onServiceItemsError);
     var search: SearchExtension = new SearchExtension();
     search.addTextNode(iq.getNode(), "query xmlns=\"jabber:iq:search\"", userName);
     iq.addExtension(search);      connection.send(iq);                    
}

problem is that, when I call this search, there is security error #2048

Error: Error #2048: Security sandbox violation: file:///Users/xxxx/Documents/Flex Builder 3/XIFF_GUI/bin-debug/JabberSearch.swf cannot load data from imtest.xxxx.com:5222.

I’m also trying to load crossdomain.xml via

Security.loadPolicyFile(“xmlsocket://” + connection.server + “:5229”);

but it doesn’t help. But I’m not sure, if everything else do not need crossdomain and works perfectly, if just search need it. Maybe it’s just because I’m using SearchExtension in wrong way.

Can anybody give me any hints, how to retrieve stored private messages or how to use searchExtension, or how to correctly load crossdomain.xml to prevent security error.

I know I have many questions, but I’ve really stuck in this problem and need to find solution.

Thanks in advance for your answers

You’d probably want to look into XEP-0136.

XIFF doesn’t currently support this extension, but it could be done.

The search extension (XEP-0055) is intended more for finding users.

XEP-0136 is not currently on the XIFF road map, but I’ll add it to the feature requests (XIFF-76).

Feel free to write and submit a patch for it.

hmm… i’ve tried to retrieve collections with and tags according XEP-0136. List work, returns always same result

<iq id="user50" to="xxxx@xxx.com/xiff" type="result">
 <list xmlns="urn:xmpp:archive">
   <chat start="2010-09-23T15:54:10.522Z"
with="bw@conference.xxx.com" />
     <set xmlns="http://jabber.org/protocol/rsm">
       <first index="0">6</first>
       <last>6</last>
       <count>1</count>
     </set>
 </list>
</iq>

I have to confess, I dont know what that exactly means.

About , it always sent me item-not-found 404 error whatever I’m trying to retrieve. But in AdminConsole I can search by participant or dates from Flex I have always same response

<iq id="retrieve50" to="xxx@xxx.com/xiff" type="error">
   <error code="404" type="cancel">
      <item-not-found xmlns="urn:ietf:params:xml:ns:xmpp-stanzas" />
   </error>
</iq>