ndl / mod_archive2 Goto Github PK
View Code? Open in Web Editor NEWmod_archive2 is new ejabberd module implementing server-side instant messaging history support specified in XEP-136.
Home Page: http://www.ndl.kiev.ua/content/modarchive2
mod_archive2 is new ejabberd module implementing server-side instant messaging history support specified in XEP-136.
Home Page: http://www.ndl.kiev.ua/content/modarchive2
Although this is not specified in XEP-136, as 'auto' setting is under 'prefs' namespace, and all other prefs changes push notifications are sent in this namespace - it makes sense to do the same for 'auto' command as well.
I intend to implement XEP-0313 on top of mod_archive2. I will probably do it as a fork initially, and not worry about breaking XEP-0136 support in the process.
I will be using this issue to track my progress. If you have any hints, give me a shout.
Considering all RDBMS backends (PostgreSQL, SQLite3 & MySQL starting from 5.6.4 version) support milliseconds storage - we shouldn't strip milliseconds, as it makes "natural / user-expected" ordering of collections & messages easier.
How to compile mod_archive2 module
Steps I done
$ cd to_mod_archive2_dir
$ erl -make
Recompile: src/xmpp_api_ejabberd
src/xmpp_api_ejabberd.erl:29: can't find include file "ejabberd.hrl"
src/xmpp_api_ejabberd.erl:30: can't find include lib "exmpp/include/exmpp.hrl"
src/xmpp_api_ejabberd.erl:43: undefined macro 'MYHOSTS'
src/xmpp_api_ejabberd.erl:46: undefined macro 'INFO_MSG/2'
src/xmpp_api_ejabberd.erl:49: undefined macro 'ERROR_MSG/2'
src/xmpp_api_ejabberd.erl:84: undefined macro 'NS_JABBER_CLIENT'
src/xmpp_api_ejabberd.erl:32: function error_msg/2 undefined
src/xmpp_api_ejabberd.erl:32: function get_valid_hosts/0 undefined
src/xmpp_api_ejabberd.erl:32: function info_msg/2 undefined
src/xmpp_api_ejabberd.erl:32: function iq_to_exmpp/1 undefined
src/xmpp_api_ejabberd.erl:60: record iq undefined
src/xmpp_api_ejabberd.erl:93: Warning: function iq_type_to_string/1 is unused
src/xmpp_api_ejabberd.erl:99: Warning: function iq_to_xml/1 is unused
Then I copied ejabberd.hrl from ejabberd/include to src of mod_archive
$ erl -make
Recompile: src/xmpp_api_ejabberd
src/xmpp_api_ejabberd.erl:30: can't find include lib "exmpp/include/exmpp.hrl"
src/xmpp_api_ejabberd.erl:46: undefined macro 'INFO_MSG/2'
src/xmpp_api_ejabberd.erl:49: undefined macro 'ERROR_MSG/2'
src/xmpp_api_ejabberd.erl:84: undefined macro 'NS_JABBER_CLIENT'
src/xmpp_api_ejabberd.erl:32: function error_msg/2 undefined
src/xmpp_api_ejabberd.erl:32: function info_msg/2 undefined
src/xmpp_api_ejabberd.erl:32: function iq_to_exmpp/1 undefined
src/xmpp_api_ejabberd.erl:60: record iq undefined
src/xmpp_api_ejabberd.erl:93: Warning: function iq_type_to_string/1 is unused
src/xmpp_api_ejabberd.erl:99: Warning: function iq_to_xml/1 is unused
Then I get the exmpp code from processsone/exmpp
Now I am having these error's
$ erl -make
Recompile: src/xmpp_api_ejabberd
src/xmpp_api_ejabberd.erl:46: undefined macro 'INFO_MSG/2'
src/xmpp_api_ejabberd.erl:49: undefined macro 'ERROR_MSG/2'
src/xmpp_api_ejabberd.erl:32: function error_msg/2 undefined
src/xmpp_api_ejabberd.erl:32: function info_msg/2 undefined
@ndl Please guide me, Thanks in advance
'stream' scope is relevant only to the stream that sent it, so push notifications shouldn't be sent to other streams to avoid clients wrongly assuming it affects them, and considering the originating client already knows the setting will be changed - there's no need to send push notification at all.
When multiple collections or messages have the same timestamp, current code doesn't ensure the ordering is consistent. This might result in wrong responses to clients when using partial results fetching via RSM. The code should do second-level sorting by collection / message ID to mitigate it.
Hi ndl,
I'm working on ejabberd, i want to save archive message with full message stanza.. I found a solution that install mod_archive2. But i can't find any configuration example.
This is my ejabberd.cfg:
{mod_archive2, [{database_type, "mysql"},
{default_auto_save, "message"},
{read_only, false},
{default_expire, infinity},
{enforce_min_expire, 0},
{enforce_max_expire, infinity},
{replication_expire, 31536000},
{session_duration, 1800},
{wipeout_interval, 86400},
{prefs_cache_interval, 86400}]}
But service return this error below:
<body xmlns="http://jabber.org/protocol/httpbind">
<iq xmlns="jabber:client" from="[email protected]" to="[email protected]/webchat-5830" type="error" id="4881:sendIQ">
<pref xmlns="http://www.xmpp.org/extensions/xep-0136.html#ns" />
<error code="503" type="cancel">
<service-unavailable xmlns="urn:ietf:params:xml:ns:xmpp-stanzas" />
</error>
</iq>
<presence xmlns="jabber:client" from="[email protected]/webchat-5830" to="[email protected]/webchat-5830" />
</body>
Please help config my ejabberd server to use mod_archive2. Thank you so much
Example 21 from XEP-136 spec results in the following messages being retrieved later from the collection:
<from xmlns="" secs="0">
<body>
<body xmlns="urn:xmpp:archive">Art thou not Romeo, and a Montague?</body>
</body>
what files should I compile and move the beam files to ebin directory of ejabberd? I have a ejabberd.yml file instead of ejabberd.cfg that was used in previous versions of ejabberd,what part should be added in the ejabberd.yml config file.
There is hardly anything that documents what is to be done for configuration of mod_archive2.Any help?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.