[ejabberd] externally adding roster items to mod_roster_odbc?[WHITELIST]

Stephan Maihöfer sma at turtle-entertainment.de
Thu Apr 2 12:32:40 MSD 2009


> -----Ursprüngliche Nachricht-----
> [mailto:ejabberd-bounces at jabber.ru] Im Auftrag von Yermo Lamers
> I understand that directly inserting entries into the 
> rosterusers Mysql table, especially when users are online, is 
> likely a Bad Idea(tm). Is this true?

what we do, is that we add the rosteritem directly
to the database. this way a newly connecting client
will get the new roster. no problem.

to update the roster for connected clients, we connect
to the jabber-server (as the user that is to receive
the rosteritem) and simply sent an <iq type="set">
of the new rosteritem. since the <iq> comes from the
same bare-jid it should be trusted by the client
(as is stated in the XEP) and the rosteritem is added
to the roster.

this way you will have a "temporary rosteritem" for that
session. but on reconnect the client will read it's roster
from the database and get the new item that way.


More information about the ejabberd mailing list