@Override
public void handle(MessageEvent e) {
if (e.isIncoming()) {
Message message = e.getMessage();
// Check, if the message contains a mediated invitation.
MucUser mucUser = message.getExtension(MucUser.class);
if (mucUser != null) {
for (Invite invite : mucUser.getInvites()) {
notifyListeners(new InvitationEvent(MultiUserChatManager.this, xmppSession, invite.getFrom(), message.getFrom(), invite.getReason(), mucUser.getPassword(), invite.isContinue(), invite.getThread(), true));
}
} else {
// Check, if the message contains a direct invitation.
DirectInvitation directInvitation = message.getExtension(DirectInvitation.class);
if (directInvitation != null) {