Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

✨ Optionally allow comment when sending email to be added to moderation event #1981

Merged
merged 1 commit into from
Dec 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions lexicons/com/atproto/admin/defs.json
Original file line number Diff line number Diff line change
Expand Up @@ -557,6 +557,10 @@
"subjectLine": {
"type": "string",
"description": "The subject line of the email sent to the user."
},
"comment": {
"type": "string",
"description": "Additional comment about the outgoing comm."
}
}
}
Expand Down
6 changes: 5 additions & 1 deletion lexicons/com/atproto/admin/sendEmail.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,11 @@
"recipientDid": { "type": "string", "format": "did" },
"content": { "type": "string" },
"subject": { "type": "string" },
"senderDid": { "type": "string", "format": "did" }
"senderDid": { "type": "string", "format": "did" },
"comment": {
"type": "string",
"description": "Additional comment by the sender that won't be used in the email itself but helpful to provide more context for moderators/reviewers"
}
}
}
},
Expand Down
9 changes: 9 additions & 0 deletions packages/api/src/client/lexicons.ts
Original file line number Diff line number Diff line change
Expand Up @@ -816,6 +816,10 @@ export const schemaDict = {
type: 'string',
description: 'The subject line of the email sent to the user.',
},
comment: {
type: 'string',
description: 'Additional comment about the outgoing comm.',
},
},
},
},
Expand Down Expand Up @@ -1467,6 +1471,11 @@ export const schemaDict = {
type: 'string',
format: 'did',
},
comment: {
type: 'string',
description:
"Additional comment by the sender that won't be used in the email itself but helpful to provide more context for moderators/reviewers",
},
},
},
},
Expand Down
2 changes: 2 additions & 0 deletions packages/api/src/client/types/com/atproto/admin/defs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -674,6 +674,8 @@ export function validateModEventUnmute(v: unknown): ValidationResult {
export interface ModEventEmail {
/** The subject line of the email sent to the user. */
subjectLine: string
/** Additional comment about the outgoing comm. */
comment?: string
[k: string]: unknown
}

Expand Down
2 changes: 2 additions & 0 deletions packages/api/src/client/types/com/atproto/admin/sendEmail.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ export interface InputSchema {
content: string
subject?: string
senderDid: string
/** Additional comment by the sender that won't be used in the email itself but helpful to provide more context for moderators/reviewers */
comment?: string
[k: string]: unknown
}

Expand Down
9 changes: 9 additions & 0 deletions packages/bsky/src/lexicon/lexicons.ts
Original file line number Diff line number Diff line change
Expand Up @@ -816,6 +816,10 @@ export const schemaDict = {
type: 'string',
description: 'The subject line of the email sent to the user.',
},
comment: {
type: 'string',
description: 'Additional comment about the outgoing comm.',
},
},
},
},
Expand Down Expand Up @@ -1467,6 +1471,11 @@ export const schemaDict = {
type: 'string',
format: 'did',
},
comment: {
type: 'string',
description:
"Additional comment by the sender that won't be used in the email itself but helpful to provide more context for moderators/reviewers",
},
},
},
},
Expand Down
2 changes: 2 additions & 0 deletions packages/bsky/src/lexicon/types/com/atproto/admin/defs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -674,6 +674,8 @@ export function validateModEventUnmute(v: unknown): ValidationResult {
export interface ModEventEmail {
/** The subject line of the email sent to the user. */
subjectLine: string
/** Additional comment about the outgoing comm. */
comment?: string
[k: string]: unknown
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ export interface InputSchema {
content: string
subject?: string
senderDid: string
/** Additional comment by the sender that won't be used in the email itself but helpful to provide more context for moderators/reviewers */
comment?: string
[k: string]: unknown
}

Expand Down
2 changes: 2 additions & 0 deletions packages/pds/src/api/com/atproto/admin/sendEmail.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ export default function (server: Server, ctx: AppContext) {
recipientDid,
senderDid,
subject = 'Message from Bluesky moderator',
comment,
} = input.body
const account = await ctx.accountManager.getAccount(recipientDid)
if (!account) {
Expand Down Expand Up @@ -44,6 +45,7 @@ export default function (server: Server, ctx: AppContext) {
event: {
$type: 'com.atproto.admin.defs#modEventEmail',
subjectLine: subject,
comment,
},
subject: {
$type: 'com.atproto.admin.defs#repoRef',
Expand Down
9 changes: 9 additions & 0 deletions packages/pds/src/lexicon/lexicons.ts
Original file line number Diff line number Diff line change
Expand Up @@ -816,6 +816,10 @@ export const schemaDict = {
type: 'string',
description: 'The subject line of the email sent to the user.',
},
comment: {
type: 'string',
description: 'Additional comment about the outgoing comm.',
},
},
},
},
Expand Down Expand Up @@ -1467,6 +1471,11 @@ export const schemaDict = {
type: 'string',
format: 'did',
},
comment: {
type: 'string',
description:
"Additional comment by the sender that won't be used in the email itself but helpful to provide more context for moderators/reviewers",
},
},
},
},
Expand Down
2 changes: 2 additions & 0 deletions packages/pds/src/lexicon/types/com/atproto/admin/defs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -674,6 +674,8 @@ export function validateModEventUnmute(v: unknown): ValidationResult {
export interface ModEventEmail {
/** The subject line of the email sent to the user. */
subjectLine: string
/** Additional comment about the outgoing comm. */
comment?: string
[k: string]: unknown
}

Expand Down
2 changes: 2 additions & 0 deletions packages/pds/src/lexicon/types/com/atproto/admin/sendEmail.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ export interface InputSchema {
content: string
subject?: string
senderDid: string
/** Additional comment by the sender that won't be used in the email itself but helpful to provide more context for moderators/reviewers */
comment?: string
[k: string]: unknown
}

Expand Down
Loading