Hi there. I’'ve been trying to familiarize myself with smack over the past couple of weeks and have run into a wall with this problem. I would like my bot to sit in a MUC room (most likely a bunch of them) and listen for when users join the room so that it can then whisper (room/nick) to them an On Join message like a MOTD or Rules or whatever.
As far as I can tell from reading the JEP-45 and looking at raw XMPP, when a user joins a room, the room broadcasts a presence update for that user to everyone in the channel. However, this presence update does not contain a status or any of the regular “type” fields that the Smack Presence class gives access to. Instead, it simply contains a reference to the MUC website and lists the user’'s JID and their “role=participant” message.
I’‘ve tried using the roster, but not all users are guaranteed to be in my bot’‘s roster. I’'ve also tried using the ParticipantStatusListener checking for every possible role transition (ie visitor->participant, etc), and none of them seem to get called due to the presence message.
Also, I’‘m unclear as to the purpose of the MUCInitialPresence class, which at first glance would seem to be what I want, but I can’'t figure out how it is supposed to be used.