@Override public void sendInvitationRejection(JID to, String reason, JID sender) { if (((MultiUserChatServiceImpl)mucService).getMUCDelegate() != null) { switch(((MultiUserChatServiceImpl)mucService).getMUCDelegate().sendingInvitationRejection(this, to, sender, reason)) { case HANDLED_BY_DELEGATE: //if the delegate is taking care of it, there's nothing for us to do return; case HANDLED_BY_OPENFIRE: //continue as normal if we're asked to handle it break; } } Message message = new Message(); message.setFrom(role.getRoleAddress()); message.setTo(to); Element frag = message.addChildElement("x", "http://jabber.org/protocol/muc#user"); frag.addElement("decline").addAttribute("from", sender.toBareJID()); if (reason != null && reason.length() > 0) { frag.element("decline").addElement("reason").setText(reason); } // Send the message with the invitation router.route(message); }
@Override public void sendInvitationRejection(JID to, String reason, JID sender) { if (((MultiUserChatServiceImpl)mucService).getMUCDelegate() != null) { switch(((MultiUserChatServiceImpl)mucService).getMUCDelegate().sendingInvitationRejection(this, to, sender, reason)) { case HANDLED_BY_DELEGATE: //if the delegate is taking care of it, there's nothing for us to do return; case HANDLED_BY_OPENFIRE: //continue as normal if we're asked to handle it break; } } Message message = new Message(); message.setFrom(role.getRoleAddress()); message.setTo(to); Element frag = message.addChildElement("x", "http://jabber.org/protocol/muc#user"); frag.addElement("decline").addAttribute("from", sender.toBareJID()); if (reason != null && reason.length() > 0) { frag.element("decline").addElement("reason").setText(reason); } // Send the message with the invitation router.route(message); }