]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/models/account/account.ts
Fix retrieving of deleted comments when subscribing to a new instance
[github/Chocobozzz/PeerTube.git] / server / models / account / account.ts
index 8369738b9c87620aef2049820bcec416c32f5ac1..a818a5a4dfd8b4d310184b456acdbe37e0e0f460 100644 (file)
@@ -32,7 +32,7 @@ import { FindOptions, IncludeOptions, Op, Transaction, WhereOptions } from 'sequ
 import { AccountBlocklistModel } from './account-blocklist'
 import { ServerBlocklistModel } from '../server/server-blocklist'
 import { ActorFollowModel } from '../activitypub/actor-follow'
-import { MAccountActor, MAccountDefault, MAccountSummaryFormattable, MAccountFormattable } from '../../typings/models'
+import { MAccountActor, MAccountDefault, MAccountSummaryFormattable, MAccountFormattable, MAccountAP } from '../../typings/models'
 import * as Bluebird from 'bluebird'
 
 export enum ScopeNames {
@@ -201,7 +201,7 @@ export class AccountModel extends Model<AccountModel> {
 
   @HasMany(() => VideoCommentModel, {
     foreignKey: {
-      allowNull: false
+      allowNull: true
     },
     onDelete: 'cascade',
     hooks: true
@@ -380,8 +380,8 @@ export class AccountModel extends Model<AccountModel> {
     }
   }
 
-  toActivityPubObject () {
-    const obj = this.Actor.toActivityPubObject(this.name, 'Account')
+  toActivityPubObject (this: MAccountAP) {
+    const obj = this.Actor.toActivityPubObject(this.name)
 
     return Object.assign(obj, {
       summary: this.description