From b02bc1c9bc66045ac44fae26d413711f7ffe571e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wolfgang=20Hu=C3=9F?= Date: Thu, 16 Jan 2020 13:57:31 +0100 Subject: [PATCH] Notify all filing reporters in the seeding of the database --- backend/src/seed/seed-db.js | 38 +++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/backend/src/seed/seed-db.js b/backend/src/seed/seed-db.js index 4178169bb..e219d287e 100644 --- a/backend/src/seed/seed-db.js +++ b/backend/src/seed/seed-db.js @@ -689,18 +689,21 @@ const languages = ['de', 'en', 'es', 'fr', 'it', 'pt', 'pl'] reasonDescription: 'This user is harassing me with bigoted remarks!', }), reportAgainstDagobert.relateTo(dagobert, 'belongsTo'), + reportAgainstTrollingPost.relateTo(jennyRostock, 'filed', { resourceId: 'p2', reasonCategory: 'doxing', reasonDescription: "This shouldn't be shown to anybody else! It's my private thing!", }), reportAgainstTrollingPost.relateTo(p2, 'belongsTo'), + reportAgainstTrollingComment.relateTo(huey, 'filed', { resourceId: 'c1', reasonCategory: 'other', reasonDescription: 'This comment is bigoted', }), reportAgainstTrollingComment.relateTo(trollingComment, 'belongsTo'), + reportAgainstDewey.relateTo(dagobert, 'filed', { resourceId: 'u5', reasonCategory: 'discrimination_etc', @@ -708,6 +711,25 @@ const languages = ['de', 'en', 'es', 'fr', 'it', 'pt', 'pl'] }), reportAgainstDewey.relateTo(dewey, 'belongsTo'), ]) + // notify first reports + await Promise.all([ + reportAgainstDagobert.relateTo(jennyRostock, 'notified', { + read: false, + reason: 'filed_report_on_resource', + }), + reportAgainstTrollingPost.relateTo(jennyRostock, 'notified', { + read: false, + reason: 'filed_report_on_resource', + }), + reportAgainstTrollingComment.relateTo(huey, 'notified', { + read: false, + reason: 'filed_report_on_resource', + }), + reportAgainstDewey.relateTo(dagobert, 'notified', { + read: false, + reason: 'filed_report_on_resource', + }), + ]) // report resource a second time await Promise.all([ @@ -717,6 +739,7 @@ const languages = ['de', 'en', 'es', 'fr', 'it', 'pt', 'pl'] reasonDescription: 'this user is attacking me for who I am!', }), reportAgainstDagobert.relateTo(dagobert, 'belongsTo'), + reportAgainstTrollingPost.relateTo(peterLustig, 'filed', { resourceId: 'p2', reasonCategory: 'discrimination_etc', @@ -731,6 +754,21 @@ const languages = ['de', 'en', 'es', 'fr', 'it', 'pt', 'pl'] }), reportAgainstTrollingComment.relateTo(trollingComment, 'belongsTo'), ]) + // notify second reports + await Promise.all([ + reportAgainstDagobert.relateTo(louie, 'notified', { + read: false, + reason: 'filed_report_on_resource', + }), + reportAgainstTrollingPost.relateTo(peterLustig, 'notified', { + read: false, + reason: 'filed_report_on_resource', + }), + reportAgainstTrollingComment.relateTo(bobDerBaumeister, 'notified', { + read: false, + reason: 'filed_report_on_resource', + }), + ]) const disableVariables = { resourceId: 'undefined-resource',