Re: Roster module with custom MySQL requests

2014-04-29 Thread Sylvain Guglielmi
Le 01/04/2014 14:23, Tomasz Sterna a écrit : Dnia 2014-04-01, wto o godzinie 12:14 +0200, Sylvain Guglielmi pisze: The problem is : - When an user connects to jabberd2 for the first time, the active,logout... tables are empty, and the roster is already filled. - The code in dispatch.c : 130

Re: Roster module with custom MySQL requests

2014-04-01 Thread Sylvain Guglielmi
Hello again everyone, I have some questions concerning dispatch.c, but first a short recap of the plugin I'm working on : - the plugin replaces roster and allows to write custom sql requests for accessing data (instead of the storage component). The purpose is to be able to use our

Re: Roster module with custom MySQL requests

2014-04-01 Thread Sylvain Guglielmi
Le 01/04/2014 14:23, Tomasz Sterna a écrit : Just remove 'active' module from 'user-load' chain in your sm.xml. Oh, haven't thought of that. *dumb me* (I wrongly assumed all the modules would fail to user_load without calling user_create first. Didn't think it was the purpose of the active

Re: Roster module with custom MySQL requests

2014-04-01 Thread Tomasz Sterna
Dnia 2014-04-01, wto o godzinie 15:56 +0200, Sylvain Guglielmi pisze: Is it safe/better/not a good idea to deactivate the active plugin from every chain (user_load; user_create; user_delete) ? It's main function is to drop messages to unexisting users instead of storing them in offline messages

Re: Roster module with custom MySQL requests

2014-04-01 Thread Sylvain Guglielmi
Le 01/04/2014 16:40, Tomasz Sterna a écrit : Dnia 2014-04-01, wto o godzinie 15:56 +0200, Sylvain Guglielmi pisze: Is it safe/better/not a good idea to deactivate the active plugin from every chain (user_load; user_create; user_delete) ? It's main function is to drop messages to unexisting

Re: Roster module with custom MySQL requests

2014-01-17 Thread Sylvain Guglielmi
Le 10/01/2014 18:23, Tomasz Sterna a écrit You could have a separate cron component pinging 'sm' in regular intervals with special route packet, and handle this special packet in 'in-router' chain of your module. Having that it could even be done not in regular intervals, but on-demand, when

Re: Roster module with custom MySQL requests

2014-01-10 Thread Sylvain Guglielmi
Another issue I'm facing : I need my module to be able to detect changes in the database and report it to the connected users if necessary. (Use case : the person adds a friend with something else than a XMPP client, like a web page interface or a webservice API, while she's connected). The

Re: Roster module with custom MySQL requests

2014-01-10 Thread Tomasz Sterna
Dnia 2014-01-10, pią o godzinie 13:54 +0100, Sylvain Guglielmi pisze: My question : Should I add a timetick chain to the SM (called every second for example), and add my module to this chain (with a rate_t check) ? I'm not thrilled by this solution, because for now, I haven't changed any code

Re: Roster module with custom MySQL requests

2014-01-08 Thread Tomasz Sterna
Dnia 2014-01-08, śro o godzinie 03:02 +0100, Sylvain Gugli Guglielmi pisze: I can have something like UPDATE `roster-items` SET `object-sequence`=`object-sequence`+1 but his break uniqueness in the table. I come from PostgreSQL, so explicitly handled sequences is natural to me: UPDATE

Re: Roster module with custom MySQL requests

2014-01-07 Thread Tomasz Sterna
Dnia 2014-01-07, wto o godzinie 02:14 +0100, Sylvain Gugli Guglielmi pisze: As I understand it, the object-sequence don't need to be an UNIQUE field. Am I right on that ? object-sequence is used mainly for sorting - to keep stanza ordering, etc. There is no enforcement on uniqueness, but in

Re: Roster module with custom MySQL requests

2014-01-07 Thread Sylvain Gugli Guglielmi
Le 07/01/2014 13:22, Tomasz Sterna a écrit : object-sequence is used mainly for sorting - to keep stanza ordering, etc. There is no enforcement on uniqueness, but in cases when you do care on ordering, these should be unique. In roster table you should be fine with just incrementing ver. BTW,

Re: Roster module with custom MySQL requests

2014-01-06 Thread Tomasz Sterna
Dnia 2014-01-06, pon o godzinie 18:07 +0100, Sylvain Guglielmi pisze: Hello everyone, To use jabberd2 with my pre-existing contacts database, I started writing a roster module with customisable MySQL requests (I mailed this list a while back about it, but I just started actual work). It uses

Re: Roster module with custom MySQL requests

2014-01-06 Thread Sylvain Gugli Guglielmi
Le 07/01/2014 00:59, Tomasz Sterna a écrit : Dnia 2014-01-06, pon o godzinie 18:07 +0100, Sylvain Guglielmi pisze: Hello everyone, To use jabberd2 with my pre-existing contacts database, I started writing a roster module with customisable MySQL requests (I mailed this list a while back about