If user is banned from the muc (via xep-0045) and has subscription (via mucsub), pubsub events is still available from that muc room. And if user which has subscription to muc room is banned from that muc room and after some time user unsubscribes that room, meanwhile owner decides to set affiliation from outcast to none (removes ban) server replies Nickname x does not exist in the room. It's because user unsubscribed room.
I have changed code in mod_muc_room.erl
added this part of code in process_item_change/3 case clause
{JID, affiliation, outcast, Reason} ->
LBareJID = jid:tolower(jid:remove_resource(JID)),
case ?DICT:find(LBareJID, SD#state.subscribers) of
{ok, #subscriber{nick = Nick}} ->
Nicks = ?DICT:erase(Nick, SD#state.subscriber_nicks),
Subscribers = ?DICT:erase(LBareJID, SD#state.subscribers),
NewSD = SD#state{subscribers = Subscribers,
subscriber_nicks = Nicks},
store_room(NewSD, [{del_subscription, LBareJID}]),
send_subscriptions_change_notifications(JID, Nick, unsubscribe, NewSD);
_ ->
NewSD = SD,
ok
end,
it's removes user subscription, but when owners wants to remove ban as i said server replies "Nickname does not exist in the room"