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

Fix crash because JID is a 3-tuple

This commit is contained in:
Badlop 2010-06-03 12:19:52 +02:00
parent b1dfb4b5f2
commit e3e888b8de

View File

@ -655,18 +655,16 @@ is_ptype_match(Item, PType) ->
%% TODO: Investigate this: sometimes Value has binaries, other times has strings %% TODO: Investigate this: sometimes Value has binaries, other times has strings
is_type_match(Type, Value, JID, Subscription, Groups) -> is_type_match(jid, Value, JIDtuple, Subscription, Groups) ->
case Type of {User, Server, Resource} = Value,
jid -> JID = exmpp_jid:make(JIDtuple),
{User, Server, Resource} = Value, ((User == undefined) orelse (User == []) orelse (User == exmpp_jid:prep_node(JID)))
((User == undefined) orelse (User == []) orelse (User == exmpp_jid:prep_node(JID))) andalso ((Server == undefined) orelse (Server == []) orelse (Server == exmpp_jid:prep_domain(JID)))
andalso ((Server == undefined) orelse (Server == []) orelse (Server == exmpp_jid:prep_domain(JID))) andalso ((Resource == undefined) orelse (Resource == []) orelse (Resource == exmpp_jid:prep_resource(JID)));
andalso ((Resource == undefined) orelse (Resource == []) orelse (Resource == exmpp_jid:prep_resource(JID))); is_type_match(subscription, Value, JID, Subscription, Groups) ->
subscription -> Value == Subscription;
Value == Subscription; is_type_match(group, Value, JID, Subscription, Groups) ->
group -> lists:member(Value, Groups).
lists:member(Value, Groups)
end.
remove_user(User, Server) -> remove_user(User, Server) ->