diff --git a/mod_spam_filter/src/mod_spam_filter.erl b/mod_spam_filter/src/mod_spam_filter.erl index 0458b1a..3affd0f 100644 --- a/mod_spam_filter/src/mod_spam_filter.erl +++ b/mod_spam_filter/src/mod_spam_filter.erl @@ -485,12 +485,15 @@ reject(#message{from = From, to = To, type = Type, lang = Lang} = Msg) Type /= error -> ?INFO_MSG("Rejecting unsolicited message from ~s to ~s", [jid:encode(From), jid:encode(To)]), - Txt = <<"Your traffic is unsolicited">>, + Txt = <<"Your message is unsolicited">>, Err = xmpp:err_policy_violation(Txt, Lang), ejabberd_router:route_error(Msg, Err); -reject(#presence{from = From, to = To}) -> +reject(#presence{from = From, to = To, lang = Lang} = Presence) -> ?INFO_MSG("Rejecting unsolicited presence from ~s to ~s", - [jid:encode(From), jid:encode(To)]); + [jid:encode(From), jid:encode(To)]), + Txt = <<"Your traffic is unsolicited">>, + Err = xmpp:err_policy_violation(Txt, Lang), + ejabberd_router:route_error(Presence, Err); reject(_) -> ok.