# HG changeset patch # User Kim Alvefur # Date 1629896756 -7200 # Node ID 4eb684ab440c1712d6b5883149aea5a2480530d0 # Parent 7f61d89a594dd8441c30de993db9537d623124b8 mod_spam_reporting: Handle unknown or future report types An unrecognised value in the 'reason' attribute would have caused an error. This change makes it mirror the behavior for the previous XEP version. diff -r 7f61d89a594d -r 4eb684ab440c mod_spam_reporting/mod_spam_reporting.lua --- a/mod_spam_reporting/mod_spam_reporting.lua Wed Aug 25 16:05:09 2021 +0200 +++ b/mod_spam_reporting/mod_spam_reporting.lua Wed Aug 25 15:05:56 2021 +0200 @@ -1,5 +1,5 @@ -- XEP-0377: Spam Reporting for Prosody --- Copyright (C) -2016 Kim Alvefur +-- Copyright (C) 2016-2021 Kim Alvefur -- -- This file is MIT/X11 licensed. @@ -28,7 +28,7 @@ else report = item:get_child("report", "urn:xmpp:reporting:1"); if report and jid then - local type + local type = "unknown"; if report.attr.reason == "urn:xmpp:reporting:abuse" then type = "abuse"; end