25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-11-30 16:36:29 +01:00

Don't handle useless case of Affiliation none

This commit is contained in:
Badlop 2010-07-02 23:21:54 +02:00
parent fe1a4908b5
commit c89944fe12

View File

@ -1202,17 +1202,11 @@ set_affiliation(JID, Affiliation, StateData) ->
end, end,
StateData#state{affiliations = Affiliations}. 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), LJID = jlib:short_prepd_bare_jid(JID),
Affiliations = case Affiliation of Affiliations = ?DICT:store(LJID, {Affiliation, Reason},
none -> StateData#state.affiliations),
?DICT:erase(LJID,
StateData#state.affiliations);
_ ->
?DICT:store(LJID,
{Affiliation, Reason},
StateData#state.affiliations)
end,
StateData#state{affiliations = Affiliations}. StateData#state{affiliations = Affiliations}.
get_affiliation(JID, StateData) -> get_affiliation(JID, StateData) ->