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.
--- 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