diff --git a/ChangeLog b/ChangeLog index 224aa8ec4..fb795ab15 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2009-03-07 Badlop + + * src/mod_privacy.erl: Temporary workaround to inconsistency + * src/mod_privacy_odbc.erl: Likewise + 2009-03-06 Badlop * src/eldap/eldap.erl: moves waiting for response queries to diff --git a/src/mod_privacy.erl b/src/mod_privacy.erl index 2ef8e7a49..03f042aa3 100644 --- a/src/mod_privacy.erl +++ b/src/mod_privacy.erl @@ -655,27 +655,14 @@ is_ptype_match(Item, PType) -> end. +%% TODO: Investigate this: sometimes Value has binaries, other times has strings is_type_match(Type, Value, JID, Subscription, Groups) -> case Type of jid -> - case Value of - {undefined, Server, undefined} -> - case JID of - {_, Server, _} -> - true; - _ -> - false - end; - {User, Server, undefined} -> - case JID of - {User, Server, _} -> - true; - _ -> - false - end; - _ -> - Value == JID - end; + {User, Server, Resource} = Value, + ((User == undefined) orelse (User == []) orelse (User == exmpp_jid:lnode(JID))) + andalso ((Server == undefined) orelse (Server == []) orelse (Server == exmpp_jid:ldomain(JID))) + andalso ((Resource == undefined) orelse (Resource == []) orelse (Resource == exmpp_jid:lresource(JID))); subscription -> Value == Subscription; group -> diff --git a/src/mod_privacy_odbc.erl b/src/mod_privacy_odbc.erl index 90fb41e62..42e84e520 100644 --- a/src/mod_privacy_odbc.erl +++ b/src/mod_privacy_odbc.erl @@ -654,27 +654,14 @@ is_ptype_match(Item, PType) -> end. +%% TODO: Investigate this: sometimes Value has binaries, other times has strings is_type_match(Type, Value, JID, Subscription, Groups) -> case Type of jid -> - case Value of - {undefined, Server, undefined} -> - case JID of - {_, Server, _} -> - true; - _ -> - false - end; - {User, Server, undefined} -> - case JID of - {User, Server, _} -> - true; - _ -> - false - end; - _ -> - Value == JID - end; + {User, Server, Resource} = Value, + ((User == undefined) orelse (User == []) orelse (User == exmpp_jid:lnode(JID))) + andalso ((Server == undefined) orelse (Server == []) orelse (Server == exmpp_jid:ldomain(JID))) + andalso ((Resource == undefined) orelse (Resource == []) orelse (Resource == exmpp_jid:lresource(JID))); subscription -> Value == Subscription; group ->