mirror of https://github.com/Chocobozzz/PeerTube
Add postingRestrictedToMods to channels AP objects
See https://github.com/LemmyNet/lemmy/issues/3837pull/6266/head
parent
2e760485c1
commit
a4b497c2a9
|
@ -27,6 +27,9 @@ export interface ActivityPubActor {
|
|||
publicKeyPem: string
|
||||
}
|
||||
|
||||
// Lemmy attribute for groups
|
||||
postingRestrictedToMods?: boolean
|
||||
|
||||
image?: ActivityIconObject | ActivityIconObject[]
|
||||
icon?: ActivityIconObject | ActivityIconObject[]
|
||||
|
||||
|
|
|
@ -192,6 +192,9 @@ const contextStore: { [ id in ContextType ]: (string | { [ id: string ]: string
|
|||
'@id': 'pt:support'
|
||||
},
|
||||
|
||||
lemmy: 'https://join-lemmy.org/ns#',
|
||||
postingRestrictedToMods: 'lemmy:postingRestrictedToMods',
|
||||
|
||||
// TODO: remove in a few versions, introduced in 4.2
|
||||
icons: 'as:icon'
|
||||
}),
|
||||
|
|
|
@ -825,16 +825,19 @@ export class VideoChannelModel extends SequelizeModel<VideoChannelModel> {
|
|||
async toActivityPubObject (this: MChannelAP): Promise<ActivityPubActor> {
|
||||
const obj = await this.Actor.toActivityPubObject(this.name)
|
||||
|
||||
return Object.assign(obj, {
|
||||
return {
|
||||
...obj,
|
||||
|
||||
summary: this.description,
|
||||
support: this.support,
|
||||
postingRestrictedToMods: true,
|
||||
attributedTo: [
|
||||
{
|
||||
type: 'Person' as 'Person',
|
||||
id: this.Account.Actor.url
|
||||
}
|
||||
]
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
// Avoid error when running this method on MAccount... | MChannel...
|
||||
|
|
Loading…
Reference in New Issue