Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement a XEP-297 based interface to retrieve logs. #197

Closed
maranda opened this issue Dec 20, 2014 · 0 comments
Closed

Implement a XEP-297 based interface to retrieve logs. #197

maranda opened this issue Dec 20, 2014 · 0 comments
Assignees
Milestone

Comments

@maranda
Copy link
Owner

@maranda maranda commented Dec 20, 2014

The protocol will be a rather simplified version of MAM 1.0 more suitable for MUC usage, it will not allow to search through the archive but instead retrieve room logs based on date, log entries will be numerically indexed so it will be possible to minorily page through it specifying the starting index and the max amount of forwarded stanzas.

Example protocol cases:

<iq to="grimoire@muc.metronome.im" id="get_logs" type="get">
<query xmlns="http://metronome.im/protocol/muc-logs-forward" />
</iq>

The above will return today's logs if any, with the default max messages to forward parameters (default: last 100 messages).

Optional Parameters:

<iq to="grimoire@muc.metronome.im" id="get_logs" type="get">
<query xmlns="http://metronome.im/protocol/muc-logs-forward">
<date>2014-12-12</date>
</query>
</iq>

Will return the last 100 messages of the defined day.

<iq to="grimoire@muc.metronome.im" id="get_logs" type="get">
<query xmlns="http://metronome.im/protocol/muc-logs-forward">
<max>500</max>
</query>
</iq>

Will return the last 500 messages, this element defines the max amount of stanzas to forward upto a 1000 hardcoded limit.

<iq to="grimoire@muc.metronome.im" id="get_logs" type="get">
<query xmlns="http://metronome.im/protocol/muc-logs-forward">
<entries />
</query>
</iq>

Returns the count of messages in a room log, along with the date, you can optionally specify the date. Including this element will always return only the log entries count in a IQ result payload along with the date:

<iq from="grimoire@muc.metronome.im" to="romeo@montagues.lit/Gajim" id="get_logs" type="result">
<query xmlns="http://metronome.im/protocol/muc-logs-forward">
<date>2014-12-12</date>
<count>144</count>
</query>
</iq>
<iq to="grimoire@muc.metronome.im" id="get_logs" type="get">
<query xmlns="http://metronome.im/protocol/muc-logs-forward">
<start>5</start>
</query>
</iq>

Optionally you can also specify the starting index from where to start, if you specify a larger index than what the actual entries in the logs are an error will be returned.

After all the log entries are forwarded a closing IQ result payload will be returned:

<iq from="grimoire@muc.metronome.im" to="romeo@montagues.lit/Gajim" id="get_logs" type="result">
<query xmlns="http://metronome.im/protocol/muc-logs-forward">
<date>2014-12-12</date>
<start>2</start>
<max>100</max>
</query>
</iq>
@maranda maranda self-assigned this Dec 20, 2014
@maranda maranda added this to the 3.7 milestone Dec 20, 2014
@maranda maranda closed this in fcae2cf Dec 20, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant