From e27dda3ff1378ff9c0b4291b0d563466ff2f186b Mon Sep 17 00:00:00 2001 From: Badlop Date: Tue, 15 Jun 2010 22:59:53 +0200 Subject: [PATCH] Fix for Erlang R12, that doesn't support: true andalso ok --- src/ejabberd_sm.erl | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/ejabberd_sm.erl b/src/ejabberd_sm.erl index 3d1984ad0..d85d474fd 100644 --- a/src/ejabberd_sm.erl +++ b/src/ejabberd_sm.erl @@ -646,10 +646,14 @@ route_message(From, To, Packet) -> case ejabberd_auth:is_user_exists(exmpp_jid:prep_node_as_list(To), exmpp_jid:prep_domain_as_list(To)) of true -> - is_privacy_allow(From, To, Packet) andalso - ejabberd_hooks:run(offline_message_hook, - exmpp_jid:prep_domain(To), - [From, To, Packet]); + case is_privacy_allow(From, To, Packet) of + true -> + ejabberd_hooks:run(offline_message_hook, + exmpp_jid:prep_domain(To), + [From, To, Packet]); + false -> + ok + end; _ -> Err = exmpp_stanza:reply_with_error( Packet, 'service-unaivailable'),