Skip to content

Commit

Permalink
We just need to send the pubkey
Browse files Browse the repository at this point in the history
  • Loading branch information
dcadenas committed Mar 29, 2024
1 parent f73edde commit 9fc7f84
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 29 deletions.
8 changes: 2 additions & 6 deletions src/lib/slack.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,7 @@ export default class Slack {
type: "plain_text",
text: category,
},
value: JSON.stringify({
reporterPubkey: reportRequest.reporterPubkey,
nip56_report_type: categoryData.nip56_report_type,
nip69: categoryData.nip69,
}),
value: reportRequest.reporterPubkey,
action_id: category,
};
}
Expand All @@ -54,7 +50,7 @@ export default class Slack {
type: "plain_text",
text: "Skip",
},
value: "skip",
value: reportRequest.reporterPubkey,
action_id: "skip",
});

Expand Down
35 changes: 12 additions & 23 deletions test/slack.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ describe("Slack", () => {
type: "plain_text",
text: "Skip",
},
value: "skip",
value: "npub123",
action_id: "skip",
},
{
Expand All @@ -107,8 +107,7 @@ describe("Slack", () => {
type: "plain_text",
text: "hate",
},
value:
'{"reporterPubkey":"npub123","nip56_report_type":"other","nip69":"IH"}',
value: "npub123",
action_id: "hate",
},
{
Expand All @@ -117,8 +116,7 @@ describe("Slack", () => {
type: "plain_text",
text: "hate/threatening",
},
value:
'{"reporterPubkey":"npub123","nip56_report_type":"other","nip69":"HC-bhd"}',
value: "npub123",
action_id: "hate/threatening",
},
{
Expand All @@ -127,8 +125,7 @@ describe("Slack", () => {
type: "plain_text",
text: "harassment",
},
value:
'{"reporterPubkey":"npub123","nip56_report_type":"other","nip69":"IL-har"}',
value: "npub123",
action_id: "harassment",
},
{
Expand All @@ -137,8 +134,7 @@ describe("Slack", () => {
type: "plain_text",
text: "harassment/threatening",
},
value:
'{"reporterPubkey":"npub123","nip56_report_type":"other","nip69":"HC-bhd"}',
value: "npub123",
action_id: "harassment/threatening",
},
{
Expand All @@ -147,8 +143,7 @@ describe("Slack", () => {
type: "plain_text",
text: "self-harm",
},
value:
'{"reporterPubkey":"npub123","nip56_report_type":"other","nip69":"HC-bhd"}',
value: "npub123",
action_id: "self-harm",
},
{
Expand All @@ -157,8 +152,7 @@ describe("Slack", () => {
type: "plain_text",
text: "self-harm/intent",
},
value:
'{"reporterPubkey":"npub123","nip56_report_type":"other","nip69":"HC-bhd"}',
value: "npub123",
action_id: "self-harm/intent",
},
{
Expand All @@ -167,8 +161,7 @@ describe("Slack", () => {
type: "plain_text",
text: "self-harm/instructions",
},
value:
'{"reporterPubkey":"npub123","nip56_report_type":"other","nip69":"HC-bhd"}',
value: "npub123",
action_id: "self-harm/instructions",
},
{
Expand All @@ -177,8 +170,7 @@ describe("Slack", () => {
type: "plain_text",
text: "sexual",
},
value:
'{"reporterPubkey":"npub123","nip56_report_type":"nudity","nip69":"NS"}',
value: "npub123",
action_id: "sexual",
},
{
Expand All @@ -187,8 +179,7 @@ describe("Slack", () => {
type: "plain_text",
text: "sexual/minors",
},
value:
'{"reporterPubkey":"npub123","nip56_report_type":"illegal","nip69":"IL-csa"}',
value: "npub123",
action_id: "sexual/minors",
},
{
Expand All @@ -197,8 +188,7 @@ describe("Slack", () => {
type: "plain_text",
text: "violence",
},
value:
'{"reporterPubkey":"npub123","nip56_report_type":"other","nip69":"VI"}',
value: "npub123",
action_id: "violence",
},
{
Expand All @@ -207,8 +197,7 @@ describe("Slack", () => {
type: "plain_text",
text: "violence/graphic",
},
value:
'{"reporterPubkey":"npub123","nip56_report_type":"other","nip69":"VI"}',
value: "npub123",
action_id: "violence/graphic",
},
],
Expand Down

0 comments on commit 9fc7f84

Please sign in to comment.