on_presence_stanza callback for XMPP directed presence in JAXL

159 views Asked by At

I have coded an XMPP client in PHP using JAXL (along the lines of the included echobot example). The client also implements XEP-0045 (MUC) and I can join groupchats without issue. The problem is that the registered callback for presence messages only appears to get called for presence messages inside the groupchats, e.g. whenever another user enters or leaves. I would like to send my client directed presence stanzas as well (outside the chat room). As coded below, these do not fire the callback.

$client->add_cb('on_presence_stanza', function($stanza) {
    global $client, $room_full_jid, $room_full_jid2;
    _info("got on_presence_stanza....");
    //.....
});

How do I need to register the callback in order to get the client to respond to directed presence as well?

0

There are 0 answers