powered by Jive Software

Server side avoid to revoke own role in conference

This is post regarding a bug.That a user who granted power by owner cannot allowed to revoke his/her role. I was trying to post it under openfire server issue with its solution.

go in IQAdminHandler file replace IQHandle() method
public void handleIQ(IQ packet, MUCRole role) throws ForbiddenException, ConflictException,
NotAllowedException, CannotBeInvitedException {
IQ reply = IQ.createResultIQ(packet);
Element element = packet.getChildElement();

    // Analyze the action to perform based on the included element
    @SuppressWarnings("unchecked")
    List<Element> itemsList = element.elements("item");
    if (!itemsList.isEmpty() && packet.getFrom() == null) {
        handleItemsElement(role, itemsList, reply);
    } else if (!itemsList.isEmpty() && !itemsList.toString().contains(packet.getFrom().toBareJID())) {
        handleItemsElement(role, itemsList, reply);
    } else {
        // An unknown and possibly incorrect element was included in the query
        // element so answer a BAD_REQUEST error
        reply.setChildElement(packet.getChildElement().createCopy());
        reply.setError(PacketError.Condition.bad_request);
    }
    if (reply.getTo() != null) {
        // Send a reply only if the sender of the original packet was from a real JID. (i.e. not
        // a packet generated locally)
        router.route(reply);
    }
}

Many peoples looking for this solution. I hope it helps them.

Thanks. Would you kindly like to submit this change as a github pull request?

hi @akrherz when am trying to push from netbeans my commit am getting error.

https://devilmaycare24%40gmail.com@github.com/igniterealtime/Openfire.git: git-receive-pack not permitted

You will need to fork the Openfire repository, push your suggested change to (a branch of) your fork, and then create a PR. There are plenty of tutorials to be found that can help you do this. I like this one: https://github.com/firstcontributions/first-contributions

@Guus Thank you. I have created fork as that link suggested and committed the changes.

Great, have you now made a pull request to ignite’s repo from your bugfix branch?

@akrherz I never gone that deep in version control with github. But as I see that my branch is with 4.7 also. Can you Please confirm

Greetings, Did you push that commit on your 4.7 branch up to github? If so, then github should pop a user interface element on the page you have screenshotted with the next step to create the pull request.

Dear @akrherz I found latest 4.6 there I have commit code.