Skip to content

Commit

Permalink
✨ Optionally allow comment when sending email to be added to moderati…
Browse files Browse the repository at this point in the history
…on event (#1981)
  • Loading branch information
foysalit authored Dec 20, 2023
1 parent f365dc5 commit 905743d
Show file tree
Hide file tree
Showing 12 changed files with 50 additions and 1 deletion.
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

0 comments on commit 905743d

Please sign in to comment.