Smack 4.4.6: MultiUserChat #checkPresenceCode() method always return a null actor Jid in listener.kicked() callback

MultiUserChat#checkPresenceCode() method always return a null ‘actor’ Jid in listener.kick() callback i.e.

        if (statusCodes.contains(Status.KICKED_307)) {
            // Check if this occupant was kicked
            if (isUserModification) {
                for (UserStatusListener listener : userStatusListeners) {
                    listener.kicked(mucUser.getItem().getActor(), mucUser.getItem().getReason());
            else {
                for (ParticipantStatusListener listener : participantStatusListeners) {
                    listener.kicked(from, mucUser.getItem().getActor(), mucUser.getItem().getReason());

In reviewing the smack source, it seems that MUCItem#actor never get initialised. The method

public void kickParticipant(Resourcepart nickname, String reason)

only take in nickname as one of the parameter, hence only actorNick is being initialised.
May be the team would consider to make the callback as

listener.kicked(mucUser.getItem().getActorNick(), mucUser.getItem().getReason());

The example given below contains only nick as one of attributes .
XEP-0045: Multi-User Chat# 8.2 Kicking an Occupant

1 Like

This topic was automatically closed 100 days after the last reply. New replies are no longer allowed.