Tigase Message Archiving Component contains few additional features useful for working with message archives.
Feature allows user to search all of his archived messages without a need to specify who was send/receiver of this message.
To search in all messages, request sent to retrieve archived messages should not contain with
attribute.
As a result, when with
attribute is omitted <chat/>
element of response will not contain with
attribute but every <to/>
and <from/>
element will contain with
attribute.
This feature allows user to query for messages or collections containing messages which in body of a message contained text passed by user.
To execute request in which user wants to find messages with "test failed" string XMPP client needs to add following element
<query xmlns="http://tigase.org/protocol/archive#query"> <contains>test failed</contains> </query>
as child element of @retrieve@ or @list@ element of request.
Retrieving messages with "test failed" string with user juliet@capulet.com
between 2014-01-01 00:00:00
and 2014-05-01 00:00:00
<iq type="get" id="query2"> <retrieve xmlns='urn:xmpp:archive' with='juliet@capulet.com' from='2014-01-01T00:00:00Z' end='2014-05-01T00:00:00Z'> <query xmlns="http://tigase.org/protocol/archive#query"> <contains>test failed</contains> </query> </retrieve> </iq>
Retrieving collections containing messages with "test failed" string with user juliet@capulet.com
between 2014-01-01 00:00:00
and 2014-05-01 00:00:00
<iq type="get" id="query2"> <list xmlns='urn:xmpp:archive' with='juliet@capulet.com' from='2014-01-01T00:00:00Z' end='2014-05-01T00:00:00Z'> <query xmlns="http://tigase.org/protocol/archive#query"> <contains>test failed</contains> </query> </list> </iq>
This feature adds support for tagging messages archived by Message Archiving component and by default is disabled (to learn how to enable this feature please see the section called “Enabling support for tags” section).
Tagging can be done only by user sending message as to tag message tag needs to be included in message content (message body to be exact).
Currently there are 2 types of tags supported:
hashtag
- words prefixed by "hash" (#) are stored with prefix and used as tag, i.e. #Tigase
mention
- words prefixed by "at" (@) are stored with prefix and used as tag, i.e. @Tigase
Custom feature allows user to query/retrieve messages or collections from archive only containing particular tag or tags. To execute request in which user wants to retrieve only messages tagged with @User1
and #People
XMPP client executing request needs to add following element as child element of <retrieve/>
element or <list/>
element:
<query xmlns="http://tigase.org/protocol/archive#query"> <tag>#People</tag> <tag>@User1</tag> </query>
Request to retrieve messages tagged with @User1
and #People
from chat with user juliet@capulet.com
between 2014-01-01 00:00:00
and 2014-05-01 00:00:00
<iq type="get" id="query2"> <retrieve xmlns='urn:xmpp:archive' with='juliet@capulet.com' from='2014-01-01T00:00:00Z' end='2014-05-01T00:00:00Z'> <query xmlns="http://tigase.org/protocol/archive#query"> <tag>#People</tag> <tag>@User1</tag> </query> </retrieve> </iq>
Request to retrieve collections containing messages tagged with @User1
and #People
from chat with user juliet@capulet.com
between 2014-01-01 00:00:00
and 2014-05-01 00:00:00
<iq type="get" id="query2"> <list xmlns='urn:xmpp:archive' with='juliet@capulet.com' from='2014-01-01T00:00:00Z' end='2014-05-01T00:00:00Z'> <query xmlns="http://tigase.org/protocol/archive#query"> <tag>#People</tag> <tag>@User1</tag> </query> </list> </iq>
To search for hashtags or user names already used following request might be used:
<iq type="set" id="query2"> <tags xmlns="http://tigase.org/protocol/archive#query" like="#test"/> </iq>
which will return suggested similar hashtags which where found in database for particular user if following response:
<iq type="result" id="query2"> <tags xmlns="http://tigase.org/protocol/archive#query" like="#test"> <tag>#test1</tag> <tag>#test123</tag> <set xmlns="http://jabber.org/protocol/rsm"> <first index='0'>0</first> <last>1</last> <count>2</count> </set> </tags> </iq>
If this feature is enabled MUC messages are stored in Message Archiving repository and are added in same way as for any other messages and jid
of MUC room is used as jid
of message sender, so if MUC message sent from test@muc.example.com
was stored then to retrieve this messages test@muc.example.com
needs to be passed as with
attribute to message retrieve request.
Retrieved MUC messages will be retrieved in same format as normal message with one exception - each message will contain name
attribute with name of occupant in room which sent this message.
This feature is by default disabled but it is possible to enable it for particular user. Additionally it is possible to change default setting on installation level and on hosted domain level to enable this feature, disable feature or allow user to decide if user want this feature to be enabled. For more information about configuration of this feature look at the section called “Configuration of automatic archiving of MUC messages”