Coder Social home page Coder Social logo

ndl / mod_archive2 Goto Github PK

View Code? Open in Web Editor NEW
27.0 27.0 5.0 753 KB

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

Shell 0.23% Erlang 99.77%

mod_archive2's People

Contributors

ndl avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

mod_archive2's Issues

Implement XEP-0313

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.

test suite cannot be run against a server other than localhost

  • There are a bunch of hardcoded "localhost" strings floating about that I had to manually sed out of the way to even get started.
  • test/config.hrl.example has SERVERHOST and SERVERNAME.
    • I think SERVERHOST is used as both the domain part of the jid and the dns record to lookup for the purposes of connecting the c2s socket. https://github.com/esl/ejabberd_tests allows you to set these two things separately (which is really useful if your ejabberd cluster has more than one node)
    • SERVERNAME is only used as:
      test/regression/general.erl: Node = list_to_atom(?SERVERNAME "@" ?SERVERHOST),
    • Probably better to simply set Node as an atom in test/config.hrl ?

Milliseconds are stripped @ dbms_storage_odbc.erl

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

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

'auto' command with 'stream' scope shouldn't cause push notification

'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.

Collections & messages ordering doesn't use secondary sort by ID

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.

How to config with mod_archive2 ?

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

configure mod_archive2 with ejabberd 14.07?

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?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.