From c89944fe1241ed374bb1aa449bf55438a224efb3 Mon Sep 17 00:00:00 2001 From: Badlop Date: Fri, 2 Jul 2010 23:21:54 +0200 Subject: [PATCH] Don't handle useless case of Affiliation none --- src/mod_muc/mod_muc_room.erl | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/src/mod_muc/mod_muc_room.erl b/src/mod_muc/mod_muc_room.erl index 32e1bd5ac..b984e6a4c 100644 --- a/src/mod_muc/mod_muc_room.erl +++ b/src/mod_muc/mod_muc_room.erl @@ -1202,17 +1202,11 @@ set_affiliation(JID, Affiliation, StateData) -> end, StateData#state{affiliations = Affiliations}. -set_affiliation_and_reason(JID, Affiliation, Reason, StateData) -> +set_affiliation_and_reason(JID, Affiliation, Reason, StateData) + when Affiliation /= none -> LJID = jlib:short_prepd_bare_jid(JID), - Affiliations = case Affiliation of - none -> - ?DICT:erase(LJID, - StateData#state.affiliations); - _ -> - ?DICT:store(LJID, - {Affiliation, Reason}, - StateData#state.affiliations) - end, + Affiliations = ?DICT:store(LJID, {Affiliation, Reason}, + StateData#state.affiliations), StateData#state{affiliations = Affiliations}. get_affiliation(JID, StateData) ->