25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-11-22 16:20:52 +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
is_type_match(Type, Value, JID, Subscription, Groups) ->
case Type of
jid ->
is_type_match(jid, Value, JIDtuple, Subscription, Groups) ->
{User, Server, Resource} = Value,
JID = exmpp_jid:make(JIDtuple),
((User == undefined) orelse (User == []) orelse (User == exmpp_jid:prep_node(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)));
subscription ->
is_type_match(subscription, Value, JID, Subscription, Groups) ->
Value == Subscription;
group ->
lists:member(Value, Groups)
end.
is_type_match(group, Value, JID, Subscription, Groups) ->
lists:member(Value, Groups).
remove_user(User, Server) ->