aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/models
diff options
context:
space:
mode:
Diffstat (limited to 'server/models')
-rw-r--r--server/models/activitypub/actor.ts15
1 files changed, 14 insertions, 1 deletions
diff --git a/server/models/activitypub/actor.ts b/server/models/activitypub/actor.ts
index 42a24b583..66a13b857 100644
--- a/server/models/activitypub/actor.ts
+++ b/server/models/activitypub/actor.ts
@@ -48,6 +48,7 @@ import {
48 MActorWithInboxes 48 MActorWithInboxes
49} from '../../typings/models' 49} from '../../typings/models'
50import * as Bluebird from 'bluebird' 50import * as Bluebird from 'bluebird'
51import { Op } from 'sequelize'
51 52
52enum ScopeNames { 53enum ScopeNames {
53 FULL = 'FULL' 54 FULL = 'FULL'
@@ -115,7 +116,19 @@ export const unusedActorAttributesForAPI = [
115 }, 116 },
116 { 117 {
117 fields: [ 'preferredUsername', 'serverId' ], 118 fields: [ 'preferredUsername', 'serverId' ],
118 unique: true 119 unique: true,
120 where: {
121 serverId: {
122 [Op.ne]: null
123 }
124 }
125 },
126 {
127 fields: [ 'preferredUsername' ],
128 unique: true,
129 where: {
130 serverId: null
131 }
119 }, 132 },
120 { 133 {
121 fields: [ 'inboxUrl', 'sharedInboxUrl' ] 134 fields: [ 'inboxUrl', 'sharedInboxUrl' ]