ejabberd - Comments for "Problem including mod_roster in custom roster written in Elixir" https://www.ejabberd.im/forum/28573/problem-including-modroster-custom-roster-written-elixir en Disclaimer: I only know how https://www.ejabberd.im/forum/28573/problem-including-modroster-custom-roster-written-elixir#comment-67143 <p>Disclaimer: I only know how the standard ejabberd works, I didn't dig into Elixir. So my help is only for the non-Elixir code and config. Take what you can use from it.</p> <p>This line just tells the compiler to include a header file, where some constants and other structures are defined:<br /> -include("mod_roster.hrl")</p> <p>mod_roster is the main module, it contains the main function definitions. For some roster features that require read or write in a database, its functions delegate that into the different database modules, like in:</p> <pre> read_roster_version(LUser, LServer) -&gt; Mod = gen_mod:db_mod(LServer, ?MODULE), Mod:read_roster_version(LUser, LServer). </pre><p>This will get which database module is configured for LServer, and then calls that module's read_roster_version function.</p> <p>To develop a new database storage, copy mod_roster_riak.erl to mod_roster_test.erl, fix the first line<br /> -module(mod_roster_riak).<br /> Then, for each of the exported functions (that mod_roster will call when required), put your desired code.<br /> Finally, configure mod_roster to use test as its database:</p> <pre> mod_roster: db_type: test </pre> Fri, 21 Oct 2016 09:39:23 +0000 badlop comment 67143 at https://www.ejabberd.im