Presence subscription not working with custom rosterusers view

I've setup a XMPP server where we wanted a custom friendlist that could be changed from outside of XMPP
We followed the stack overflow thread here and created a custom view that contains the data we want http://stackoverflow.com/questions/11360759/efficient-external-rostering...

However when a new row is added to the view the affected clients does not get subscribed to each others presence updates. They do however get properly subscribed to each other if they both first logout and then login again.

example:
User A sets it's presence like

    <presence from="[jid_A]">
        <priority>5</priority>
        <show>away</show>
    </presence>

but User B does not receive this presence even though the result from the roster stanza:

    <iq type="get">
        <query xmlns="jabber:iq:roster" />
    </iq>

contains User A like this:

    <iq from="[jid_B]" type="result" to="[jid_B]">
        <query xmlns="jabber:iq:roster">
            <item subscription="both" name="McFluffy" jid="[jid_A]"/>
        </query>
    </iq>

I've tried manually sending different kinds of directed presence between the two clients but that did not solve the issue, and I'm a little bit lost here from now.

    <presence from="[jid_A]" to="[jid_B]"/>

I've also tried with a presence type of probe, subscribe, unavailable etc.

Does anyone have any feedback on what is causing this and how to solve it?
Are changes to the server required or can it be solved on client side?

> However when a new row is

> However when a new row is added to the view

And does anybody alert ejabberd that it should do anything? I mean, when a client logins, it requests the roster and mod_roster sends it to the client. Or when a client requests subscription to another client, then mod_roster performs that request, etc. I mean, if you change the DB, how can ejabberd know magically that anything changed?

The only way I can think is what you attempt: when the database changes, send some stanza to push that change to the corresponding users' clients. See mod_admin_extra command add_rosteritem, specifically the function push_roster_item(LU, LS, R, U, S, Action)

We ended up writing a module

We ended up writing a module on the XMPP that calls on add_rosteritem when it receives a custom stanza from our external server that holds the roster view and handles the friends relationships.

thanks for your answer!

Syndicate content